1 // SuperVisionTest SyrComponent : example of component performing some mathinatical operations
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 : TypesCheck_Impl.cxx
25 // Author : Jean Rahuel
26 // Module : SuperVisionTest
34 #include "TypesCheck_Impl.hxx"
38 TypesCheck_Impl::TypesCheck_Impl( CORBA::ORB_ptr orb ,
39 PortableServer::POA_ptr poa ,
40 PortableServer::ObjectId * contId ,
41 const char *instanceName ,
42 const char *interfaceName ,
43 const bool kactivate ) :
44 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
45 MESSAGE("TypesCheck_Impl::TypesCheck_Impl this " << hex << this << dec
46 << "activate object instanceName("
47 << instanceName << ") interfaceName(" << interfaceName << ")" )
50 _id = _poa->activate_object(_thisObj);
54 TypesCheck_Impl::TypesCheck_Impl() {
55 beginService( "TypesCheck_Impl::TypesCheck_Impl" );
56 endService( "TypesCheck_Impl::TypesCheck_Impl" );
59 TypesCheck_Impl::~TypesCheck_Impl() {
60 beginService( "TypesCheck_Impl::~TypesCheck_Impl" );
61 endService( "TypesCheck_Impl::~TypesCheck_Impl" );
64 void TypesCheck_Impl::StringCheck( const char * InString , _CORBA_String_out OutString ) {
65 beginService( "TypesCheck_Impl::StringCheck" );
66 OutString = CORBA::string_dup( InString ) ;
67 endService( "TypesCheck_Impl::StringCheck" );
70 void TypesCheck_Impl::BoolCheck( bool InBool , bool & OutBool ) {
71 beginService( "TypesCheck_Impl::BoolCheck" );
73 endService( "TypesCheck_Impl::BoolCheck" );
76 void TypesCheck_Impl::CharCheck( unsigned char InChar , unsigned char & OutChar ) {
77 beginService( "TypesCheck_Impl::CharCheck" );
79 endService( "TypesCheck_Impl::CharCheck" );
82 void TypesCheck_Impl::ShortCheck( short InShort , short & OutShort ) {
83 beginService( "TypesCheck_Impl::ShortCheck" );
85 endService( "TypesCheck_Impl::ShortCheck" );
88 void TypesCheck_Impl::IntCheck( int InInt , int & OutInt ) {
89 beginService( "TypesCheck_Impl::IntCheck" );
91 endService( "TypesCheck_Impl::IntCheck" );
94 void TypesCheck_Impl::LongCheck( CORBA::Long InLong , CORBA::Long & OutLong ) {
95 beginService( "TypesCheck_Impl::LongCheck" );
97 int outInt = OutLong ;
98 IntCheck( inInt , outInt ) ;
100 endService( "TypesCheck_Impl::LongCheck" );
103 void TypesCheck_Impl::FloatCheck( float InFloat , float & OutFloat ) {
104 beginService( "TypesCheck_Impl::FloatCheck" );
106 endService( "TypesCheck_Impl::FloatCheck" );
109 void TypesCheck_Impl::DoubleCheck( double InDouble , double & OutDouble ) {
110 beginService( "TypesCheck_Impl::DoubleCheck" );
111 OutDouble = InDouble ;
112 endService( "TypesCheck_Impl::DoubleCheck" );
115 void TypesCheck_Impl::ObjRefCheck( SuperVisionTest::Adder_ptr InObjRef , SuperVisionTest::Adder_out OutObjRef ) {
116 beginService( "TypesCheck_Impl::ObjRefCheck" );
117 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
118 endService( "TypesCheck_Impl::ObjRefCheck" );
121 void TypesCheck_Impl::MiscTypes( const char * InString , bool InBool , unsigned char InChar , short InShort , CORBA::Long InLong , float InFloat , double InDouble , SuperVisionTest::Adder_ptr InObjRef , _CORBA_String_out OutString ,bool & OutBool , unsigned char & OutChar , short & OutShort , CORBA::Long & OutLong , float & OutFloat , double & OutDouble , SuperVisionTest::Adder_out OutObjRef ) {
122 beginService( "TypesCheck_Impl::MiscTypes" );
123 OutString = CORBA::string_dup( InString ) ;
129 OutDouble = InDouble ;
130 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
131 endService( "TypesCheck_Impl::MiscTypes" );
136 PortableServer::ObjectId * TypesCheckEngine_factory( CORBA::ORB_ptr orb ,
137 PortableServer::POA_ptr poa ,
138 PortableServer::ObjectId * contId ,
139 const char *instanceName ,
140 const char *interfaceName ) {
141 MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
142 << instanceName << "," << interfaceName << "," << getpid() << ")");
143 TypesCheck_Impl * myTypesCheck = new TypesCheck_Impl(orb, poa, contId, instanceName, interfaceName);
144 return myTypesCheck->getId() ;