HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_DataFactory Class Reference

#include <SIM_DataFactory.h>

Public Member Functions

 SIM_DataFactory (const UT_StringHolder &datatype, const UT_StringHolder &description, SIM_GetSuperclasses get_superclasses, SIM_DataConstructor constructor, SIM_DataDestructor destructor, const SIM_DopDescription *dopdesc, const SIM_Engine *engine)
 
virtual ~SIM_DataFactory ()
 Destructor. More...
 
const SIM_EnginegetEngine () const
 Return the SIM_Engine that owns this factory. More...
 
const UT_StringHoldergetDataType () const
 
void getDataTypeSuperclasses (UT_StringArray &classes) const
 Get array of all superclass names of our data type. More...
 
const UT_StringHoldergetDescription () const
 
const UT_StringgetSource () const
 
virtual SIM_DatanewData (bool doinit) const
 Create a new instance of our particular subclass of SIM_Data. More...
 
SIM_DatanewData (const UT_Guid &uniqueid) const
 Calls newData() to create some new data, then changes the unique id. More...
 
virtual void deleteData (SIM_Data *data) const
 Delete an instance of our particular subclass of SIM_Data. More...
 
virtual const SIM_DopDescriptiongetDopDescription () const
 Return our SIM_DopDescription. More...
 

Friends

class SIM_DataFactoryCreator
 

Detailed Description

This class provides a means of creating and destroying SIM_Data objects. Nothing needs to be known about the SIM_Data object except its data type name. It is possible to derive a subclass to use instead of relying on the default implementations used by the DECLARE_DATAFACTORY and IMPLEMENT_DATAFACTORY macros. But generally these macros will be sufficient.

Examples:
SIM/GAS_NetVDBSliceExchange.C, SIM/GAS_NetVDBSliceExchange.h, SIM/SIM_ElectricalProperties.C, SIM/SIM_ElectricalProperties.h, SIM/SIM_ForceOrbit.C, SIM/SIM_ForceOrbit.h, SIM/SIM_GasAdd.C, SIM/SIM_GasAdd.h, SIM/SIM_RadialEmit.C, SIM/SIM_RadialEmit.h, SIM/SIM_SolverHair.C, SIM/SIM_SolverHair.h, SIM/SNOW_Solver.C, and SIM/SNOW_Solver.h.

Definition at line 33 of file SIM_DataFactory.h.

Constructor & Destructor Documentation

SIM_DataFactory::SIM_DataFactory ( const UT_StringHolder datatype,
const UT_StringHolder description,
SIM_GetSuperclasses  get_superclasses,
SIM_DataConstructor  constructor,
SIM_DataDestructor  destructor,
const SIM_DopDescription dopdesc,
const SIM_Engine engine 
)

Constructor which receives all the data for this factory. The constructor arguments contain all the information that may be required for the new data type without actually requiring an instance of that data type to be constructed.

virtual SIM_DataFactory::~SIM_DataFactory ( )
virtual

Destructor.

Member Function Documentation

virtual void SIM_DataFactory::deleteData ( SIM_Data data) const
virtual

Delete an instance of our particular subclass of SIM_Data.

const UT_StringHolder& SIM_DataFactory::getDataType ( ) const
inline

Get the name of the data type that is created by this factory. This is the unique identifier that is passed to a SIM_Object to create a new instance of this data type.

Definition at line 56 of file SIM_DataFactory.h.

void SIM_DataFactory::getDataTypeSuperclasses ( UT_StringArray classes) const
inline

Get array of all superclass names of our data type.

Definition at line 59 of file SIM_DataFactory.h.

const UT_StringHolder& SIM_DataFactory::getDescription ( ) const

Gets a string that describes what this data type does. This descriptive string is what is presented to the user when given a menu of data type choices.

virtual const SIM_DopDescription* SIM_DataFactory::getDopDescription ( ) const
virtual

Return our SIM_DopDescription.

const SIM_Engine& SIM_DataFactory::getEngine ( ) const

Return the SIM_Engine that owns this factory.

const UT_String& SIM_DataFactory::getSource ( ) const

Returns the name of the DSO or DLL file that defines the data type. For data types defined internally to Houdini the returned string will be empty.

virtual SIM_Data* SIM_DataFactory::newData ( bool  doinit) const
virtual

Create a new instance of our particular subclass of SIM_Data.

SIM_Data* SIM_DataFactory::newData ( const UT_Guid uniqueid) const

Calls newData() to create some new data, then changes the unique id.

Friends And Related Function Documentation

Definition at line 91 of file SIM_DataFactory.h.


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