]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/TypeDescription.h
new object file format in compiler
[l2e.git] / src / loader / TypeDescription.h
index 0f530d8a6ab1910f6dd43f9b9610f116817e0f94..fb1b07890a8fe57bff4b46d58e540d7734e583eb 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * TypeDescription.h
- *
- *  Created on: Sep 4, 2012
- *      Author: holy
- */
-
 #ifndef LOADER_TYPEDESCRIPTION_H_
 #define LOADER_TYPEDESCRIPTION_H_
 
@@ -48,6 +41,7 @@ public:
        const FieldDescription &GetField(const std::string &name) const;
        void Construct(void *) const;
        void Load(void *) const;
+       bool NeedsLinking() const { return link; }
 
        void SetConstructor(void (*ctor)(void *)) { constructor = ctor; }
        void SetLoader(void (*ld)(void *)) { loader = ld; }
@@ -74,10 +68,12 @@ public:
        static int GetTypeId(const std::string &);
        static const TypeDescription &Get(int id);
 
+       static int GetMaxSize();
+
        static void WriteSourceWiki(std::ostream &);
 
 private:
-       TypeDescription(int id, const std::string &name) : constructor(0), loader(0), description(0), name(name), id(id), size(0) { }
+       TypeDescription(int id, const std::string &name) : constructor(0), loader(0), description(0), name(name), id(id), size(0), link(false) { }
 
 private:
        void (*constructor)(void *);
@@ -88,6 +84,7 @@ private:
        std::map<int, std::ptrdiff_t> supertypes;
        int id;
        int size;
+       bool link;
 
        static std::map<int, TypeDescription> typeDescriptions;
        static std::map<std::string, int> typeName2ID;
@@ -96,4 +93,4 @@ private:
 
 }
 
-#endif /* LOADER_TYPEDESCRIPTION_H_ */
+#endif