#include <Inventor/threads/SbThreadMutex.h>
#include <Inventor/fields/SoFieldData.h>
Go to the source code of this file.
Defines | |
#define | SO_FIELDCONTAINER_ABSTRACT_HEADER(className) |
#define | SO_FIELDCONTAINER_HEADER(className) |
#define | SO__FIELDCONTAINER_CHECK_INIT(className) |
#define | SO__FIELDCONTAINER_CHECK_CONSTRUCT(where) |
#define | SO__FIELDCONTAINER_VARS(className) |
#define | SO_FIELDCONTAINER_ABSTRACT_SOURCE(className) |
#define | SO_FIELDCONTAINER_SOURCE(className) |
#define | SO_FIELDCONTAINER_INIT_CLASS_CHECK_PARENT(className, parentClass) |
#define | SO_FIELDCONTAINER_INIT_CLASS(className, classPrintName, parentClass) |
#define | SO_FIELDCONTAINER_INIT_ABSTRACT_CLASS(className, classPrintName, parentClass) |
#define | SO__FIELDCONTAINER_EXIT_CLASS(className) |
#define | SO_FIELDCONTAINER_IS_FIRST_INSTANCE() (firstInstance == TRUE) |
#define | SO__FIELDCONTAINER_ADD_MFIELD(fieldName, type) |
#define | SO__FIELDCONTAINER_ADD_FIELD(fieldName, defValue, type) |
#define | SO_FIELDCONTAINER_ADD_FIELD(fieldName, defValue) SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::EXPOSED_FIELD ) |
#define | SO_FIELDCONTAINER_ADD_HIDDEN_FIELD(fieldName, defValue) SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::INTERNAL_FIELD ) |
#define | SO_FIELDCONTAINER_ADD_PRIVATEFIELD(fieldName, defValue) SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::HIDDEN_FIELD ) |
#define | SO_FIELDCONTAINER_SET_SF_ENUM_TYPE(fieldName, enumType) SO__SF_ENUM_SET_TYPE( fieldName, enumType, "FIELDCONTAINER", fieldData ) |
#define | SO_FIELDCONTAINER_CONSTRUCTOR(className) |
#define | SO__FIELDCONTAINER_DEFINE_ENUM_VALUE(enumType, enumValueName, enumValue) |
#define | SO_FIELDCONTAINER_DEFINE_ENUM_VALUE(enumType, enumValue) SO__FIELDCONTAINER_DEFINE_ENUM_VALUE( enumType, enumValue, enumValue ) |
#define SO__FIELDCONTAINER_ADD_FIELD | ( | fieldName, | |||
defValue, | |||||
type | ) |
classMutex.lock(); \ SO__FIELDCONTAINER_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ fieldData->addField(this, SO__QUOTE(fieldName), &this->fieldName); \ this->fieldName.setValue defValue; \ this->fieldName.setContainer(this); \ this->fieldName.setFieldType(type); \ classMutex.unlock()
#define SO__FIELDCONTAINER_ADD_MFIELD | ( | fieldName, | |||
type | ) |
classMutex.lock(); \ SO__FIELDCONTAINER_CHECK_CONSTRUCT(__FILE__); \ if (firstInstance) \ fieldData->addField(this, SO__QUOTE(fieldName), &this->fieldName); \ this->fieldName.setContainer(this); \ this->fieldName.setFieldType(type); \ classMutex.unlock()
#define SO__FIELDCONTAINER_CHECK_CONSTRUCT | ( | where | ) |
if (fieldData == NULL) \ fieldData = new SoFieldData( \ parentFieldData ? *parentFieldData : NULL)
#define SO__FIELDCONTAINER_CHECK_INIT | ( | className | ) |
if (classTypeId.isBad()) \ className::initClass()
#define SO__FIELDCONTAINER_DEFINE_ENUM_VALUE | ( | enumType, | |||
enumValueName, | |||||
enumValue | ) |
classMutex.lock(); \ if (firstInstance) \ fieldData->addEnumValue(SO__QUOTE(enumType), \ SO__QUOTE(enumValueName), \ enumValue); \ classMutex.unlock()
#define SO__FIELDCONTAINER_EXIT_CLASS | ( | className | ) |
SoType::removeType(classTypeId.getName()); \ classTypeId = SoType::badType(); \ firstInstance = TRUE; \ if (fieldData != NULL) \ { \ delete fieldData; \ fieldData = NULL; \ } \ parentFieldData = NULL; \ firstInstance = TRUE
#define SO__FIELDCONTAINER_VARS | ( | className | ) |
SbThreadMutex className::classMutex; \ SoType className::classTypeId; \ SbBool className::isBuiltIn = TRUE; \ SoFieldData* className::fieldData = NULL; \ const SoFieldData** className::parentFieldData = NULL; \ SbBool className::firstInstance = TRUE
#define SO_FIELDCONTAINER_ABSTRACT_HEADER | ( | className | ) |
public: \ \ static SoType getClassTypeId(); \ \ virtual SoType getTypeId() const; \ private: \ virtual SbBool getIsBuiltIn() const ; \ virtual const SoFieldData* getFieldData() const; \ static void initClass(); \ static void exitClass(); \ private: \ static const SoFieldData** getFieldDataPtr(); \ private: \ static SbThreadMutex classMutex; \ static SoType classTypeId; \ static SbBool isBuiltIn; \ static SbBool firstInstance; \ static SoFieldData* fieldData; \ static const SoFieldData** parentFieldData
#define SO_FIELDCONTAINER_ABSTRACT_SOURCE | ( | className | ) |
#define SO_FIELDCONTAINER_ADD_FIELD | ( | fieldName, | |||
defValue | ) | SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::EXPOSED_FIELD ) |
#define SO_FIELDCONTAINER_ADD_HIDDEN_FIELD | ( | fieldName, | |||
defValue | ) | SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::INTERNAL_FIELD ) |
#define SO_FIELDCONTAINER_ADD_PRIVATEFIELD | ( | fieldName, | |||
defValue | ) | SO__FIELDCONTAINER_ADD_FIELD( fieldName, defValue, SoField::HIDDEN_FIELD ) |
#define SO_FIELDCONTAINER_CONSTRUCTOR | ( | className | ) |
SoBaseInitializer sbi(this); \ classMutex.lock(); \ SO__FIELDCONTAINER_CHECK_INIT(className); \ if (fieldData == NULL) \ fieldData = new SoFieldData( parentFieldData ? \ (SoFieldData *)*parentFieldData : \ (SoFieldData *)NULL); \ else \ firstInstance = FALSE; \ classMutex.unlock()
#define SO_FIELDCONTAINER_DEFINE_ENUM_VALUE | ( | enumType, | |||
enumValue | ) | SO__FIELDCONTAINER_DEFINE_ENUM_VALUE( enumType, enumValue, enumValue ) |
#define SO_FIELDCONTAINER_HEADER | ( | className | ) |
SO_FIELDCONTAINER_ABSTRACT_HEADER(className); \ private: \ static void* createInstance(SoType* dynamicType = NULL)
Returns the type identifier for this class.
Returns the type identifier for this specific instance.
#define SO_FIELDCONTAINER_INIT_ABSTRACT_CLASS | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
classMutex.lock(); \ SO_FIELDCONTAINER_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType( parentClass::getClassTypeId(), \ classPrintName, \ NULL, 0 ); \ parentFieldData = parentClass::getFieldDataPtr(); \ classMutex.unlock()
#define SO_FIELDCONTAINER_INIT_CLASS | ( | className, | |||
classPrintName, | |||||
parentClass | ) |
classMutex.lock(); \ SO_FIELDCONTAINER_INIT_CLASS_CHECK_PARENT(className, parentClass); \ classTypeId = SoType::createType( parentClass::getClassTypeId(), \ classPrintName, \ &className::createInstance, 0 ); \ parentFieldData = parentClass::getFieldDataPtr(); \ classMutex.unlock()
#define SO_FIELDCONTAINER_INIT_CLASS_CHECK_PARENT | ( | className, | |||
parentClass | ) |
if (parentClass::getClassTypeId().isBad()) \ parentClass::initClass()
#define SO_FIELDCONTAINER_IS_FIRST_INSTANCE | ( | ) | (firstInstance == TRUE) |
#define SO_FIELDCONTAINER_SET_SF_ENUM_TYPE | ( | fieldName, | |||
enumType | ) | SO__SF_ENUM_SET_TYPE( fieldName, enumType, "FIELDCONTAINER", fieldData ) |
#define SO_FIELDCONTAINER_SOURCE | ( | className | ) |
SO_FIELDCONTAINER_ABSTRACT_SOURCE(className); \ \ void* className::createInstance(SoType* ) \ { \ return (void *)(new className); \ }