Salome HOME
7d13244f7e399b7e18bf36cfbd1c1a3e4babd763
[modules/yacs.git] / src / runtime / CORBAPorts.hxx
1 #ifndef _CORBAPORTS_HXX_
2 #define _CORBAPORTS_HXX_
3
4 #include <omniORB4/CORBA.h>
5
6 #include "InputPort.hxx"
7 #include "OutputPort.hxx"
8 #include <string>
9
10 namespace YACS
11 {
12   namespace ENGINE
13   {
14 /*! \brief Class for CORBA Input Ports
15  *
16  * \ingroup Ports
17  *
18  * \see CORBANode
19  */
20     class InputCorbaPort : public InputPort
21     {
22     public:
23       InputCorbaPort(const std::string& name, Node *node, TypeCode * type);
24       InputCorbaPort(const InputCorbaPort& other, Node *newHelder);
25       virtual ~InputCorbaPort();
26       bool edIsManuallyInitialized() const;
27       void edRemoveManInit();
28       virtual void put(const void *data) throw(ConversionException);
29       void put(CORBA::Any *data) throw (ConversionException);
30       InputPort *clone(Node *newHelder) const;
31       void *get() const throw(Exception);
32       virtual bool isEmpty();
33       virtual CORBA::Any * getAny();
34       virtual void exSaveInit();
35       virtual void exRestoreInit();
36       virtual std::string dump();
37     protected:
38       CORBA::Any  _data;
39       CORBA::Any *  _initData;
40       CORBA::ORB_ptr _orb;
41     };
42
43     class OutputCorbaPort : public OutputPort
44     {
45     public:
46       OutputCorbaPort(const std::string& name, Node *node, TypeCode * type);
47       OutputCorbaPort(const OutputCorbaPort& other, Node *newHelder);
48       virtual ~OutputCorbaPort();
49       virtual void put(const void *data) throw(ConversionException);
50       void put(CORBA::Any *data) throw (ConversionException);
51       OutputPort *clone(Node *newHelder) const;
52       virtual CORBA::Any * getAny();
53       virtual CORBA::Any * getAnyOut();
54       virtual std::string dump();
55       friend std::ostream & operator<< ( std::ostream &os,
56                                          const OutputCorbaPort& p);
57     protected:
58       CORBA::Any  _data;
59       CORBA::ORB_ptr _orb;
60     };
61
62
63   }
64 }
65
66 #endif