X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FTypeDescription.h;h=078002fed916c2a96481be4b050c205edae60331;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=0f530d8a6ab1910f6dd43f9b9610f116817e0f94;hpb=1907ca03c5e865c4d398170042aa384c67ffff29;p=l2e.git diff --git a/src/loader/TypeDescription.h b/src/loader/TypeDescription.h index 0f530d8..078002f 100644 --- a/src/loader/TypeDescription.h +++ b/src/loader/TypeDescription.h @@ -1,10 +1,3 @@ -/* - * TypeDescription.h - * - * Created on: Sep 4, 2012 - * Author: holy - */ - #ifndef LOADER_TYPEDESCRIPTION_H_ #define LOADER_TYPEDESCRIPTION_H_ @@ -47,9 +40,11 @@ public: bool HasField(const std::string &name) const; const FieldDescription &GetField(const std::string &name) const; void Construct(void *) const; + void Init(void *) const; void Load(void *) const; void SetConstructor(void (*ctor)(void *)) { constructor = ctor; } + void SetInitializer(void (*init)(void *)) { initializer = init; } void SetLoader(void (*ld)(void *)) { loader = ld; } void AddSupertype(int id, std::ptrdiff_t offset); bool IsSubtypeOf(int id) const; @@ -74,13 +69,24 @@ 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) + , initializer(0) + , loader(0) + , description(0) + , name(name) + , id(id) + , size(0) + { } private: void (*constructor)(void *); + void (*initializer)(void *); void (*loader)(void *); const char *description; std::string name; @@ -96,4 +102,4 @@ private: } -#endif /* LOADER_TYPEDESCRIPTION_H_ */ +#endif