]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/CORBAPorts.hxx
Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / runtime / CORBAPorts.hxx
1 //  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef _CORBAPORTS_HXX_
20 #define _CORBAPORTS_HXX_
21
22 #include <omniORB4/CORBA.h>
23
24 #include "InputPort.hxx"
25 #include "OutputPort.hxx"
26 #include <string>
27
28 namespace YACS
29 {
30   namespace ENGINE
31   {
32 /*! \brief Class for CORBA Input Ports
33  *
34  * \ingroup Ports
35  *
36  * \see CORBANode
37  */
38     class InputCorbaPort : public InputPort
39     {
40     public:
41       InputCorbaPort(const std::string& name, Node *node, TypeCode * type);
42       InputCorbaPort(const InputCorbaPort& other, Node *newHelder);
43       virtual ~InputCorbaPort();
44       bool edIsManuallyInitialized() const;
45       void edRemoveManInit();
46       virtual void put(const void *data) throw(ConversionException);
47       void put(CORBA::Any *data) throw (ConversionException);
48       InputPort *clone(Node *newHelder) const;
49       void *get() const throw(Exception);
50       virtual bool isEmpty();
51       virtual CORBA::Any * getAny();
52       virtual std::string getAsString();
53       virtual PyObject* getPyObj();
54       virtual void exSaveInit();
55       virtual void exRestoreInit();
56       virtual std::string dump();
57       virtual std::string typeName() {return "YACS__ENGINE__InputCorbaPort";}
58       virtual std::string valToStr();
59       virtual void valFromStr(std::string valstr);
60     protected:
61       CORBA::Any  _data;
62       CORBA::Any *  _initData;
63       CORBA::ORB_ptr _orb;
64     };
65
66     class OutputCorbaPort;
67
68     std::ostream & operator<<( std::ostream &os,
69                                const YACS::ENGINE::OutputCorbaPort& p);
70
71     class OutputCorbaPort : public OutputPort
72     {
73       friend std::ostream &operator<< ( std::ostream &os,
74                                         const OutputCorbaPort& p);
75     public:
76       OutputCorbaPort(const std::string& name, Node *node, TypeCode * type);
77       OutputCorbaPort(const OutputCorbaPort& other, Node *newHelder);
78       virtual ~OutputCorbaPort();
79       virtual void put(const void *data) throw(ConversionException);
80       void put(CORBA::Any *data) throw (ConversionException);
81       OutputPort *clone(Node *newHelder) const;
82       virtual CORBA::Any * getAny();
83       virtual CORBA::Any * getAnyOut();
84       virtual std::string getAsString();
85       virtual PyObject* getPyObj();
86       virtual std::string dump();
87       virtual std::string typeName() {return "YACS__ENGINE__OutputCorbaPort";}
88       virtual std::string valToStr();
89       virtual void valFromStr(std::string valstr);
90     protected:
91       CORBA::Any  _data;
92       CORBA::ORB_ptr _orb;
93     };
94
95
96   }
97 }
98
99 #endif