/**
* @ingroup cluster
*/
-class ClusterListener : public ReflectionObjectImpl<ClusterListener>
+class ClusterListener : public ObjectImpl<ClusterListener>
{
public:
DECLARE_PTR_TYPEDEFS(ClusterListener);
*
* @ingroup cluster
*/
-class Endpoint : public ReflectionObjectImpl<Endpoint>
+class Endpoint : public ObjectImpl<Endpoint>
{
public:
DECLARE_PTR_TYPEDEFS(Endpoint);
*
* @ingroup compat
*/
-class CheckResultReader : public ReflectionObjectImpl<CheckResultReader>
+class CheckResultReader : public ObjectImpl<CheckResultReader>
{
public:
DECLARE_PTR_TYPEDEFS(CheckResultReader);
*
* @ingroup compat
*/
-class CompatLogger : public ReflectionObjectImpl<CompatLogger>
+class CompatLogger : public ObjectImpl<CompatLogger>
{
public:
DECLARE_PTR_TYPEDEFS(CompatLogger);
/**
* @ingroup compat
*/
-class ExternalCommandListener : public ReflectionObjectImpl<ExternalCommandListener>
+class ExternalCommandListener : public ObjectImpl<ExternalCommandListener>
{
public:
DECLARE_PTR_TYPEDEFS(ExternalCommandListener);
/**
* @ingroup compat
*/
-class StatusDataWriter : public ReflectionObjectImpl<StatusDataWriter>
+class StatusDataWriter : public ObjectImpl<StatusDataWriter>
{
public:
DECLARE_PTR_TYPEDEFS(StatusDataWriter);
*
* @ingroup ido
*/
-class IdoMysqlConnection : public ReflectionObjectImpl<IdoMysqlConnection>
+class IdoMysqlConnection : public ObjectImpl<IdoMysqlConnection>
{
public:
DECLARE_PTR_TYPEDEFS(IdoMysqlConnection);
*
* @ingroup ido
*/
-class IdoPgsqlConnection : public ReflectionObjectImpl<IdoPgsqlConnection>
+class IdoPgsqlConnection : public ObjectImpl<IdoPgsqlConnection>
{
public:
DECLARE_PTR_TYPEDEFS(IdoPgsqlConnection);
/**
* @ingroup demo
*/
-class Demo : public ReflectionObjectImpl<Demo>
+class Demo : public ObjectImpl<Demo>
{
public:
DECLARE_PTR_TYPEDEFS(Demo);
/**
* @ingroup livestatus
*/
-class LivestatusListener : public ReflectionObjectImpl<LivestatusListener>
+class LivestatusListener : public ObjectImpl<LivestatusListener>
{
public:
DECLARE_PTR_TYPEDEFS(LivestatusListener);
/**
* @ingroup notification
*/
-class NotificationComponent : public ReflectionObjectImpl<NotificationComponent>
+class NotificationComponent : public ObjectImpl<NotificationComponent>
{
public:
DECLARE_PTR_TYPEDEFS(NotificationComponent);
*
* @ingroup perfdata
*/
-class GraphiteWriter : public ReflectionObjectImpl<GraphiteWriter>
+class GraphiteWriter : public ObjectImpl<GraphiteWriter>
{
public:
DECLARE_PTR_TYPEDEFS(GraphiteWriter);
*
* @ingroup icinga
*/
-class PerfdataWriter : public ReflectionObjectImpl<PerfdataWriter>
+class PerfdataWriter : public ObjectImpl<PerfdataWriter>
{
public:
DECLARE_PTR_TYPEDEFS(PerfdataWriter);
dynamicobject.th dynamictype.cpp exception.cpp fifo.cpp filelogger.cpp
filelogger.th logger.cpp logger.th netstring.cpp networkstream.cpp object.cpp
objectlock.cpp process.cpp process-unix.cpp process-windows.cpp qstring.cpp
- reflectionobject.cpp ringbuffer.cpp script.cpp script.th scriptfunction.cpp
- scriptfunctionwrapper.cpp scriptinterpreter.cpp scriptlanguage.cpp
- scriptvariable.cpp socket.cpp stacktrace.cpp stdiostream.cpp stream_bio.cpp
- stream.cpp streamlogger.cpp streamlogger.th sysloglogger.cpp sysloglogger.th
- tcpsocket.cpp threadpool.cpp timer.cpp tlsstream.cpp tlsutility.cpp
- unixsocket.cpp utility.cpp value.cpp workqueue.cpp zlibstream.cpp
+ ringbuffer.cpp script.cpp script.th scriptfunction.cpp scriptfunctionwrapper.cpp
+ scriptinterpreter.cpp scriptlanguage.cpp scriptvariable.cpp serializer.cpp
+ socket.cpp stacktrace.cpp stdiostream.cpp stream_bio.cpp stream.cpp
+ streamlogger.cpp streamlogger.th sysloglogger.cpp sysloglogger.th tcpsocket.cpp
+ threadpool.cpp timer.cpp tlsstream.cpp tlsutility.cpp unixsocket.cpp
+ utility.cpp value.cpp workqueue.cpp zlibstream.cpp
)
target_link_libraries(base ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cJSON mmatch)
*
* @ingroup base
*/
-class I2_BASE_API Application : public ReflectionObjectImpl<Application> {
+class I2_BASE_API Application : public ObjectImpl<Application> {
public:
DECLARE_PTR_TYPEDEFS(Application);
*
* @ingroup base
*/
-class I2_BASE_API ConsoleLogger : public ReflectionObjectImpl<ConsoleLogger>
+class I2_BASE_API ConsoleLogger : public ObjectImpl<ConsoleLogger>
{
public:
DECLARE_PTR_TYPEDEFS(ConsoleLogger);
#include "base/dynamicobject.h"
#include "base/dynamictype.h"
+#include "base/serializer.h"
#include "base/netstring.h"
#include "base/registry.h"
#include "base/stdiostream.h"
persistentObject->Set("type", type->GetName());
persistentObject->Set("name", object->GetName());
- Dictionary::Ptr update = object->Serialize(attributeTypes);
+ Dictionary::Ptr update = Serializer::Serialize(object, attributeTypes);
if (!update)
continue;
if (object) {
ASSERT(!object->IsActive());
Log(LogDebug, "base", "Restoring object '" + name + "' of type '" + type + "'.");
- object->Deserialize(update, attributeTypes);
+ Serializer::Deserialize(object, update, attributeTypes);
object->OnStateLoaded();
}
class DynamicType;
-/**
- * The type of an attribute for a DynamicObject.
- *
- * @ingroup base
- */
-enum AttributeType
-{
- Attribute_State = FAState,
- Attribute_Config = FAConfig
-};
-
enum DomainPriv
{
DomainPrivRead = (1<<0),
*
* @ingroup base
*/
-class I2_BASE_API DynamicObject : public ReflectionObjectImpl<DynamicObject>
+class I2_BASE_API DynamicObject : public ObjectImpl<DynamicObject>
{
public:
DECLARE_PTR_TYPEDEFS(DynamicObject);
return dynamic_pointer_cast<T>(object);
}
- static void DumpObjects(const String& filename, int attributeTypes = Attribute_State);
- static void RestoreObjects(const String& filename, int attributeTypes = Attribute_State);
+ static void DumpObjects(const String& filename, int attributeTypes = FAState);
+ static void RestoreObjects(const String& filename, int attributeTypes = FAState);
static void StopObjects(void);
protected:
******************************************************************************/
#include "base/dynamictype.h"
+#include "base/serializer.h"
#include "base/debug.h"
#include "base/objectlock.h"
DynamicObject::Ptr object = factory();
- object->Deserialize(serializedUpdate, Attribute_Config);
+ Serializer::Deserialize(object, serializedUpdate, FAConfig);
return object;
}
*
* @ingroup base
*/
-class I2_BASE_API FileLogger : public ReflectionObjectImpl<FileLogger>
+class I2_BASE_API FileLogger : public ObjectImpl<FileLogger>
{
public:
DECLARE_PTR_TYPEDEFS(FileLogger);
*
* @ingroup base
*/
-class I2_BASE_API Logger : public ReflectionObjectImpl<Logger>
+class I2_BASE_API Logger : public ObjectImpl<Logger>
{
public:
DECLARE_PTR_TYPEDEFS(Logger);
{
return m_Object;
}
+
+const Type *Object::GetReflectionType(void) const
+{
+ return NULL;
+}
+
+void Object::SetField(int id, const Value& value)
+{
+ throw std::runtime_error("Invalid field ID.");
+}
+
+Value Object::GetField(int id) const
+{
+ throw std::runtime_error("Invalid field ID.");
+}
typedef shared_ptr<klass> Ptr; \
typedef weak_ptr<klass> WeakPtr
+class Type;
+
/**
* Base class for all heap-allocated objects. At least one of its methods
* has to be virtual for RTTI to work.
Object(void);
virtual ~Object(void);
+ virtual const Type *GetReflectionType(void) const;
+ virtual void SetField(int id, const Value& value);
+ virtual Value GetField(int id) const;
+
/**
* Holds a shared pointer and provides support for implicit upcasts.
*
}
};
+template<typename T>
+class TypeImpl
+{
+};
+
+template<typename T>
+class ObjectImpl
+{
+};
+
}
#endif /* OBJECT_H */
*
* @ingroup base
*/
-class I2_BASE_API Script : public ReflectionObjectImpl<Script>
+class I2_BASE_API Script : public ObjectImpl<Script>
{
public:
DECLARE_PTR_TYPEDEFS(Script);
--- /dev/null
+/******************************************************************************
+* Icinga 2 *
+* Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/) *
+* *
+* This program is free software; you can redistribute it and/or *
+* modify it under the terms of the GNU General Public License *
+* as published by the Free Software Foundation; either version 2 *
+* of the License, or (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the Free Software Foundation *
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
+******************************************************************************/
+
+#include "base/serializer.h"
+#include "base/type.h"
+#include <boost/smart_ptr/make_shared.hpp>
+
+using namespace icinga;
+
+Dictionary::Ptr Serializer::Serialize(const Object::Ptr& object, int attributeTypes)
+{
+ const Type *type = object->GetReflectionType();
+
+ Dictionary::Ptr update = boost::make_shared<Dictionary>();
+
+ for (int i = 0; i < type->GetFieldCount(); i++) {
+ Field field = type->GetFieldInfo(i);
+
+ if ((field.Attributes & attributeTypes) == 0)
+ continue;
+
+ update->Set(field.Name, object->GetField(i));
+ }
+
+ return update;
+}
+
+void Serializer::Deserialize(const Object::Ptr& object, const Dictionary::Ptr& update, int attributeTypes)
+{
+ const Type *type = object->GetReflectionType();
+
+ for (int i = 0; i < type->GetFieldCount(); i++) {
+ Field field = type->GetFieldInfo(i);
+
+ if ((field.Attributes & attributeTypes) == 0)
+ continue;
+
+ if (!update->Contains(field.Name))
+ continue;
+
+ object->SetField(i, update->Get(field.Name));
+ }
+}
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
-#include "base/reflectionobject.h"
-#include <boost/smart_ptr/make_shared.hpp>
+#ifndef SERIALIZER_H
+#define SERIALIZER_H
-using namespace icinga;
+#include "base/i2-base.h"
+#include "base/dictionary.h"
-Dictionary::Ptr ReflectionObject::Serialize(int attributeTypes) const
+namespace icinga
{
- const ReflectionType *type = GetReflectionType();
- Dictionary::Ptr update = boost::make_shared<Dictionary>();
-
- for (int i = 0; i < type->GetFieldCount(); i++) {
- ReflectionField field = type->GetFieldInfo(i);
-
- if ((field.Attributes & attributeTypes) == 0)
- continue;
-
- update->Set(field.Name, GetField(i));
- }
-
- return update;
-}
-
-void ReflectionObject::Deserialize(const Dictionary::Ptr& update, int attributeTypes)
+/**
+ * Serializer utilities.
+ *
+ * @ingroup base
+ */
+class I2_BASE_API Serializer
{
- const ReflectionType *type = GetReflectionType();
-
- for (int i = 0; i < type->GetFieldCount(); i++) {
- ReflectionField field = type->GetFieldInfo(i);
+public:
+ static Dictionary::Ptr Serialize(const Object::Ptr& object, int attributeTypes);
+ static void Deserialize(const Object::Ptr& object, const Dictionary::Ptr& update, int attributeTypes);
- if ((field.Attributes & attributeTypes) == 0)
- continue;
+private:
+ Serializer(void);
+};
- if (!update->Contains(field.Name))
- continue;
-
- SetField(i, update->Get(field.Name));
- }
}
+
+#endif /* SERIALIZER_H */
*
* @ingroup base
*/
-class I2_BASE_API StreamLogger : public ReflectionObjectImpl<StreamLogger>
+class I2_BASE_API StreamLogger : public ObjectImpl<StreamLogger>
{
public:
DECLARE_PTR_TYPEDEFS(StreamLogger);
*
* @ingroup base
*/
-class I2_BASE_API SyslogLogger : public ReflectionObjectImpl<SyslogLogger>
+class I2_BASE_API SyslogLogger : public ObjectImpl<SyslogLogger>
{
public:
DECLARE_PTR_TYPEDEFS(SyslogLogger);
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
-#ifndef REFLECTIONOBJECT_H
-#define REFLECTIONOBJECT_H
+#ifndef TYPE_H
+#define TYPE_H
-#include "base/object.h"
-#include "base/dictionary.h"
-#include <vector>
+#include "base/i2-base.h"
+#include "base/qstring.h"
namespace icinga
{
-enum ReflectionFieldAttribute
+enum FieldAttribute
{
FAConfig = 1,
FAState = 2
};
-struct ReflectionField
+struct Field
{
int ID;
String Name;
int Attributes;
- ReflectionField(int id, const String& name, int attributes)
+ Field(int id, const String& name, int attributes)
: ID(id), Name(name), Attributes(attributes)
{ }
};
-enum InvokationType
-{
- ITGet,
- ITSet
-};
-
-class I2_BASE_API ReflectionType
+class I2_BASE_API Type
{
public:
virtual int GetFieldId(const String& name) const = 0;
- virtual ReflectionField GetFieldInfo(int id) const = 0;
+ virtual Field GetFieldInfo(int id) const = 0;
virtual int GetFieldCount(void) const = 0;
};
-class I2_BASE_API ReflectionObject : public Object
-{
-public:
- DECLARE_PTR_TYPEDEFS(ReflectionObject);
-
- virtual const ReflectionType *GetReflectionType(void) const = 0;
- virtual void SetField(int id, const Value& value) = 0;
- virtual Value GetField(int id) const = 0;
-
- Dictionary::Ptr Serialize(int attributeTypes) const;
- void Deserialize(const Dictionary::Ptr& update, int attributeTypes);
-};
-
-template<typename T>
-class ReflectionTypeImpl
-{
-};
-
-template<typename T>
-class ReflectionObjectImpl
-{
-};
-
}
-#endif /* REFLECTIONOBJECT_H */
+#endif /* TYPE_H */
*
* @ingroup db_ido
*/
-class I2_DB_IDO_API DbConnection : public ReflectionObjectImpl<DbConnection>
+class I2_DB_IDO_API DbConnection : public ObjectImpl<DbConnection>
{
public:
DECLARE_PTR_TYPEDEFS(DbConnection);
*
* @ingroup icinga
*/
-class I2_ICINGA_API CheckCommand : public ReflectionObjectImpl<CheckCommand>
+class I2_ICINGA_API CheckCommand : public ObjectImpl<CheckCommand>
{
public:
DECLARE_PTR_TYPEDEFS(CheckCommand);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Command : public ReflectionObjectImpl<Command>, public MacroResolver
+class I2_ICINGA_API Command : public ObjectImpl<Command>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(Command);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Domain : public ReflectionObjectImpl<Domain>
+class I2_ICINGA_API Domain : public ObjectImpl<Domain>
{
public:
DECLARE_PTR_TYPEDEFS(Domain);
*
* @ingroup icinga
*/
-class I2_ICINGA_API EventCommand : public ReflectionObjectImpl<EventCommand>
+class I2_ICINGA_API EventCommand : public ObjectImpl<EventCommand>
{
public:
DECLARE_PTR_TYPEDEFS(EventCommand);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Host : public ReflectionObjectImpl<Host>, public MacroResolver
+class I2_ICINGA_API Host : public ObjectImpl<Host>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(Host);
*
* @ingroup icinga
*/
-class I2_ICINGA_API HostGroup : public ReflectionObjectImpl<HostGroup>
+class I2_ICINGA_API HostGroup : public ObjectImpl<HostGroup>
{
public:
DECLARE_PTR_TYPEDEFS(HostGroup);
*
* @ingroup icinga
*/
-class I2_ICINGA_API IcingaApplication : public ReflectionObjectImpl<IcingaApplication>, public MacroResolver
+class I2_ICINGA_API IcingaApplication : public ObjectImpl<IcingaApplication>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(IcingaApplication);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Notification : public ReflectionObjectImpl<Notification>, public MacroResolver
+class I2_ICINGA_API Notification : public ObjectImpl<Notification>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(Notification);
*
* @ingroup icinga
*/
-class I2_ICINGA_API NotificationCommand : public ReflectionObjectImpl<NotificationCommand>
+class I2_ICINGA_API NotificationCommand : public ObjectImpl<NotificationCommand>
{
public:
DECLARE_PTR_TYPEDEFS(NotificationCommand);
*
* @ingroup icinga
*/
-class I2_ICINGA_API Service : public ReflectionObjectImpl<Service>, public MacroResolver
+class I2_ICINGA_API Service : public ObjectImpl<Service>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(Service);
*
* @ingroup icinga
*/
-class I2_ICINGA_API ServiceGroup : public ReflectionObjectImpl<ServiceGroup>
+class I2_ICINGA_API ServiceGroup : public ObjectImpl<ServiceGroup>
{
public:
DECLARE_PTR_TYPEDEFS(ServiceGroup);
*
* @ingroup icinga
*/
-class I2_ICINGA_API TimePeriod : public ReflectionObjectImpl<TimePeriod>
+class I2_ICINGA_API TimePeriod : public ObjectImpl<TimePeriod>
{
public:
DECLARE_PTR_TYPEDEFS(TimePeriod);
*
* @ingroup icinga
*/
-class I2_ICINGA_API User : public ReflectionObjectImpl<User>, public MacroResolver
+class I2_ICINGA_API User : public ObjectImpl<User>, public MacroResolver
{
public:
DECLARE_PTR_TYPEDEFS(User);
*
* @ingroup icinga
*/
-class I2_ICINGA_API UserGroup : public ReflectionObjectImpl<UserGroup>
+class I2_ICINGA_API UserGroup : public ObjectImpl<UserGroup>
{
public:
DECLARE_PTR_TYPEDEFS(UserGroup);
if (klass.Name.find_first_of(':') == std::string::npos)
std::cout << "class " << klass.Name << ";" << std::endl << std::endl;
- /* ReflectionTypeImpl */
+ /* TypeImpl */
std::cout << "template<>" << std::endl
- << "class ReflectionTypeImpl<" << klass.Name << ">"
- << " : public ReflectionType, public Singleton<ReflectionTypeImpl<" << klass.Name << "> >" << std::endl
+ << "class TypeImpl<" << klass.Name << ">"
+ << " : public Type, public Singleton<TypeImpl<" << klass.Name << "> >" << std::endl
<< "{" << std::endl
<< "public:" << std::endl;
<< "\t\t" << "int offset = ";
if (!klass.Parent.empty())
- std::cout << "ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldCount()";
+ std::cout << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount()";
else
std::cout << "0";
<< "\t\t" << "return ";
if (!klass.Parent.empty())
- std::cout << "ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldId(name)";
+ std::cout << "TypeImpl<" << klass.Parent << ">::StaticGetFieldId(name)";
else
std::cout << "-1";
<< "\t" << "}" << std::endl << std::endl;
/* GetFieldInfo */
- std::cout << "\t" << "virtual ReflectionField GetFieldInfo(int id) const" << std::endl
+ std::cout << "\t" << "virtual Field GetFieldInfo(int id) const" << std::endl
<< "\t" << "{" << std::endl
<< "\t\t" << "return StaticGetFieldInfo(id);" << std::endl
<< "\t" << "}" << std::endl << std::endl;
/* StaticGetFieldInfo */
- std::cout << "\t" << "static ReflectionField StaticGetFieldInfo(int id)" << std::endl
+ std::cout << "\t" << "static Field StaticGetFieldInfo(int id)" << std::endl
<< "\t" << "{" << std::endl;
if (!klass.Parent.empty())
- std::cout << "\t\t" << "int real_id = id - " << "ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldCount();" << std::endl
- << "\t\t" << "if (real_id < 0) { return " << "ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldInfo(id); }" << std::endl;
+ std::cout << "\t\t" << "int real_id = id - " << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount();" << std::endl
+ << "\t\t" << "if (real_id < 0) { return " << "TypeImpl<" << klass.Parent << ">::StaticGetFieldInfo(id); }" << std::endl;
std::cout << "\t\t" << "switch (";
num = 0;
for (it = klass.Fields.begin(); it != klass.Fields.end(); it++) {
std::cout << "\t\t\t" << "case " << num << ":" << std::endl
- << "\t\t\t\t" << "return ReflectionField(" << num << ", \"" << it->Name << "\", " << it->Attributes << ");" << std::endl;
+ << "\t\t\t\t" << "return Field(" << num << ", \"" << it->Name << "\", " << it->Attributes << ");" << std::endl;
num++;
}
<< "\t\t" << "return " << klass.Fields.size();
if (!klass.Parent.empty())
- std::cout << " + " << "ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldCount()";
+ std::cout << " + " << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount()";
std::cout << ";" << std::endl
<< "\t" << "}" << std::endl << std::endl;
std::cout << "};" << std::endl << std::endl;
- /* ReflectionObjectImpl */
+ /* ObjectImpl */
std::cout << "template<>" << std::endl
- << "class ReflectionObjectImpl<" << klass.Name << ">"
- << " : public " << (klass.Parent.empty() ? "ReflectionObject" : klass.Parent) << std::endl
+ << "class ObjectImpl<" << klass.Name << ">"
+ << " : public " << (klass.Parent.empty() ? "Object" : klass.Parent) << std::endl
<< "{" << std::endl
<< "public:" << std::endl
- << "\t" << "DECLARE_PTR_TYPEDEFS(ReflectionObjectImpl<" << klass.Name << ">);" << std::endl << std::endl;
+ << "\t" << "DECLARE_PTR_TYPEDEFS(ObjectImpl<" << klass.Name << ">);" << std::endl << std::endl;
- /* GetType */
- std::cout << "\t" << "virtual const ReflectionType *GetReflectionType(void) const" << std::endl
+ /* GetReflectionType */
+ std::cout << "\t" << "virtual const Type *GetReflectionType(void) const" << std::endl
<< "\t" << "{" << std::endl
- << "\t\t" << "return ReflectionTypeImpl<" << klass.Name << ">::GetInstance();" << std::endl
+ << "\t\t" << "return TypeImpl<" << klass.Name << ">::GetInstance();" << std::endl
<< "\t" << "}" << std::endl << std::endl;
if (!klass.Fields.empty()) {
/* constructor */
std::cout << "public:" << std::endl
- << "\t" << "ReflectionObjectImpl<" << klass.Name << ">(void)" << std::endl
+ << "\t" << "ObjectImpl<" << klass.Name << ">(void)" << std::endl
<< "\t" << "{" << std::endl;
for (it = klass.Fields.begin(); it != klass.Fields.end(); it++) {
<< "\t" << "{" << std::endl;
if (!klass.Parent.empty())
- std::cout << "\t\t" << "int real_id = id - ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldCount(); " << std::endl
+ std::cout << "\t\t" << "int real_id = id - TypeImpl<" << klass.Parent << ">::StaticGetFieldCount(); " << std::endl
<< "\t\t" << "if (real_id < 0) { " << klass.Parent << "::SetField(id, value); return; }" << std::endl;
std::cout << "\t\t" << "switch (";
<< "\t" << "{" << std::endl;
if (!klass.Parent.empty())
- std::cout << "\t\t" << "int real_id = id - ReflectionTypeImpl<" << klass.Parent << ">::StaticGetFieldCount(); " << std::endl
+ std::cout << "\t\t" << "int real_id = id - TypeImpl<" << klass.Parent << ">::StaticGetFieldCount(); " << std::endl
<< "\t\t" << "if (real_id < 0) { return " << klass.Parent << "::GetField(id); }" << std::endl;
std::cout << "\t\t" << "switch (";
{
stream->exceptions(std::istream::badbit);
- std::cout << "#include \"base/reflectionobject.h\"" << std::endl
+ std::cout << "#include \"base/object.h\"" << std::endl
+ << "#include \"base/type.h\"" << std::endl
<< "#include \"base/singleton.h\"" << std::endl
<< "#include \"base/debug.h\"" << std::endl
<< "#include \"base/value.h\"" << std::endl