LibCT 2.0

Include/DecisionNode.h

Go to the documentation of this file.
00001 // ------------------------------------------------------------------
00012 #ifndef _LIBCT_DECISIONNODE_H
00013 #define _LIBCT_DECISIONNODE_H
00014 
00015 #include "Node.h"
00016 #include "VariableInterface.h"
00017 
00018 namespace LibCT
00019 {
00021         class DecisionNode : public Node
00022         {
00023         public:
00024                 enum Events
00025                 {
00026                         EventsOnEnter,  
00027                         EventsOnExit,   
00028                         EventsOnTrue,   
00029                         EventsOnFalse   
00030                 };
00031 
00032                 enum Connections
00033                 {
00034                         ConnectionsFalse,       
00035                         ConnectionsTrue         
00036                 };
00037 
00038                 enum Variables
00039                 {
00040                         VariablesLeft,          
00041                         VariablesRight,         
00042                         VariablesCount          
00043                 };
00044 
00046                 explicit DecisionNode(
00047                         Node* pParent,
00048                         const std::string& text
00049                         );
00050 
00052                 ~DecisionNode();
00053 
00056                 bool SerialiseImpl(InputStream* pInput);
00057 
00060                 bool SerialiseImpl(OutputStream* pOutput);
00061 
00063                 void SetVariable(
00064                         VariableInterface* pVar,        
00065                         Variables index                         
00066                         );
00067 
00069                 void SetOperator(
00070                         VariableOperator oper           
00071                         );
00072 
00075                 VariableInterface* GetVariable(
00076                         Variables index                         
00077                         ) const;
00078 
00081                 VariableOperator GetOperator() const;
00082 
00085                 Node* GetNext();
00086 
00087         private:
00088                 VariableInterface*      m_pVariables[VariablesCount];   
00089                 VariableOperator        m_Operator;                                             
00090         };
00091 }
00092 
00093 #endif // _LIBCT_DECISIONNODE_H