VR-Forces 4.1.1 Class Documentation
List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
makArchives::DtGenericTerrainRecord Class Reference

DtGenericTerrainRecords allow the VR-Forces terrainInterface library to instantiate and configure the proper type of terrain implementation. More...

Classes

class  SerializableParameterMap

Public Types

typedef std::map< std::string,
std::string > 
ParameterMap

Public Member Functions

 DtGenericTerrainRecord (const std::string &modelName="")
 CTOR.
 DtGenericTerrainRecord (const DtGenericTerrainRecord &copy)
 CCTOR.
 DtGenericTerrainRecord (const std::string &modelName, const DtGenericTerrainRecord &copy)
 Create a copy but with a new name.
 ~DtGenericTerrainRecord ()
 DTOR.
DtGenericTerrainRecordoperator= (const DtGenericTerrainRecord &)
 Assignment operator.
DT_DECLARE_ALL_serialize_FUNCTIONS
void 
setParameter (const std::string &parameterName, const std::string &parameterValue)
 Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can be any of : xml_oarchive,xml_iarchive,binary_archive, portable_binary_oarchive binary_iarchive, portable_binary_iarchive,text_oarchive, or text_iarchive example: fstream fo("test.xml",std;:ios_base::out); xml_oarchive os(fo); DtGenericTerrainRecord aDef; aDef.serialize(os,0);.
bool clearParameter (const std::string &parameterName)
 Completely remove a parameter.
const std::string & parameter (const std::string &parameterName) const
 Helper function for getting a parameter, not that if the parameter is not found an empty string is returned which is does not indicate if the parameter is found or is simply not set.
const std::string * findParameter (const std::string &parameterName) const
 Find a parameter.
std::string * findParameter (const std::string &parameterName)
 Find a parameter The parameter name is NOT case sensitive, ie Param == PARAM == param.
const ParameterMapparameters () const
 Get the parameters.
const std::string & type () const
 Get the record type.

Static Public Attributes

static const std::string theEmptyString

Protected Member Functions

template<typename Archive >
void _serialize (Archive &ar, unsigned int version)

Static Protected Member Functions

static std::string cleanName (const std::string &name)

Protected Attributes

std::string myType
SerializableParameterMap myParameters

Detailed Description

DtGenericTerrainRecords allow the VR-Forces terrainInterface library to instantiate and configure the proper type of terrain implementation.

The generic nature of the name value pairs provided by this class also allow user-created terrain implementation plug-ins to be specific & configured.

Member Typedef Documentation

typedef std::map<std::string,std::string> makArchives::DtGenericTerrainRecord::ParameterMap

Constructor & Destructor Documentation

makArchives::DtGenericTerrainRecord::DtGenericTerrainRecord ( const std::string &  modelName = "")

CTOR.

Warning
, it is invalid to create a model without a name. A default CTOR is required for storage in a map. The DtGenericTerrainRecordManager will throw exceptions if a model has no name.
makArchives::DtGenericTerrainRecord::DtGenericTerrainRecord ( const DtGenericTerrainRecord copy)

CCTOR.

makArchives::DtGenericTerrainRecord::DtGenericTerrainRecord ( const std::string &  modelName,
const DtGenericTerrainRecord copy 
)

Create a copy but with a new name.

makArchives::DtGenericTerrainRecord::~DtGenericTerrainRecord ( )

DTOR.

Member Function Documentation

DtGenericTerrainRecord& makArchives::DtGenericTerrainRecord::operator= ( const DtGenericTerrainRecord )

Assignment operator.

DT_DECLARE_ALL_serialize_FUNCTIONS void makArchives::DtGenericTerrainRecord::setParameter ( const std::string &  parameterName,
const std::string &  parameterValue 
)

Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can be any of : xml_oarchive,xml_iarchive,binary_archive, portable_binary_oarchive binary_iarchive, portable_binary_iarchive,text_oarchive, or text_iarchive example: fstream fo("test.xml",std;:ios_base::out); xml_oarchive os(fo); DtGenericTerrainRecord aDef; aDef.serialize(os,0);.

Set a parameter's value, if the parameter does not exist a new parameter will be created. The parameter name is NOT case sensitive, ie Param == PARAM == param. Setting a parameter to a null string does NOT remove the parameter all together i.e. calls to findParameter will return a valid pointer.

bool makArchives::DtGenericTerrainRecord::clearParameter ( const std::string &  parameterName)

Completely remove a parameter.

Calls to findParameter will return a null pointer. The parameter name is NOT case sensitive, ie Param == PARAM == param.

Returns
if the paramter was removed.
const std::string& makArchives::DtGenericTerrainRecord::parameter ( const std::string &  parameterName) const

Helper function for getting a parameter, not that if the parameter is not found an empty string is returned which is does not indicate if the parameter is found or is simply not set.

The parameter name is NOT case sensitive, ie Param == PARAM == param.

const std::string* makArchives::DtGenericTerrainRecord::findParameter ( const std::string &  parameterName) const

Find a parameter.

The parameter name is NOT case sensitive, ie Param == PARAM == param.

Warning
The data pointer should not be held on to and should be treated as a temporary reference (aka a local copy should be made before any other calls to the Model Definition).
Return values
0if the parameter is not found.
std::string* makArchives::DtGenericTerrainRecord::findParameter ( const std::string &  parameterName)

Find a parameter The parameter name is NOT case sensitive, ie Param == PARAM == param.

Return values
0if the parameter is not found.
const ParameterMap& makArchives::DtGenericTerrainRecord::parameters ( ) const

Get the parameters.

const std::string& makArchives::DtGenericTerrainRecord::type ( ) const

Get the record type.

static std::string makArchives::DtGenericTerrainRecord::cleanName ( const std::string &  name)
staticprotected
template<typename Archive >
void makArchives::DtGenericTerrainRecord::_serialize ( Archive &  ar,
unsigned int  version 
)
inlineprotected

References DT_SERIALIZE_MEMBER.

Member Data Documentation

const std::string makArchives::DtGenericTerrainRecord::theEmptyString
static
std::string makArchives::DtGenericTerrainRecord::myType
protected
SerializableParameterMap makArchives::DtGenericTerrainRecord::myParameters
protected

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)