Salome HOME
Copyright update 2021
[samples/component.git] / src / DataStreamComponent / DataStreamComponent_Impl.hxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SuperVisionTest DataStreamComponent : example of component
24 //  File   : DataStreamComponent_Impl.hxx
25 //  Author : Jean Rahuel
26 //  Module : SuperVisionTest
27 //  $Header:
28 //
29 #ifndef _DATASTREAMINTERFACE_IMPL_HXX_
30 #define _DATASTREAMINTERFACE_IMPL_HXX_
31
32 #ifdef WIN32
33 # if defined DATASTREAMFACTORYENGINE_EXPORTS || defined DataStreamFactoryEngine_EXPORTS
34 #  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllexport )
35 # else
36 #  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllimport )
37 # endif
38 #else
39 # define DATASTREAMFACTORYENGINE_EXPORT
40 #endif
41
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(DataStreamComponent)
44 #include CORBA_SERVER_HEADER(SALOME_Component)
45 #include "SALOME_Component_i.hxx"
46
47 class DATASTREAMFACTORYENGINE_EXPORT DataStreamFactory_Impl :  public POA_DataStreamComponent::DataStreamFactory ,
48                                                                public Engines_Component_i {
49 public:
50   DataStreamFactory_Impl() ;
51   DataStreamFactory_Impl( CORBA::ORB_ptr orb,
52                           PortableServer::POA_ptr poa,
53                           PortableServer::ObjectId * contId, 
54                           const char *instanceName,
55                           const char *interfaceName);
56
57   virtual ~DataStreamFactory_Impl();
58
59   virtual char* getVersion();
60
61   virtual void Setxy( CORBA::Long x , CORBA::Long y ) ;
62
63   virtual void Getxy( CORBA::Long & x , CORBA::Long & y ) ;
64
65   virtual void Add( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
66   virtual void Sub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
67   virtual void Mul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
68   virtual void Div( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
69
70   virtual DataStreamComponent::DataStream_ptr NewDataStream() ;
71
72 private:
73
74   long _x ;
75   long _y ;
76
77 };
78
79 extern "C"
80   DATASTREAMFACTORYENGINE_EXPORT
81   PortableServer::ObjectId * DataStreamFactoryEngine_factory
82                                    ( CORBA::ORB_ptr orb ,
83                                      PortableServer::POA_ptr poa , 
84                                      PortableServer::ObjectId * contId ,
85                                      const char *instanceName ,
86                                      const char *interfaceName ) ;
87
88
89 class DATASTREAMFACTORYENGINE_EXPORT DataStream_Impl :  public POA_DataStreamComponent::DataStream ,
90                                                         public Engines_Component_i {
91 public:
92   DataStream_Impl() ;
93   DataStream_Impl( CORBA::ORB_ptr orb ,
94                    PortableServer::POA_ptr poa ,
95                    PortableServer::ObjectId * contId , 
96                    const char *instanceName ,
97                    const char *interfaceName , 
98                    const char * graphName ,
99                    const char * nodeName );
100
101   virtual ~DataStream_Impl();
102
103   virtual char* getVersion();
104
105   virtual void StreamSetxy( CORBA::Long x , CORBA::Long y ) ;
106
107   virtual void StreamGetxy( CORBA::Long & x , CORBA::Long & y ) ;
108
109   virtual void StreamAdd( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
110   virtual void StreamSub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
111   virtual void StreamMul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
112   virtual void StreamDiv( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
113
114 private:
115
116   long _x ;
117   long _y ;
118
119 };
120
121 #endif