Enhancements to property-object support, add a default ctor and some typedefs.

This commit is contained in:
James Turner 2011-10-30 07:55:29 +00:00
parent ee06ec0c40
commit 2e9896a9ab
2 changed files with 11 additions and 2 deletions

View File

@ -35,6 +35,13 @@ void PropertyObjectBase::setDefaultRoot(SGPropertyNode* aRoot)
static_defaultRoot = aRoot; static_defaultRoot = aRoot;
} }
PropertyObjectBase::PropertyObjectBase() :
_path(NULL),
_prop(NULL)
{
}
PropertyObjectBase::PropertyObjectBase(const PropertyObjectBase& aOther) : PropertyObjectBase::PropertyObjectBase(const PropertyObjectBase& aOther) :
_path(aOther._path), _path(aOther._path),
_prop(aOther._prop) _prop(aOther._prop)

View File

@ -28,6 +28,8 @@ class PropertyObjectBase
public: public:
static void setDefaultRoot(SGPropertyNode* aRoot); static void setDefaultRoot(SGPropertyNode* aRoot);
PropertyObjectBase();
PropertyObjectBase(const PropertyObjectBase& aOther); PropertyObjectBase(const PropertyObjectBase& aOther);
PropertyObjectBase(const char* aChild); PropertyObjectBase(const char* aChild);
@ -57,6 +59,8 @@ template <typename T>
class PropertyObject : PropertyObjectBase class PropertyObject : PropertyObjectBase
{ {
public: public:
PropertyObject();
/** /**
* Create from path relative to the default root, and option default value * Create from path relative to the default root, and option default value
*/ */
@ -220,11 +224,9 @@ private:
} // of namespace simgear } // of namespace simgear
/*
typedef simgear::PropertyObject<double> SGPropObjDouble; typedef simgear::PropertyObject<double> SGPropObjDouble;
typedef simgear::PropertyObject<bool> SGPropObjBool; typedef simgear::PropertyObject<bool> SGPropObjBool;
typedef simgear::PropertyObject<std::string> SGPropObjString; typedef simgear::PropertyObject<std::string> SGPropObjString;
typedef simgear::PropertyObject<long> SGPropObjInt; typedef simgear::PropertyObject<long> SGPropObjInt;
*/
#endif #endif