HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VOP_CompositeTypeDefinition Class Referenceabstract

Class that defines a type composed by assembling other types as members. More...

#include <VOP_CompositeTypeDefinition.h>

+ Inheritance diagram for VOP_CompositeTypeDefinition:

Public Member Functions

 VOP_CompositeTypeDefinition ()
 Constructor and destructor. More...
 
virtual ~VOP_CompositeTypeDefinition ()
 
virtual UT_StringHolder getCodeTypeKeyword () const =0
 
virtual void getTypeDefinitionSourceCode (UT_String &code, const VOP_Language *language) const
 
virtual bool load (const UT_JSONValue &json)
 Saves to or loades from a JSON value. More...
 
virtual bool save (UT_JSONValue &json) const
 Saves to or loades from a JSON value. More...
 
int getMemberVarCount () const
 
const VOP_MemberVarInfogetMemberVarInfo (int index) const
 
const VOP_MemberVarInfofindMemberVarInfo (const char *member_name, bool check_old_names=false) const
 
int findMemberVarInfoIndex (const char *member_name, bool check_old_names=false) const
 
void appendMemberVarInfo (const VOP_MemberVarInfo &info)
 
int getMethodCount () const
 Getters and setter for member methods. More...
 
const VOP_MemberMethodInfogetMethodInfo (int index) const
 Getters and setter for member methods. More...
 
const VOP_MemberMethodInfofindMethodInfo (const char *method_name) const
 Getters and setter for member methods. More...
 
void appendMethodInfo (const VOP_MemberMethodInfo &info)
 Getters and setter for member methods. More...
 
void setIsAdHoc (bool flag)
 True if the type is ad-hoc (eg, defined by a Struct VOP node). More...
 
bool isAdHoc () const
 True if the type is ad-hoc (eg, defined by a Struct VOP node). More...
 
void setExplicitDefinitionCode (const char *code)
 
const char * getExplicitDefinitionCode () const
 
- Public Member Functions inherited from VOP_TypeDefinition
 VOP_TypeDefinition ()
 Constructor and destructor. More...
 
virtual ~VOP_TypeDefinition ()
 
virtual UT_StringHolder getMetaType () const =0
 
const UT_StringHoldergetTypeName () const
 Sets and gets the type definition unique name identifier. More...
 
void setTypeName (const char *name)
 Sets and gets the type definition unique name identifier. More...
 
const UT_StringHoldergetTypeLabel () const
 Sets and gets the type definition unique name identifier. More...
 
void setTypeLabel (const char *label)
 Sets and gets the type definition unique name identifier. More...
 
const UT_ColorgetConnectorColor () const
 Methods for the color of the connector of this type. More...
 
void setSpecificConnectorColor (const UT_Color &clr)
 Methods for the color of the connector of this type. More...
 
void setDefaultConnectorColor ()
 Methods for the color of the connector of this type. More...
 
void setCodeTypeName (const char *code_type_name)
 Sets and gets the type name used in the generated code. More...
 
const UT_StringHoldergetCodeTypeName () const
 Sets and gets the type name used in the generated code. More...
 
const UT_StringHoldergetCodeTypeNameRaw () const
 Sets and gets the type name used in the generated code. More...
 
bool operator== (const VOP_TypeDefinition &other) const
 Standard comparison operators. More...
 
bool operator!= (const VOP_TypeDefinition &other) const
 Standard comparison operators. More...
 

Protected Member Functions

void generateTypeDefinition (UT_String &code, const char *meta_type_keyword, const VOP_Language *language) const
 Generates a type definition for the source code from the member info. More...
 
virtual bool isEqual (const VOP_TypeDefinition &other) const
 Standard overrides from the base class. More...
 

Additional Inherited Members

- Static Public Attributes inherited from VOP_TypeDefinition
static const UT_StringHolder METATYPE_KEY
 

Detailed Description

Class that defines a type composed by assembling other types as members.

Definition at line 98 of file VOP_CompositeTypeDefinition.h.

Constructor & Destructor Documentation

