X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fprops%2Fcondition.hxx;h=c70e86d74d77ea356f041fb2b430df61d379d0ac;hb=2e93b06ac0874f1cee1e22dc30777a0066ef289b;hp=b314cc4ed017f3430219852d0d40ddb4b07834b7;hpb=d8a75897526f2ba2a030225a22dfbd93c7c39a7e;p=simgear.git diff --git a/simgear/props/condition.hxx b/simgear/props/condition.hxx index b314cc4e..c70e86d7 100644 --- a/simgear/props/condition.hxx +++ b/simgear/props/condition.hxx @@ -13,6 +13,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////// @@ -28,7 +29,7 @@ * * This class should migrate to somewhere more general. */ -class SGCondition +class SGCondition : public SGReferenced { public: SGCondition (); @@ -51,7 +52,7 @@ public: virtual ~SGPropertyCondition (); virtual bool test () const { return _node->getBoolValue(); } private: - const SGPropertyNode * _node; + SGConstPropertyNode_ptr _node; }; @@ -63,12 +64,11 @@ private: class SGNotCondition : public SGCondition { public: - // transfer pointer ownership SGNotCondition (SGCondition * condition); virtual ~SGNotCondition (); virtual bool test () const; private: - SGCondition * _condition; + SGSharedPtr _condition; }; @@ -87,7 +87,7 @@ public: // transfer pointer ownership virtual void addCondition (SGCondition * condition); private: - vector _conditions; + std::vector > _conditions; }; @@ -106,7 +106,7 @@ public: // transfer pointer ownership virtual void addCondition (SGCondition * condition); private: - vector _conditions; + std::vector > _conditions; }; @@ -133,9 +133,9 @@ public: private: Type _type; bool _reverse; - const SGPropertyNode * _left_property; - const SGPropertyNode * _right_property; - const SGPropertyNode * _right_value; + SGConstPropertyNode_ptr _left_property; + SGConstPropertyNode_ptr _right_property; + SGConstPropertyNode_ptr _right_value; }; @@ -146,7 +146,7 @@ private: * invoke the test() method whenever it needs to decide whether to * active itself, draw itself, and so on. */ -class SGConditional +class SGConditional : public SGReferenced { public: SGConditional (); @@ -156,7 +156,7 @@ public: virtual const SGCondition * getCondition () const { return _condition; } virtual bool test () const; private: - SGCondition * _condition; + SGSharedPtr _condition; };