VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtElementDefinitionManager Class Reference

Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager. More...

Public Types

typedef boost::unordered_map
< DtUnicode,
DtElementDefinitionNew * > 
DefinitionMap
 Map from element definition name to definition object.
typedef std::vector< const
DtElementDefinitionNew * > 
ElementDefinitions
 List of new element definitions.

Public Member Functions

virtual ~DtElementDefinitionManager ()
 Destructor.
const std::string & name () const
 Get the name of the element definition manager.
const DtUnicodescreenName () const
 Get the screen name of the element definition manager.
unsigned int numberOfElementDefinitions () const
 Get the number of element definitions.
const DefinitionMapelementDefinitions () const
 Get the element definitions.
DtElementDefinitionNewfindElementDefinition (const DtUnicode &definitionName)
 Find an element definition by name.
const DtElementDefinitionNewfindElementDefinition (const DtUnicode &definitionName) const
 Find an element definition by name.
DtElementDefinitionNewcreateElementDefinition (const DtUnicode &definitionName)
 Create an element definition with a given name.
DtElementDefinitionNewcreateElementDefinition (const DtUnicode &definitionName, DtElementDefinitionNew *parentDefinition)
 Create an element definition with a given name, that inherits an existing definition.
void destroyElementDefinition (DtElementDefinitionNew *)
 Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent.
void destroyElementDefinitionAndChildren (DtElementDefinitionNew *)
 Destroys an element definition and all of it's child definitions.
DtElementDefinitionNewcopyElementDefinition (DtElementDefinitionNew &def, const DtUnicode &newName)
 Create a copy of an element definition, with a new name.
DtBackupInterfacebackup ()
 Get the backup object.
bool renameElementDefinition (const DtUnicode &oldName, const DtUnicode &newName)
 Rename an element definition.
void loadDefaults ()
 Load the default definitions.
void loadDefaults (bool loadOnlyFactory)
 Load the default definitions.
void revertSettings ()
 Revert to startup settings.
virtual void saveAsDefaults ()
 Called to save the current definitions as the defaults.
virtual void exportSettings (const std::string &fileName)
 Export settings to the named file.
virtual void importSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Import settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
virtual void importSettings (const std::string &fileName)
 Import settings from the named file.
