return _rtiObjectInstance->getDataElement(index);
}
-class HLAObjectInstance::DataElementFactoryVisitor : public HLADataTypeVisitor {
+class HLAObjectInstance::DataElementFactoryVisitor : public HLADataElementFactoryVisitor {
public:
DataElementFactoryVisitor(const HLAPathElementMap& pathElementMap) :
_pathElementMap(pathElementMap)
if (_dataElement.valid())
return;
- _dataElement = new HLASCharDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAUInt8DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAUCharDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAInt16DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAShortDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAUInt16DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAUShortDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAInt32DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAIntDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAUInt32DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAUIntDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAInt64DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLALongDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAUInt64DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAULongDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAFloat32DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLAFloatDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAFloat64DataType& dataType)
{
if (_dataElement.valid())
return;
- _dataElement = new HLADoubleDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
class ArrayDataElementFactory : public HLAArrayDataElement::DataElementFactory {
if (_dataElement.valid())
return;
- _dataElement = new HLAEnumeratedDataElement(&dataType);
+ HLADataElementFactoryVisitor::apply(dataType);
}
virtual void apply(const HLAFixedRecordDataType& dataType)
_dataElement = variantDataElement;
}
- const SGSharedPtr<HLADataElement>& getDataElement() const
- { return _dataElement; }
-
private:
SGSharedPtr<HLADataElement> createDataElement(const HLADataElement::Path& path, const HLADataType& dataType)
{
return dataElement;
}
- SGSharedPtr<HLADataElement> _dataElement;
const HLAPathElementMap& _pathElementMap;
HLADataElement::Path _path;
};
}
}
-void
-HLAObjectInstance::requestAttributeUpdate(unsigned index)
-{
- if (!_rtiObjectInstance.valid()) {
- SG_LOG(SG_IO, SG_ALERT, "Trying to request attribute update for inactive object!");
- return;
- }
- _rtiObjectInstance->setRequestAttributeUpdate(index, true);
-}
-
-void
-HLAObjectInstance::requestAttributeUpdate()
-{
- if (!_rtiObjectInstance.valid()) {
- SG_LOG(SG_IO, SG_ALERT, "Trying to request attribute update for inactive object!");
- return;
- }
- _rtiObjectInstance->setRequestAttributeUpdate(true);
-}
-
void
HLAObjectInstance::registerInstance()
{
_rtiObjectInstance->deleteObjectInstance(tag);
}
-void
-HLAObjectInstance::localDeleteInstance()
-{
- if (!_rtiObjectInstance.valid()) {
- SG_LOG(SG_IO, SG_ALERT, "Trying to delete inactive object!");
- return;
- }
- _rtiObjectInstance->localDeleteObjectInstance();
-}
-
void
HLAObjectInstance::updateAttributeValues(const RTIData& tag)
{
_rtiObjectInstance->updateAttributeValues(timeStamp, tag);
}
-void
-HLAObjectInstance::reflectQueuedAttributeValues(const SGTimeStamp& timeStamp)
-{
- if (!_rtiObjectInstance.valid()) {
- SG_LOG(SG_IO, SG_INFO, "Not updating inactive object!");
- return;
- }
- _rtiObjectInstance->reflectQueuedAttributeValues(timeStamp);
-}
-
void
HLAObjectInstance::removeInstance(const RTIData& tag)
{