1 // Copyright (C) 2007-2013 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.
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
34 #include "COMPONENT_version.h"
35 #include "DataStreamComponent_Impl.hxx"
39 DataStreamFactory_Impl::DataStreamFactory_Impl( CORBA::ORB_ptr orb,
40 PortableServer::POA_ptr poa,
41 PortableServer::ObjectId * contId,
42 const char *instanceName,
43 const char *interfaceName) :
44 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
45 MESSAGE("DataStreamFactory_Impl::DataStreamFactory_Impl this " << hex << this << dec
46 << "activate object instanceName("
47 << instanceName << ") interfaceName(" << interfaceName << ")" )
49 _id = _poa->activate_object(_thisObj);
52 DataStreamFactory_Impl::DataStreamFactory_Impl() {
55 DataStreamFactory_Impl::~DataStreamFactory_Impl() {
58 char* DataStreamFactory_Impl::getVersion()
60 #if COMPONENT_DEVELOPMENT
61 return CORBA::string_dup(COMPONENT_VERSION_STR"dev");
63 return CORBA::string_dup(COMPONENT_VERSION_STR);
67 void DataStreamFactory_Impl::Setxy( CORBA::Long x , CORBA::Long y ) {
72 void DataStreamFactory_Impl::Getxy( CORBA::Long & x , CORBA::Long & y ) {
77 void DataStreamFactory_Impl::Add( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
80 void DataStreamFactory_Impl::Sub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
83 void DataStreamFactory_Impl::Mul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
86 void DataStreamFactory_Impl::Div( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
90 DataStreamComponent::DataStream_ptr DataStreamFactory_Impl::NewDataStream() {
91 beginService( "DataStreamFactory_Impl::NewDataStream" );
92 sendMessage(NOTIF_STEP, "DataStreamFactory_Impl creates DataStream_Impl");
93 DataStream_Impl * myDataStream ;
94 myDataStream = new DataStream_Impl( _orb , _poa, _contId,
95 instanceName() , interfaceName() ,
96 graphName() , nodeName() ) ;
97 DataStreamComponent::DataStream_var iobject ;
98 PortableServer::ObjectId * id = myDataStream->getId() ;
99 CORBA::Object_var obj = _poa->id_to_reference(*id);
100 iobject = DataStreamComponent::DataStream::_narrow(obj) ;
101 endService( "DataStreamFactory_Impl::NewDataStream" );
102 return DataStreamComponent::DataStream::_duplicate(iobject) ;
107 PortableServer::ObjectId * DataStreamFactoryEngine_factory
109 PortableServer::POA_ptr poa,
110 PortableServer::ObjectId * contId,
111 const char *instanceName,
112 const char *interfaceName)
114 MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
115 << instanceName << "," << interfaceName << "," << getpid() << ")");
116 DataStreamFactory_Impl * myDataStreamFactory
117 = new DataStreamFactory_Impl(orb, poa, contId, instanceName, interfaceName);
118 return myDataStreamFactory->getId() ;
122 DataStream_Impl::DataStream_Impl( CORBA::ORB_ptr orb ,
123 PortableServer::POA_ptr poa ,
124 PortableServer::ObjectId * contId ,
125 const char * instanceName ,
126 const char * interfaceName ,
127 const char * graphName ,
128 const char * nodeName ) :
129 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
130 Names( graphName , nodeName ) ;
131 MESSAGE("DataStream_Impl::DataStream_Impl activate object instanceName("
132 << instanceName << ") interfaceName(" << interfaceName << ") --> "
133 << hex << (void *) this << dec )
134 beginService( "DataStream_Impl::DataStream_Impl" );
136 _id = _poa->activate_object(_thisObj);
137 sendMessage(NOTIF_STEP, "DataStream_Impl is Created");
138 endService( "DataStream_Impl::DataStream_Impl" );
141 DataStream_Impl::DataStream_Impl() {
144 DataStream_Impl::~DataStream_Impl() {
145 beginService( "DataStream_Impl::~DataStream_Impl" );
146 endService( "DataStream_Impl::~DataStream_Impl" );
149 char* DataStream_Impl::getVersion()
151 #if COMPONENT_DEVELOPMENT
152 return CORBA::string_dup(COMPONENT_VERSION_STR"dev");
154 return CORBA::string_dup(COMPONENT_VERSION_STR);
158 void DataStream_Impl::StreamSetxy( CORBA::Long x , CORBA::Long y ) {
163 void DataStream_Impl::StreamGetxy( CORBA::Long & x , CORBA::Long & y ) {
168 void DataStream_Impl::StreamAdd( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
171 void DataStream_Impl::StreamSub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
174 void DataStream_Impl::StreamMul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {
177 void DataStream_Impl::StreamDiv( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) {