Defines

IXObjectImplHelper.hpp File Reference

Go to the source code of this file.

Defines

#define MExportXRootObjectFactory(classid)
#define MExportXRootObjectFactoryNS(__namespace, classid)
#define MExportXObjectFactory(classid)
#define MExportXObjectFactoryNS(__namespace, classid)
#define REG_ROOT_BEGIN(classid)
#define REG_ROOT_ADD(classid, classname)
#define REG_ROOT_END
#define REG_SUB_BEGIN(classid)
#define REG_SUB_ADD(classid, classname)
#define REG_SUB_END   REG_ROOT_END
#define XOBJECTFACTORY_REGISTER_ROOT(classid)   classid::autoregRoot(true);
#define XOBJECTFACTORY_UNREGISTER_ROOT(classid)   classid::autoregRoot(false);
#define XOBJECTFACTORY_REGISTER_SUB(classid)   classid::autoregSub(true);
#define XOBJECTFACTORY_UNREGISTER_SUB(classid)   classid::autoregSub(false);

Define Documentation

#define MExportXObjectFactory (   classid )
Value:
MODULE_EXPORT_PRE Retval MODULE_EXPORT MQUALIFIER create##classid(NAMESPACE_Zeus::IXMLNode* pMainNode, NAMESPACE_Zeus::IXMLDocument*, NAMESPACE_Zeus::IXObject*& rpObj) \
{ \
  Retval retValue = RET_INTERNAL_ERROR; \
  if (pMainNode != NULL) \
  { \
    rpObj = new classid(*pMainNode); \
    retValue = RET_NOERROR; \
  } \
  return retValue; \
} \

Defines a factory method to create XObjects which will be exported by the library

#define MExportXObjectFactoryNS (   __namespace,
  classid 
)
Value:
MODULE_EXPORT_PRE Retval MODULE_EXPORT MQUALIFIER create##__namespace(NAMESPACE_Zeus::IXMLNode* pMainNode, NAMESPACE_Zeus::IXMLDocument*, NAMESPACE_Zeus::IXObject*& rpObj) \
{ \
  Retval retValue = RET_INTERNAL_ERROR; \
  \
  if (pMainNode != NULL) \
  { \
    rpObj = new __namespace::classid(*pMainNode); \
    retValue = RET_NOERROR; \
  } \
  \
  return retValue; \
} \

Defines a factory method to create XObjects using special namespace, which will be exported by the library

#define MExportXRootObjectFactory (   classid )
Value:
MODULE_EXPORT_PRE Retval MODULE_EXPORT MQUALIFIER create##classid(NAMESPACE_Zeus::IXMLNode* pMainNode, NAMESPACE_Zeus::IXMLDocument* pDocu, NAMESPACE_Zeus::IXObject*& rpObj) \
{ \
  Retval retValue = RET_INTERNAL_ERROR; \
  if (pMainNode != NULL && pDocu != NULL) \
  { \
    rpObj = new classid(*pMainNode, *pDocu); \
    retValue = RET_NOERROR; \
  } \
  return retValue; \
} \

Defines a factory method to create XRootObjects which will be exported by the library

Defines a factory method to create XRootObjects using a special namespace, which will be exported by the library

#define MExportXRootObjectFactoryNS (   __namespace,
  classid 
)
Value:
MODULE_EXPORT_PRE Retval MODULE_EXPORT MQUALIFIER create##classid(NAMESPACE_Zeus::IXMLNode* pMainNode, NAMESPACE_Zeus::IXMLDocument* pDocu, NAMESPACE_Zeus::IXObject*& rpObj) \
{ \
  Retval retValue = RET_INTERNAL_ERROR; \
  if (pMainNode != NULL && pDocu != NULL) \
  { \
    rpObj = new __namespace::classid(*pMainNode, *pDocu); \
    retValue = RET_NOERROR; \
  } \
  return retValue; \
} \
#define REG_ROOT_ADD (   classid,
  classname 
)
Value:
strClassName = classname; \
      static Uint classid##Handle = 0;\
      if (reg)\
      {\
        classid##Handle = TXObjectFactory::getInstance().registerXClass(strClassName, createXRootObject); \
      }\
      else\
      {\
        TXObjectFactory::getInstance().unregisterXClass(classid##Handle, strClassName); \
      }

Entry of autoregistration. This will be added to the database of the XObjectFactory.

Parameters:
classid: ID of the class
classname,:String value representing the class name
#define REG_ROOT_BEGIN (   classid )
Value:
protected: \
    static Retval MQUALIFIER createXRootObject(IXMLNode* pMainNode, IXMLDocument* pDocu, IXObject*& rpObj) \
    { \
      Retval retValue = RET_REQUEST_FAILED; \
      if (pMainNode != NULL && pDocu != NULL) \
      { \
        rpObj = new classid(*pMainNode, *pDocu); \
        retValue = RET_NOERROR; \
      } \
      else \
      { \
        retValue = RET_INTERNAL_ERROR; \
      } \
      return retValue; \
    } \
  public: \
    static bool autoregRoot(bool reg) \
    { \
      TString strClassName;\

Declaration of autoregistration and factory method to create a XRootObject using the XObjectFactory.

Parameters:
classid: ID of the class to be registered
#define REG_ROOT_END
Value:
return true;\
    }

End of registration.

#define REG_SUB_ADD (   classid,
  classname 
)
Value:
strClassName = classname; \
      static Uint classid##Handle = 0;\
      if (reg)\
      {\
        classid##Handle = TXObjectFactory::getInstance().registerXClass(strClassName, createXObject); \
      }\
      else\
      {\
        TXObjectFactory::getInstance().unregisterXClass(classid##Handle, strClassName); \
      }

Entry of autoregistration. This will be added to the database of the XObjectFactory.

Parameters:
classid: ID of the class
classname,:String value representing the class name
#define REG_SUB_BEGIN (   classid )
Value:
protected: \
    static Retval MQUALIFIER createXObject(IXMLNode* pMainNode, IXMLDocument* /*docu*/, IXObject*& rpObj) \
    { \
      Retval retVal = RET_REQUEST_FAILED; \
      if (pMainNode != NULL) \
      { \
        rpObj = new classid(*pMainNode); \
        retVal = RET_NOERROR; \
      } \
      else \
      { \
        retVal = RET_INTERNAL_ERROR; \
      } \
      return retVal; \
    } \
  public: \
    static bool autoregSub(bool reg) \
    { \
      TString strClassName;\

Declaration of autoregistration and factory method to create a XObject using the XObjectFactory. Those Objects are sub objects of a XRootObject.

Parameters:
classid: ID of the class to be registered
#define REG_SUB_END   REG_ROOT_END

End of registration, same as REG_ROOT_END

#define XOBJECTFACTORY_REGISTER_ROOT (   classid )    classid::autoregRoot(true);

Implementation of the registration. This will registrate the class explicitly.

#define XOBJECTFACTORY_REGISTER_SUB (   classid )    classid::autoregSub(true);

Implementation of the registration. This will registrate the class explicitly.

#define XOBJECTFACTORY_UNREGISTER_ROOT (   classid )    classid::autoregRoot(false);

Implementation of the unregistration. This will unregistrate the class explicitly.

#define XOBJECTFACTORY_UNREGISTER_SUB (   classid )    classid::autoregSub(false);

Implementation of the unregistration. This will unregistrate the class explicitly.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:20