hla: Provide access to the parent federate.

This commit is contained in:
Mathias Froehlich 2012-03-04 21:34:09 +01:00
parent 92074f0d3c
commit 50380bc6c5
6 changed files with 45 additions and 6 deletions

View File

@ -55,6 +55,12 @@ HLAInteractionClass::getName() const
return _name;
}
const SGWeakPtr<HLAFederate>&
HLAInteractionClass::getFederate() const
{
return _federate;
}
HLASubscriptionType
HLAInteractionClass::getSubscriptionType() const
{

View File

@ -41,6 +41,9 @@ public:
const std::string& getName() const;
/// return the federate this interaction class belongs to
const SGWeakPtr<HLAFederate>& getFederate() const;
HLASubscriptionType getSubscriptionType() const;
void setSubscriptionType(HLASubscriptionType subscriptionType);

View File

@ -81,6 +81,12 @@ HLAObjectClass::getName() const
return _name;
}
const SGWeakPtr<HLAFederate>&
HLAObjectClass::getFederate() const
{
return _federate;
}
unsigned
HLAObjectClass::getNumAttributes() const
{

View File

@ -38,6 +38,9 @@ public:
/// Return the name of this object class
const std::string& getName() const;
/// return the federate this class belongs to
const SGWeakPtr<HLAFederate>& getFederate() const;
/// Return the number of attributes in this object class
unsigned getNumAttributes() const;

View File

@ -51,6 +51,24 @@ HLAObjectInstance::~HLAObjectInstance()
_clearRTIObjectInstance();
}
const std::string&
HLAObjectInstance::getName() const
{
return _name;
}
const SGWeakPtr<HLAFederate>&
HLAObjectInstance::getFederate() const
{
return _federate;
}
const SGSharedPtr<HLAObjectClass>&
HLAObjectInstance::getObjectClass() const
{
return _objectClass;
}
unsigned
HLAObjectInstance::getNumAttributes() const
{

View File

@ -39,13 +39,14 @@ public:
virtual ~HLAObjectInstance();
/// Return the name of this object instance
const std::string& getName() const
{ return _name; }
const std::string& getName() const;
/// return the federate this instance belongs to
const SGWeakPtr<HLAFederate>& getFederate() const;
/// Return the object class of this instance.
/// Should always return a valid object class.
const SGSharedPtr<HLAObjectClass>& getObjectClass() const
{ return _objectClass; }
const SGSharedPtr<HLAObjectClass>& getObjectClass() const;
/// Return the number of attributes
unsigned getNumAttributes() const;
@ -55,7 +56,8 @@ public:
/// Return the attribute name for the attribute with the given index
std::string getAttributeName(unsigned index) const;
/// Return true if the attribute with the given index is owned by this federate
/// Return true if the attribute with the given index is owned by
/// this federate
bool getAttributeOwned(unsigned index) const;
/// Return the data type of the attribute with the given index
@ -65,7 +67,8 @@ public:
HLADataElement* getAttributeDataElement(unsigned index);
const HLADataElement* getAttributeDataElement(unsigned index) const;
/// Write the raw attribute data value into data, works only of the object is backed up with an rti object instance
/// Write the raw attribute data value into data, works only of the object
/// is backed up with an rti object instance
bool getAttributeData(unsigned index, RTIData& data) const;
/// Sets the data element of the attribute with the given index to dataElement