Salome HOME
84011ac865e644f04b28100ad3b0afd3063d2e4b
[modules/yacs.git] / src / runtime / CalStreamPort.hxx
1 // Copyright (C) 2006-2023  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, or (at your option) any later version.
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
20 #ifndef __CALSTREAMPORT_HXX__
21 #define __CALSTREAMPORT_HXX__
22
23 #include "yacsconfig.h"
24 #ifdef DSC_PORTS
25 #include "DSC_Engines.hh"
26 #endif
27
28 #include "InputDataStreamPort.hxx"
29 #include "OutputDataStreamPort.hxx"
30
31 namespace YACS
32 {
33   namespace ENGINE
34   {
35     /*! \brief Class for Input Calcium DataStream Ports
36      *
37      * \ingroup Ports
38      *
39      */
40     class InputCalStreamPort : public InputDataStreamPort
41     {
42       public:
43         static const char NAME[];
44         InputCalStreamPort(const std::string& name, Node *node, TypeCode* type);
45         InputCalStreamPort(const InputCalStreamPort& other, Node *newHelder);
46         virtual ~InputCalStreamPort();
47         void setProperty(const std::string& name, const std::string& value);
48         std::string getNameOfTypeOfCurrentInstance() const;
49         InputCalStreamPort * clone(Node *newHelder) const;
50 #ifdef DSC_PORTS
51         virtual void initPortProperties();
52 #endif
53         void setSchema(const std::string& value);
54         std::string getSchema(){return _schema;};
55         void setLevel(const std::string& value);
56         int getLevel(){return _level;};
57         void setDepend(const std::string& value);
58         std::string getDepend(){return _depend;};
59         void setDelta(const std::string& value);
60         double getDelta(){return _delta;};
61         void setAlpha(const std::string& value);
62         double getAlpha(){return _alpha;};
63         void setInterp(const std::string& value);
64         std::string getInterp(){return _interp;};
65         void setExtrap(const std::string& value);
66         std::string getExtrap(){return _extrap;};
67       protected:
68         std::string _depend;
69         std::string _schema;
70         std::string _interp;
71         std::string _extrap;
72         int _level;
73         double _delta;
74         double _alpha;
75     };
76
77     /*! \brief Class for Output Calcium DataStream Ports
78      *
79      * \ingroup Ports
80      *
81      */
82     class OutputCalStreamPort : public OutputDataStreamPort
83     {
84       public:
85         static const char NAME[];
86         OutputCalStreamPort(const std::string& name, Node *node, TypeCode* type);
87         OutputCalStreamPort(const OutputCalStreamPort& other, Node *newHelder);
88         virtual ~OutputCalStreamPort();
89         void setDepend(const std::string& depend);
90         void setLevel(const std::string& schema);
91         std::string getDepend(){return _depend;};
92         int getLevel(){return _level;};
93         void setSchema(const std::string& schema);
94         std::string getSchema(){return _schema;};
95         void setProperty(const std::string& name, const std::string& value);
96         virtual bool addInPort(InPort *inPort) ;
97         std::string getNameOfTypeOfCurrentInstance() const;
98         OutputCalStreamPort * clone(Node *newHelder) const;
99         virtual int removeInPort(InPort *inPort, bool forward) ;
100       protected:
101         std::string _depend;
102         std::string _schema;
103         int _level;
104         double _delta;
105     };
106   }
107 }
108
109 #endif