Salome HOME
92910722e984f67742a7e44b4cbb525d469fcbaa
[modules/yacs.git] / src / engine / ConditionInputPort.hxx
1 #ifndef __CONDITIONINPUTPORT_HXX__
2 #define __CONDITIONINPUTPORT_HXX__
3
4 #include "InputPort.hxx"
5
6 namespace YACS
7 {
8   namespace ENGINE
9   {
10     class WhileLoop;
11
12     class ConditionInputPort : public InputPort // public inheritance for correct dynamic cast from Port to ConditionInputPort in GUI part
13     {
14       friend class WhileLoop;
15       OutPort *_outOfScopeBackLink;
16
17       ConditionInputPort(const std::string& name, WhileLoop *node);
18       ConditionInputPort(const ConditionInputPort& other, Node *newHelder);
19       ~ConditionInputPort();
20       void exSaveInit();
21       void exRestoreInit();
22       InputPort *clone(Node *newHelder) const;
23       bool isLinkedOutOfScope() const;
24       void edNotifyReferencedBy(OutPort *fromPort);
25       void edNotifyDereferencedBy(OutPort *fromPort);
26       void *get() const;
27       void put(const void *data) throw(ConversionException);
28       std::string dump();
29     protected:
30       Any *_value;
31     public:
32       bool getValue() const { return (_value ? _value->getBoolValue() : false); }
33     };
34   }
35 }
36
37 #endif