VOP_CompositeTypeDefinition::VOP_CompositeTypeDefinition ( )

Constructor and destructor.

virtual VOP_CompositeTypeDefinition::~VOP_CompositeTypeDefinition ( )
virtual

Member Function Documentation

void VOP_CompositeTypeDefinition::appendMemberVarInfo ( const VOP_MemberVarInfo info)

Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.

void VOP_CompositeTypeDefinition::appendMethodInfo ( const VOP_MemberMethodInfo info)

Getters and setter for member methods.

const VOP_MemberVarInfo* VOP_CompositeTypeDefinition::findMemberVarInfo ( const char *  member_name,
bool  check_old_names = false 
) const

Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.

int VOP_CompositeTypeDefinition::findMemberVarInfoIndex ( const char *  member_name,
bool  check_old_names = false 
) const

Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.

const VOP_MemberMethodInfo* VOP_CompositeTypeDefinition::findMethodInfo ( const char *  method_name) const

Getters and setter for member methods.

void VOP_CompositeTypeDefinition::generateTypeDefinition ( UT_String code,
const char *  meta_type_keyword,
const VOP_Language language 
) const
protected

Generates a type definition for the source code from the member info.

virtual UT_StringHolder VOP_CompositeTypeDefinition::getCodeTypeKeyword ( ) const
pure virtual

Returns a keyword to be used in the source code for defining this composite type (eg, "struct", "class", etc).

Implemented in VOP_ClassTypeDefinition, and VOP_StructTypeDefinition.

const char* VOP_CompositeTypeDefinition::getExplicitDefinitionCode ( ) const

Sets and gets the source code that should be used in the shader definision source code. If explicit code is NULL, then whenever an actual definition source code is needed, this class will auto-generate the it from the info about its members. This is the case for majority of vop structs/classes. This override method is useful for struct definitions that are outside of vops (eg, in a header file, in which case this override would likely just specify #include directive).

int VOP_CompositeTypeDefinition::getMemberVarCount ( ) const

Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.

const VOP_MemberVarInfo& VOP_CompositeTypeDefinition::getMemberVarInfo ( int  index) const

Getters and setters for member variable information. The first three are the core functions, while the remaining ones are convenience utility function to get at particular piece of info.

int VOP_CompositeTypeDefinition::getMethodCount ( ) const

Getters and setter for member methods.

const VOP_MemberMethodInfo& VOP_CompositeTypeDefinition::getMethodInfo ( int  index) const

Getters and setter for member methods.

virtual void VOP_CompositeTypeDefinition::getTypeDefinitionSourceCode ( UT_String code,
const VOP_Language language 
) const
virtual

Obtains the source code that defines the type in the programming (scripting) language.

Reimplemented from VOP_TypeDefinition.

bool VOP_CompositeTypeDefinition::isAdHoc ( ) const

True if the type is ad-hoc (eg, defined by a Struct VOP node).

virtual bool VOP_CompositeTypeDefinition::isEqual ( const VOP_TypeDefinition other) const
protectedvirtual

Standard overrides from the base class.

Implements VOP_TypeDefinition.

virtual bool VOP_CompositeTypeDefinition::load ( const UT_JSONValue json)
virtual

Saves to or loades from a JSON value.

Reimplemented from VOP_TypeDefinition.

virtual bool VOP_CompositeTypeDefinition::save ( UT_JSONValue json) const
virtual

Saves to or loades from a JSON value.

Reimplemented from VOP_TypeDefinition.

void VOP_CompositeTypeDefinition::setExplicitDefinitionCode ( const char *  code)

Sets and gets the source code that should be used in the shader definision source code. If explicit code is NULL, then whenever an actual definition source code is needed, this class will auto-generate the it from the info about its members. This is the case for majority of vop structs/classes. This override method is useful for struct definitions that are outside of vops (eg, in a header file, in which case this override would likely just specify #include directive).

void VOP_CompositeTypeDefinition::setIsAdHoc ( bool  flag)

True if the type is ad-hoc (eg, defined by a Struct VOP node).


The documentation for this class was generated from the following file: