Named Class Reference

A base class used for CERTI named object. More...

#include <Named.hh>

Inheritance diagram for Named:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Named ()
 Default constructor.
 Named (const std::string newName)
 Constructor with inital value.
virtual ~Named ()
 Virtual destructor.
virtual void setName (const std::string newName)
 Set name.
virtual void setName (const char *newName)
 Set name (char* version).
virtual const std::string & getName () const
 Get name.
virtual const char * getCName () const
 Get C-style name.
bool isNamed (const std::string &newName) const
 Check if the name matches the provided parameter.

Static Public Member Functions

static bool validateHLAName (const std::string &name)
 This method check if the provided name respects the HLA named object specifications, IEEE-1516.2-2000 (§3.3.1 Names).
static bool isQualifiedClassName (const std::string &name)
 Check if the provided name is a qualified class name.
static std::string getNextClassName (std::string &qualifiedClassName)
 Get next class name component.
static std::string getLeafClassName (std::string qualifiedClassName)
 Get leaf class name component.

Protected Attributes

std::string name

Classes

class  IsNamed


Detailed Description

A base class used for CERTI named object.

This class should be used to handle HLA named object the setName method should enforce HLA rules for naming scheme as specified in IEEE-1516.2-2000 (§3.3.1 Names) "IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA)—Object Model Template (OMT) Specification"

Definition at line 41 of file Named.hh.


Constructor & Destructor Documentation

Named (  ) 

Default constructor.

Name initialized with the empty string.

Definition at line 29 of file Named.cc.

Named ( const std::string  newName  ) 

Constructor with inital value.

Parameters:
[in] name Initial name

Definition at line 31 of file Named.cc.

~Named (  )  [virtual]

Virtual destructor.

Necessary for a class having virtual methods.

Definition at line 34 of file Named.cc.


Member Function Documentation

void setName ( const std::string  newName  )  [virtual]

void setName ( const char *  newName  )  [virtual]

Set name (char* version).

Parameters:
[in] name the new name

Definition at line 43 of file Named.cc.

References Named::name.

const std::string & getName (  )  const [virtual]

const char * getCName (  )  const [virtual]

Get C-style name.

Returns:
pointer on name, as const char *

Definition at line 55 of file Named.cc.

References Named::name.

Referenced by ObjectClass::getAttributeName().

bool isNamed ( const std::string &  newName  )  const

Check if the name matches the provided parameter.

Parameters:
name String to compare
Returns:
true if strings match

Definition at line 61 of file Named.cc.

References Named::name.

Referenced by ObjectClass::attributeOwnershipAcquisition(), ObjectClass::attributeOwnershipAcquisitionIfAvailable(), ObjectClass::attributeOwnershipReleaseResponse(), ObjectClass::negotiatedAttributeOwnershipDivestiture(), and ObjectClass::unconditionalAttributeOwnershipDivestiture().

bool validateHLAName ( const std::string &  name  )  [static]

This method check if the provided name respects the HLA named object specifications, IEEE-1516.2-2000 (§3.3.1 Names).

Parameters:
[in] name the name to be checked
Returns:
true if the name is a valid HLA name, false otherwise.

Definition at line 67 of file Named.cc.

bool isQualifiedClassName ( const std::string &  name  )  [static]

Check if the provided name is a qualified class name.

Qualified HLA class name are those beginning at root class name. In a qualified class name each component is separated by a dot '.' like in: "ObjectRoot.Bille.PositionX"

Parameters:
[in] name the name to be checked
Returns:
true if the name is qualified one

Definition at line 74 of file Named.cc.

Referenced by TreeNamedAndHandledSet::getHandleFromName().

std::string getNextClassName ( std::string &  qualifiedClassName  )  [static]

Get next class name component.

Parameters:
[in,out] qualifiedClassName 
Returns:
the next (leading) class name

Definition at line 81 of file Named.cc.

Referenced by TreeNamedAndHandledSet::getHandleFromName().

std::string getLeafClassName ( std::string  qualifiedClassName  )  [static]

Get leaf class name component.

Parameters:
[in] qualifiedClassName 
Returns:
the leaf class name

Definition at line 97 of file Named.cc.

Referenced by TreeNamedAndHandledSet::getHandleFromName().


Member Data Documentation

std::string name [protected]


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

Generated on Thu Apr 30 15:55:31 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5