]> git.mxchange.org Git - simgear.git/blobdiff - simgear/hla/HLAObjectInstance.hxx
Windows versionhelpers.h support.
[simgear.git] / simgear / hla / HLAObjectInstance.hxx
index bc78ada43f733146fb047118470657de9881efc7..e5545207ff7f90131a8d2bd9cfaa9b82db638a71 100644 (file)
@@ -73,9 +73,26 @@ public:
 
     /// Sets the data element of the attribute with the given index to dataElement
     void setAttributeDataElement(unsigned index, const SGSharedPtr<HLADataElement>& dataElement);
-    /// Sets the data element of the attribute with the given index to the content of pathElementMap
-    void setAttribute(unsigned index, const HLAPathElementMap& pathElementMap);
-    void setAttributes(const HLAAttributePathElementMap& attributePathElementMap);
+
+    /// Retrieve the data element index for the given path.
+    bool getDataElementIndex(HLADataElementIndex& index, const std::string& path) const;
+    HLADataElementIndex getDataElementIndex(const std::string& path) const;
+
+    /// Return the data element of the attribute with the given index
+    HLADataElement* getAttributeDataElement(const HLADataElementIndex& index);
+    const HLADataElement* getAttributeDataElement(const HLADataElementIndex& index) const;
+    /// Set the data element of the attribute with the given index
+    void setAttributeDataElement(const HLADataElementIndex& index, const SGSharedPtr<HLADataElement>& dataElement);
+
+    /// Return the data element of the attribute with the given path.
+    /// The method is only for convenience as parsing the path is expensive.
+    /// Precompute the index and use the index instead if you use this method more often.
+    HLADataElement* getAttributeDataElement(const std::string& path);
+    const HLADataElement* getAttributeDataElement(const std::string& path) const;
+    /// Set the data element of the attribute with the given path
+    /// The method is only for convenience as parsing the path is expensive.
+    /// Precompute the index and use the index instead if you use this method more often.
+    void setAttributeDataElement(const std::string& path, const SGSharedPtr<HLADataElement>& dataElement);
 
     /// Gets called on discovering this object instance.
     virtual void discoverInstance(const RTIData& tag);
@@ -153,8 +170,6 @@ private:
     void _reflectAttributeValues(const HLAIndexList& indexList, const RTIData& tag);
     void _reflectAttributeValues(const HLAIndexList& indexList, const SGTimeStamp& timeStamp, const RTIData& tag);
 
-    class DataElementFactoryVisitor;
-
     struct Attribute {
         Attribute() : _enabledUpdate(false), _unconditionalUpdate(false) {}
         SGSharedPtr<HLADataElement> _dataElement;