1 #ifndef __INPUTPORT_HXX__
2 #define __INPUTPORT_HXX__
7 #include "TypeCode.hxx"
8 #include "DataFlowPort.hxx"
9 #include "ConversionException.hxx"
18 /*! \brief Base class for Input Ports
23 class InputPort : public DataFlowPort, public InPort
25 friend class Runtime; // for port creation
28 static const char NAME[];
32 std::string getNameOfTypeOfCurrentInstance() const;
33 //! returns the final physical port behind 'this'.
34 virtual InputPort *getPublicRepresentant() { return this; }
35 virtual bool isIntermediate() const { return false; }
36 virtual bool edIsManuallyInitialized() const;
38 bool edIsInitialized() const;
42 void edInit(Any *value);
43 void edInit(const std::string& impl,const void* value);
44 virtual void edRemoveManInit();
45 void checkBasicConsistency() const throw(Exception);
46 virtual void exInit(bool start);
47 virtual void exSaveInit() = 0;
48 virtual void exRestoreInit() = 0;
49 virtual InputPort *clone(Node *newHelder) const = 0;
50 virtual bool isEmpty();
52 virtual void *get() const throw(Exception) = 0;
53 virtual void put(const void *data) throw(ConversionException) = 0;
54 virtual std::string dump();
55 virtual void setStringRef(std::string strRef);
57 InputPort(const InputPort& other, Node *newHelder);
58 InputPort(const std::string& name, Node *node, TypeCode* type);
61 std::string _stringRef;
64 /*! \brief Base class for Proxy Input Ports
69 class ProxyPort : public InputPort
72 ProxyPort(InputPort* p);
75 void edRemoveAllLinksLinkedWithMe() throw(Exception);
76 InputPort *clone(Node *newHelder) const;
77 void edNotifyReferencedBy(OutPort *fromPort);
78 void edNotifyDereferencedBy(OutPort *fromPort);
79 std::set<OutPort *> edSetOutPort() const;
80 InputPort *getPublicRepresentant();
81 void *get() const throw(Exception);
82 virtual void put(const void *data) throw(ConversionException) ;
83 int edGetNumberOfLinks() const;
84 bool isIntermediate() const { return true; }
87 void getAllRepresentants(std::set<InPort *>& repr) const;
93 void InputPort::edInit(T value)
95 InputPort *manuallySet=getRuntime()->adapt(this,
96 Runtime::RUNTIME_ENGINE_INTERACTION_IMPL_NAME,_type);
97 Any* any=AtomAny::New(value);
98 manuallySet->put((const void *) any);