1 // Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SuperVisionTest DataStreamComponent : example
24 // File : DataStreamComponent_Impl.cxx
25 // Author : Jean Rahuel
26 // Module : SuperVisionTest
38 #include "COMPONENT_version.h"
39 #include "DataStreamComponent_Impl.hxx"
43 DataStreamFactory_Impl::DataStreamFactory_Impl( CORBA::ORB_ptr orb,
44 PortableServer::POA_ptr poa,
45 PortableServer::ObjectId * contId,
46 const char *instanceName,
47 const char *interfaceName) :
48 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
49 MESSAGE("DataStreamFactory_Impl::DataStreamFactory_Impl this " << hex << this << dec
50 << "activate object instanceName("
51 << instanceName << ") interfaceName(" << interfaceName << ")" )
53 _id = _poa->activate_object(_thisObj);
56 DataStreamFactory_Impl::DataStreamFactory_Impl() {
59 DataStreamFactory_Impl::~DataStreamFactory_Impl() {
62 char* DataStreamFactory_Impl::getVersion()
64 #if COMPONENT_DEVELOPMENT
65 return CORBA::string_dup(COMPONENT_VERSION_STR"dev");
67 return CORBA::string_dup(COMPONENT_VERSION_STR);
71 void DataStreamFactory_Impl::Setxy( CORBA::Long x , CORBA::Long y ) {
76 void DataStreamFactory_Impl::Getxy( CORBA::Long & x , CORBA::Long & y ) {
81 void DataStreamFactory_Impl::Add( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
84 void DataStreamFactory_Impl::Sub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
87 void DataStreamFactory_Impl::Mul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
90 void DataStreamFactory_Impl::Div( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
94 DataStreamComponent::DataStream_ptr DataStreamFactory_Impl::NewDataStream() {
95 beginService( "DataStreamFactory_Impl::NewDataStream" );
96 sendMessage(NOTIF_STEP, "DataStreamFactory_Impl creates DataStream_Impl");
97 DataStream_Impl * myDataStream ;
98 myDataStream = new DataStream_Impl( _orb , _poa, _contId,
99 instanceName() , interfaceName() ,
100 graphName() , nodeName() ) ;
101 DataStreamComponent::DataStream_var iobject ;
102 PortableServer::ObjectId * id = myDataStream->getId() ;
103 CORBA::Object_var obj = _poa->id_to_reference(*id);
104 iobject = DataStreamComponent::DataStream::_narrow(obj) ;
105 endService( "DataStreamFactory_Impl::NewDataStream" );
106 return DataStreamComponent::DataStream::_duplicate(iobject) ;
111 PortableServer::ObjectId * DataStreamFactoryEngine_factory
113 PortableServer::POA_ptr poa,
114 PortableServer::ObjectId * contId,
115 const char *instanceName,
116 const char *interfaceName)
119 MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
120 << instanceName << "," << interfaceName << "," << getpid() << ")");
122 MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
123 << instanceName << "," << interfaceName << "," << _getpid() << ")");
125 DataStreamFactory_Impl * myDataStreamFactory
126 = new DataStreamFactory_Impl(orb, poa, contId, instanceName, interfaceName);
127 return myDataStreamFactory->getId() ;
131 DataStream_Impl::DataStream_Impl( CORBA::ORB_ptr orb ,
132 PortableServer::POA_ptr poa ,
133 PortableServer::ObjectId * contId ,
134 const char * instanceName ,
135 const char * interfaceName ,
136 const char * graphName ,
137 const char * nodeName ) :
138 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
139 Names( graphName , nodeName ) ;
140 MESSAGE("DataStream_Impl::DataStream_Impl activate object instanceName("
141 << instanceName << ") interfaceName(" << interfaceName << ") --> "
142 << hex << (void *) this << dec )
143 beginService( "DataStream_Impl::DataStream_Impl" );
145 _id = _poa->activate_object(_thisObj);
146 sendMessage(NOTIF_STEP, "DataStream_Impl is Created");
147 endService( "DataStream_Impl::DataStream_Impl" );
150 DataStream_Impl::DataStream_Impl() {
153 DataStream_Impl::~DataStream_Impl() {
154 beginService( "DataStream_Impl::~DataStream_Impl" );
155 endService( "DataStream_Impl::~DataStream_Impl" );
158 char* DataStream_Impl::getVersion()
160 #if COMPONENT_DEVELOPMENT
161 return CORBA::string_dup(COMPONENT_VERSION_STR"dev");
163 return CORBA::string_dup(COMPONENT_VERSION_STR);
167 void DataStream_Impl::StreamSetxy( CORBA::Long x , CORBA::Long y ) {
172 void DataStream_Impl::StreamGetxy( CORBA::Long & x , CORBA::Long & y ) {
177 void DataStream_Impl::StreamAdd( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
180 void DataStream_Impl::StreamSub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
183 void DataStream_Impl::StreamMul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
186 void DataStream_Impl::StreamDiv( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {