Browse Source

- fbx: change const semantics for PropertyTable's. Lazy parsing of properties no longer affects logical constness.

acgessler 13 years ago
parent
commit
b49cf16bc2
2 changed files with 6 additions and 6 deletions
  1. 2 2
      code/FBXProperties.cpp
  2. 4 4
      code/FBXProperties.h

+ 2 - 2
code/FBXProperties.cpp

@@ -120,7 +120,7 @@ std::string PeekPropertyName(const Element& element)
 } //! anon
 
 // ------------------------------------------------------------------------------------------------
-PropertyTable::PropertyTable(const Element& element, PropertyTable* templateProps)
+PropertyTable::PropertyTable(const Element& element, const PropertyTable* templateProps)
 : element(element)
 , templateProps(templateProps)
 {
@@ -156,7 +156,7 @@ PropertyTable::~PropertyTable()
 }
 
 // ------------------------------------------------------------------------------------------------
-const Property* PropertyTable::Get(const std::string& name)
+const Property* PropertyTable::Get(const std::string& name) const
 {
 	PropertyMap::const_iterator it = props.find(name);
 	if (it == props.end()) {

+ 4 - 4
code/FBXProperties.h

@@ -109,12 +109,12 @@ class PropertyTable
 {
 public:
 
-	PropertyTable(const Element& element, PropertyTable* templateProps);
+	PropertyTable(const Element& element, const PropertyTable* templateProps);
 	~PropertyTable();
 
 public:
 
-	const Property* Get(const std::string& name);
+	const Property* Get(const std::string& name) const;
 
 	const Element& GetElement() const {
 		return element;
@@ -127,8 +127,8 @@ public:
 private:
 
 	LazyPropertyMap lazyProps;
-	PropertyMap props;
-	PropertyTable* const templateProps;
+	mutable PropertyMap props;
+	const PropertyTable* const templateProps;
 	const Element& element;
 };