#include <simgear/debug/logstream.hxx>
#include <simgear/props/props.hxx>
#include <simgear/props/props_io.hxx>
+#include <simgear/structure/SGReferenced.hxx>
\f
////////////////////////////////////////////////////////////////////////
*
* This class should migrate to somewhere more general.
*/
-class SGCondition
+class SGCondition : public SGReferenced
{
public:
SGCondition ();
virtual ~SGPropertyCondition ();
virtual bool test () const { return _node->getBoolValue(); }
private:
- const SGPropertyNode * _node;
+ SGConstPropertyNode_ptr _node;
};
class SGNotCondition : public SGCondition
{
public:
- // transfer pointer ownership
SGNotCondition (SGCondition * condition);
virtual ~SGNotCondition ();
virtual bool test () const;
private:
- SGCondition * _condition;
+ SGSharedPtr<SGCondition> _condition;
};
// transfer pointer ownership
virtual void addCondition (SGCondition * condition);
private:
- vector<SGCondition *> _conditions;
+ std::vector<SGSharedPtr<SGCondition> > _conditions;
};
// transfer pointer ownership
virtual void addCondition (SGCondition * condition);
private:
- vector<SGCondition *> _conditions;
+ std::vector<SGSharedPtr<SGCondition> > _conditions;
};
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;
};
* 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 ();
virtual const SGCondition * getCondition () const { return _condition; }
virtual bool test () const;
private:
- SGCondition * _condition;
+ SGSharedPtr<SGCondition> _condition;
};