]> git.tdb.fi Git - builder.git/blobdiff - source/binarycomponent.h
Split Component into several subclasses
[builder.git] / source / binarycomponent.h
diff --git a/source/binarycomponent.h b/source/binarycomponent.h
new file mode 100644 (file)
index 0000000..3a6affd
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef BINARYCOMPONENT_H_
+#define BINARYCOMPONENT_H_
+
+#include "component.h"
+
+class BinaryComponent: public Component
+{
+public:
+       class Loader: public Msp::DataFile::DerivedObjectLoader<BinaryComponent, Component::Loader>
+       {
+       public:
+               Loader(BinaryComponent &);
+       private:
+               void use(const std::string &);
+       };
+
+       enum Type
+       {
+               LIBRARY,
+               PROGRAM,
+               MODULE
+       };
+
+private:
+       typedef std::list<const Component *> UseList;
+
+       Type type;
+       UseList uses;
+
+public:
+       BinaryComponent(SourcePackage &, const std::string &, Type);
+
+       Type get_type() const { return type; }
+
+       virtual void create_build_info();
+       virtual void update_exported_build_info(BuildInfo &) const;
+       virtual void create_targets() const;
+};
+
+#endif