Go to the documentation of this file.
78#ifndef _SO_SUB_ELEMENT_
79#define _SO_SUB_ELEMENT_
99#define SO_ELEMENT_ABSTRACT_HEADER(className) \
101 static SoType getClassTypeId() { return classTypeId; } \
102 static int getClassStackIndex() { return classStackIndex; } \
104 static int classStackIndex; \
107 static SoType classTypeId
112#define SO_ELEMENT_HEADER(className) \
113 SO_ELEMENT_ABSTRACT_HEADER(className); \
115 static void *createInstance()
128#define SO__ELEMENT_ABSTRACT_VARS(className) \
129SoType className::classTypeId; \
130int className::classStackIndex
132#define SO__ELEMENT_VARS(className) \
133SO__ELEMENT_ABSTRACT_VARS(className)
138#define SO__ELEMENT_ABSTRACT_METHODS(className) \
140className::className() \
147#define SO__ELEMENT_METHODS(className) \
149className::className() \
151 setTypeId(classTypeId); \
152 setStackIndex(classStackIndex); \
156className::createInstance() \
158 return new className; \
167#define SO_ELEMENT_ABSTRACT_SOURCE(className) \
168 SO__ELEMENT_ABSTRACT_VARS(className); \
169 SO__ELEMENT_ABSTRACT_METHODS(className)
171#define SO_ELEMENT_SOURCE(className) \
172 SO__ELEMENT_VARS(className); \
173 SO__ELEMENT_METHODS(className)
183#define SO_ELEMENT_INIT_ABSTRACT_CLASS(className,parentClass) { \
184 int _value_false= 0; \
186 classTypeId = SoType::createType(parentClass::getClassTypeId(), \
187 SO__QUOTE(className), \
189 if (parentClass::classStackIndex < 0) \
190 classStackIndex = createStackIndex(classTypeId); \
192 classStackIndex = parentClass::classStackIndex; \
193 } while (_value_false); \
196#define SO_ELEMENT_INIT_CLASS(className,parentClass) { \
197 int _value_false= 0; \
199 classTypeId = SoType::createType(parentClass::getClassTypeId(), \
200 SO__QUOTE(className), \
201 &className::createInstance); \
202 if (parentClass::classStackIndex < 0) \
203 classStackIndex = createStackIndex(classTypeId); \
205 classStackIndex = parentClass::classStackIndex; \
206 } while (_value_false); \