1 // SuperVisionTest DataStreamComponent : example
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DataStreamComponent_Impl.cxx
25 // Author : Jean Rahuel
26 // Module : SuperVisionTest
35 #include "DataStreamComponent_Impl.hxx"
37 DataStreamFactory_Impl::DataStreamFactory_Impl( CORBA::ORB_ptr orb,
38 PortableServer::POA_ptr poa,
39 PortableServer::ObjectId * contId,
40 const char *instanceName,
41 const char *interfaceName) :
42 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
43 MESSAGE("DataStreamFactory_Impl::DataStreamFactory_Impl this " << hex << this << dec
44 << "activate object instanceName("
45 << instanceName << ") interfaceName(" << interfaceName << ")" )
47 _id = _poa->activate_object(_thisObj);
50 DataStreamFactory_Impl::DataStreamFactory_Impl() {
53 DataStreamFactory_Impl::~DataStreamFactory_Impl() {
56 void DataStreamFactory_Impl::Setxy( const long x , const long y ) {
61 void DataStreamFactory_Impl::Getxy( long & x , long & y ) {
66 void DataStreamFactory_Impl::Add( const long x , const long y , long & z ) {
69 void DataStreamFactory_Impl::Sub( const long x , const long y , long & z ) {
72 void DataStreamFactory_Impl::Mul( const long x , const long y , long & z ) {
75 void DataStreamFactory_Impl::Div( const long x , const long y , long & z ) {
79 DataStreamComponent::DataStream_ptr DataStreamFactory_Impl::NewDataStream() {
80 beginService( "DataStreamFactory_Impl::NewDataStream" );
81 sendMessage(NOTIF_STEP, "DataStreamFactory_Impl creates DataStream_Impl");
82 DataStream_Impl * myDataStream ;
83 myDataStream = new DataStream_Impl( _orb , _poa, _contId,
84 instanceName() , interfaceName() ,
85 graphName() , nodeName() ) ;
86 DataStreamComponent::DataStream_var iobject ;
87 PortableServer::ObjectId * id = myDataStream->getId() ;
88 CORBA::Object_var obj = _poa->id_to_reference(*id);
89 iobject = DataStreamComponent::DataStream::_narrow(obj) ;
90 endService( "DataStreamFactory_Impl::NewDataStream" );
91 return DataStreamComponent::DataStream::_duplicate(iobject) ;
96 PortableServer::ObjectId * DataStreamFactoryEngine_factory
98 PortableServer::POA_ptr poa,
99 PortableServer::ObjectId * contId,
100 const char *instanceName,
101 const char *interfaceName)
103 MESSAGE("DataStreamFactoryEngine_factory DataStreamFactoryEngine ("
104 << instanceName << "," << interfaceName << "," << getpid() << ")");
105 DataStreamFactory_Impl * myDataStreamFactory
106 = new DataStreamFactory_Impl(orb, poa, contId, instanceName, interfaceName);
107 return myDataStreamFactory->getId() ;
111 DataStream_Impl::DataStream_Impl( CORBA::ORB_ptr orb ,
112 PortableServer::POA_ptr poa ,
113 PortableServer::ObjectId * contId ,
114 const char * instanceName ,
115 const char * interfaceName ,
116 const char * graphName ,
117 const char * nodeName ) :
118 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
119 Names( graphName , nodeName ) ;
120 MESSAGE("DataStream_Impl::DataStream_Impl activate object instanceName("
121 << instanceName << ") interfaceName(" << interfaceName << ") --> "
122 << hex << (void *) this << dec )
123 beginService( "DataStream_Impl::DataStream_Impl" );
125 _id = _poa->activate_object(_thisObj);
126 sendMessage(NOTIF_STEP, "DataStream_Impl is Created");
127 endService( "DataStream_Impl::DataStream_Impl" );
130 DataStream_Impl::DataStream_Impl() {
133 DataStream_Impl::~DataStream_Impl() {
134 beginService( "DataStream_Impl::~DataStream_Impl" );
135 endService( "DataStream_Impl::~DataStream_Impl" );
138 void DataStream_Impl::StreamSetxy( const long x , const long y ) {
143 void DataStream_Impl::StreamGetxy( long & x , long & y ) {
148 void DataStream_Impl::StreamAdd( const long x , const long y , long & z ) {
151 void DataStream_Impl::StreamSub( const long x , const long y , long & z ) {
154 void DataStream_Impl::StreamMul( const long x , const long y , long & z ) {
157 void DataStream_Impl::StreamDiv( const long x , const long y , long & z ) {