virtual void mergeSettings (const std::string &fileName, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
virtual DtDeSettingssettings ()
 Get the settings object that manages element definitions on disk.
virtual void setFromRecord (const makArchives::DtElementsRecord &rec)
 Set the element definitions from a record.
virtual void setFromRecord (const makArchives::DtElementsRecord &rec, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Set the element definitions from a record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.
virtual void mergeRecord (const makArchives::DtElementsRecord &rec, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Merge in the element definitions from a record Returns a list of the new elements.
virtual void getRecord (makArchives::DtElementsRecord &rec)
 Fill in a record with the current definitions.
virtual void setAutoSave (bool enabled)
 Set whether the manager saves itself out as default when changed.
virtual bool validateElementDefinition (const DtElementDefinitionNew &def)
 Validate an element definition against its registered schema validator, if any.

Static Public Member Functions

static const
DtElementDefinitionManager
createConstCopy (const DtElementDefinitionManager &orig)
 Create a constant copy for use in separate threads.

Protected Types

typedef std::vector< const
makArchives::DtElementDefinitionRecord * > 
ElementGroup
 A group of element definition records, used for the following map.
typedef std::map< DtUnicode,
ElementGroup
ParentToElementsMap
 Map from parent element definition name to a group of elements Used to reconstruct the element hierarchy from a flat record in the following functions.
typedef std::map< std::string,
DtVisualizerDefinitionValidator * > 
VisualizerDefinitionValidatorMap
typedef DtRecordSettingsBackup
< DtElementDefinitionManager,
makArchives::DtElementsRecord
ElementDefinitionsBackup

Protected Member Functions

 DtElementDefinitionManager (const std::string &name, const DtUnicode &screenName, DtDe &de, bool procedural)
 Constructor.
 DtElementDefinitionManager (const DtElementDefinitionManager &rhs)
 Copy constructor.o.
void registerDefinitionHierarchy (DtElementDefinitionNew *root)
 Internal function to register a hierarchy.
void setFromOldRecord (const makArchives::oldRecords::DtElementDefinitionHierarchy &oldRe, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Load an old element definition hierarchy record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added.
void loadOldDefinitionNode (DtElementDefinitionNew *parent, const makArchives::oldRecords::DtElementDefinitionNode &oldDef, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Load an old element definition node record (and its subtree) into the manager, under the specified parent definition.
void buildDefinitionSetsFromOldRecord (DtElementDefinitionNew &newElem, const makArchives::oldRecords::DtElementDefinition &oldElem)
 build definition sets for a new element definition from an old definition record
virtual void buildElementVisualizers (DtElementDefinitionNew &ed, const makArchives::DtElementDefinitionRecord &rec)
 Build the visualizer definition sets for an element from its record.
virtual void buildElementChildren (DtElementDefinitionNew &ed, ParentToElementsMap &parentToElementsMap, ElementDefinitions &addedDefinitions, ElementDefinitions &skippedDefinitions)
 Recursively create the child element definitions for an element using a map from parent names to child records.
virtual void registerBackup ()
 register the settings backup after the de has initialized the shared settings object
virtual bool recordMatchesDefinition (const makArchives::DtElementDefinitionRecord *childRec, const DtElementDefinitionNew *existingChildDef) const

Static Protected Member Functions

static DtVisualizerAttributeattributeFromOldRecord (const makArchives::oldRecords::DtVisualAttributeInterface *attributeRecord)
 Convert an old visualizer attribute record into a new attribute.
static
makArchives::DtElementDefinitionRecord 
buildElementDefinitionRecord (DtElementDefinitionNew &elementDef)
 Utility function to construct an element definition record from an element definition object.

Protected Attributes

VisualizerDefinitionValidatorMap myValidators
std::string myName
DtUnicode myScreenName
DtDemyOptionalDe
DefinitionMap myDefinitions
bool myProceduralFlag
bool myAutoSave
ElementDefinitionsBackupmyBackup

Private Member Functions

 DtElementDefinitionManager ()
 Default constructor.
DtElementDefinitionManageroperator= (const DtElementDefinitionManager &)
 Assignment Operator.

Friends

class DtElementDefinitionTypeManager

Detailed Description

Manager which owns element definitions.for one type of element Use the makVrv::DtElementDefinitionTypesManager to get each element definition manager.

Member Typedef Documentation

Map from element definition name to definition object.

List of new element definitions.

A group of element definition records, used for the following map.

Map from parent element definition name to a group of elements Used to reconstruct the element hierarchy from a flat record in the following functions.

Constructor & Destructor Documentation

virtual makVrv::DtElementDefinitionManager::~DtElementDefinitionManager ( )
virtual

Destructor.

makVrv::DtElementDefinitionManager::DtElementDefinitionManager ( const std::string &  name,
const DtUnicode screenName,
DtDe de,
bool  procedural 
)
protected

Constructor.

makVrv::DtElementDefinitionManager::DtElementDefinitionManager ( const DtElementDefinitionManager rhs)
protected

Copy constructor.o.

makVrv::DtElementDefinitionManager::DtElementDefinitionManager ( )
private

Default constructor.

Note
Not implemented

Member Function Documentation

static const DtElementDefinitionManager* makVrv::DtElementDefinitionManager::createConstCopy ( const DtElementDefinitionManager orig)
static

Create a constant copy for use in separate threads.

const std::string& makVrv::DtElementDefinitionManager::name ( ) const

Get the name of the element definition manager.

This name is used to uniquely specify file names.

const DtUnicode& makVrv::DtElementDefinitionManager::screenName ( ) const

Get the screen name of the element definition manager.

This name is display the name of the element type to the user.

unsigned int makVrv::DtElementDefinitionManager::numberOfElementDefinitions ( ) const

Get the number of element definitions.

const DefinitionMap& makVrv::DtElementDefinitionManager::elementDefinitions ( ) const

Get the element definitions.

This map will change if there are any calls to create or destroy elements. Those calls may invalidate any iterators obtained from the map.

DtElementDefinitionNew* makVrv::DtElementDefinitionManager::findElementDefinition ( const DtUnicode definitionName)

Find an element definition by name.

Returns
0 if the definition is not found.
const DtElementDefinitionNew* makVrv::DtElementDefinitionManager::findElementDefinition ( const DtUnicode definitionName) const

Find an element definition by name.

Returns
0 if the definition is not found.
DtElementDefinitionNew* makVrv::DtElementDefinitionManager::createElementDefinition ( const DtUnicode definitionName)

Create an element definition with a given name.

Returns
0 If the element definition with the name already exists.
DtElementDefinitionNew* makVrv::DtElementDefinitionManager::createElementDefinition ( const DtUnicode definitionName,
DtElementDefinitionNew parentDefinition 
)

Create an element definition with a given name, that inherits an existing definition.

Returns
0 If the element definition with the name already exists.
void makVrv::DtElementDefinitionManager::destroyElementDefinition ( DtElementDefinitionNew )

Destroy an element definition, any inherited definitions will now be Parented under destroyed element's parent.

void makVrv::DtElementDefinitionManager::destroyElementDefinitionAndChildren ( DtElementDefinitionNew )

Destroys an element definition and all of it's child definitions.

DtElementDefinitionNew* makVrv::DtElementDefinitionManager::copyElementDefinition ( DtElementDefinitionNew def,
const DtUnicode newName 
)

Create a copy of an element definition, with a new name.

The element definition must not be inherited by any other definitions to be copyable. The new definition will share the same parent as the source definition.

DtBackupInterface* makVrv::DtElementDefinitionManager::backup ( )

Get the backup object.

bool makVrv::DtElementDefinitionManager::renameElementDefinition ( const DtUnicode oldName,
const DtUnicode newName 
)

Rename an element definition.

Returns
true if the element was renamed.
false if an element with the old name was not found or an element with the new name already existed.
void makVrv::DtElementDefinitionManager::loadDefaults ( )

Load the default definitions.

void makVrv::DtElementDefinitionManager::loadDefaults ( bool  loadOnlyFactory)

Load the default definitions.

void makVrv::DtElementDefinitionManager::revertSettings ( )

Revert to startup settings.

virtual void makVrv::DtElementDefinitionManager::saveAsDefaults ( )
virtual

Called to save the current definitions as the defaults.

virtual void makVrv::DtElementDefinitionManager::exportSettings ( const std::string &  fileName)
virtual

Export settings to the named file.

virtual void makVrv::DtElementDefinitionManager::importSettings ( const std::string &  fileName,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Import settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.

virtual void makVrv::DtElementDefinitionManager::importSettings ( const std::string &  fileName)
virtual

Import settings from the named file.

virtual void makVrv::DtElementDefinitionManager::mergeSettings ( const std::string &  fileName,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge settings from the named file Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.

virtual DtDeSettings* makVrv::DtElementDefinitionManager::settings ( )
virtual

Get the settings object that manages element definitions on disk.

virtual void makVrv::DtElementDefinitionManager::setFromRecord ( const makArchives::DtElementsRecord rec)
virtual

Set the element definitions from a record.

virtual void makVrv::DtElementDefinitionManager::setFromRecord ( const makArchives::DtElementsRecord rec,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Set the element definitions from a record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added and were different from any existing definition with the same name.

virtual void makVrv::DtElementDefinitionManager::mergeRecord ( const makArchives::DtElementsRecord rec,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
virtual

Merge in the element definitions from a record Returns a list of the new elements.

virtual void makVrv::DtElementDefinitionManager::getRecord ( makArchives::DtElementsRecord rec)
virtual

Fill in a record with the current definitions.

virtual void makVrv::DtElementDefinitionManager::setAutoSave ( bool  enabled)
virtual

Set whether the manager saves itself out as default when changed.

virtual bool makVrv::DtElementDefinitionManager::validateElementDefinition ( const DtElementDefinitionNew def)
virtual

Validate an element definition against its registered schema validator, if any.

void makVrv::DtElementDefinitionManager::registerDefinitionHierarchy ( DtElementDefinitionNew root)
protected

Internal function to register a hierarchy.

static DtVisualizerAttribute* makVrv::DtElementDefinitionManager::attributeFromOldRecord ( const makArchives::oldRecords::DtVisualAttributeInterface attributeRecord)
staticprotected

Convert an old visualizer attribute record into a new attribute.

void makVrv::DtElementDefinitionManager::setFromOldRecord ( const makArchives::oldRecords::DtElementDefinitionHierarchy oldRe,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
protected

Load an old element definition hierarchy record Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added.

void makVrv::DtElementDefinitionManager::loadOldDefinitionNode ( DtElementDefinitionNew parent,
const makArchives::oldRecords::DtElementDefinitionNode oldDef,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
protected

Load an old element definition node record (and its subtree) into the manager, under the specified parent definition.

Passing a null parent loads the subtree with no parent (as a root node) Fills addedDefinitions with definitions successfully added Fills skippedDefinitions with definitions that could not be added

void makVrv::DtElementDefinitionManager::buildDefinitionSetsFromOldRecord ( DtElementDefinitionNew newElem,
const makArchives::oldRecords::DtElementDefinition oldElem 
)
protected

build definition sets for a new element definition from an old definition record

virtual void makVrv::DtElementDefinitionManager::buildElementVisualizers ( DtElementDefinitionNew ed,
const makArchives::DtElementDefinitionRecord rec 
)
protectedvirtual

Build the visualizer definition sets for an element from its record.

virtual void makVrv::DtElementDefinitionManager::buildElementChildren ( DtElementDefinitionNew ed,
ParentToElementsMap parentToElementsMap,
ElementDefinitions addedDefinitions,
ElementDefinitions skippedDefinitions 
)
protectedvirtual

Recursively create the child element definitions for an element using a map from parent names to child records.

static makArchives::DtElementDefinitionRecord makVrv::DtElementDefinitionManager::buildElementDefinitionRecord ( DtElementDefinitionNew elementDef)
staticprotected

Utility function to construct an element definition record from an element definition object.

virtual void makVrv::DtElementDefinitionManager::registerBackup ( )
protectedvirtual

register the settings backup after the de has initialized the shared settings object

virtual bool makVrv::DtElementDefinitionManager::recordMatchesDefinition ( const makArchives::DtElementDefinitionRecord childRec,
const DtElementDefinitionNew existingChildDef 
) const
protectedvirtual
DtElementDefinitionManager& makVrv::DtElementDefinitionManager::operator= ( const DtElementDefinitionManager )
private

Assignment Operator.

Note
Not implemented

Friends And Related Function Documentation

friend class DtElementDefinitionTypeManager
friend

Member Data Documentation

VisualizerDefinitionValidatorMap makVrv::DtElementDefinitionManager::myValidators
protected
std::string makVrv::DtElementDefinitionManager::myName
protected
DtUnicode makVrv::DtElementDefinitionManager::myScreenName
protected
DtDe* makVrv::DtElementDefinitionManager::myOptionalDe
protected
DefinitionMap makVrv::DtElementDefinitionManager::myDefinitions
protected
bool makVrv::DtElementDefinitionManager::myProceduralFlag
protected
bool makVrv::DtElementDefinitionManager::myAutoSave
protected
ElementDefinitionsBackup* makVrv::DtElementDefinitionManager::myBackup
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)