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
35 #include "TypesCheck_Impl.hxx"
37 TypesCheck_Impl::TypesCheck_Impl( CORBA::ORB_ptr orb ,
38 PortableServer::POA_ptr poa ,
39 PortableServer::ObjectId * contId ,
40 const char *instanceName ,
41 const char *interfaceName ,
42 const bool kactivate ) :
43 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
44 MESSAGE("TypesCheck_Impl::TypesCheck_Impl this " << hex << this << dec
45 << "activate object instanceName("
46 << instanceName << ") interfaceName(" << interfaceName << ")" )
49 _id = _poa->activate_object(_thisObj);
53 TypesCheck_Impl::TypesCheck_Impl() {
54 beginService( "TypesCheck_Impl::TypesCheck_Impl" );
55 endService( "TypesCheck_Impl::TypesCheck_Impl" );
58 TypesCheck_Impl::~TypesCheck_Impl() {
59 beginService( "TypesCheck_Impl::~TypesCheck_Impl" );
60 endService( "TypesCheck_Impl::~TypesCheck_Impl" );
63 void TypesCheck_Impl::StringCheck( const char * InString , _CORBA_String_out OutString ) {
64 beginService( "TypesCheck_Impl::StringCheck" );
65 OutString = CORBA::string_dup( InString ) ;
66 endService( "TypesCheck_Impl::StringCheck" );
69 void TypesCheck_Impl::BoolCheck( const bool InBool , bool & OutBool ) {
70 beginService( "TypesCheck_Impl::BoolCheck" );
72 endService( "TypesCheck_Impl::BoolCheck" );
75 void TypesCheck_Impl::CharCheck( const unsigned char InChar , unsigned char & OutChar ) {
76 beginService( "TypesCheck_Impl::CharCheck" );
78 endService( "TypesCheck_Impl::CharCheck" );
81 void TypesCheck_Impl::ShortCheck( const short InShort , short & OutShort ) {
82 beginService( "TypesCheck_Impl::ShortCheck" );
84 endService( "TypesCheck_Impl::ShortCheck" );
87 void TypesCheck_Impl::IntCheck( const int InInt , int & OutInt ) {
88 beginService( "TypesCheck_Impl::IntCheck" );
90 endService( "TypesCheck_Impl::IntCheck" );
93 void TypesCheck_Impl::LongCheck( const long InLong , long & OutLong ) {
94 beginService( "TypesCheck_Impl::LongCheck" );
96 int outInt = OutLong ;
97 IntCheck( inInt , outInt ) ;
99 endService( "TypesCheck_Impl::LongCheck" );
102 void TypesCheck_Impl::FloatCheck( const float InFloat , float & OutFloat ) {
103 beginService( "TypesCheck_Impl::FloatCheck" );
105 endService( "TypesCheck_Impl::FloatCheck" );
108 void TypesCheck_Impl::DoubleCheck( const double InDouble , double & OutDouble ) {
109 beginService( "TypesCheck_Impl::DoubleCheck" );
110 OutDouble = InDouble ;
111 endService( "TypesCheck_Impl::DoubleCheck" );
114 void TypesCheck_Impl::ObjRefCheck( const SuperVisionTest::Adder_ptr InObjRef , SuperVisionTest::Adder_out OutObjRef ) {
115 beginService( "TypesCheck_Impl::ObjRefCheck" );
116 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
117 endService( "TypesCheck_Impl::ObjRefCheck" );
120 void TypesCheck_Impl::MiscTypes( const char * InString , const bool InBool , const unsigned char InChar , const short InShort , const long InLong , const float InFloat , const double InDouble , const SuperVisionTest::Adder_ptr InObjRef , _CORBA_String_out OutString ,bool & OutBool , unsigned char & OutChar , short & OutShort , long & OutLong , float & OutFloat , double & OutDouble , SuperVisionTest::Adder_out OutObjRef ) {
121 beginService( "TypesCheck_Impl::MiscTypes" );
122 OutString = CORBA::string_dup( InString ) ;
128 OutDouble = InDouble ;
129 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
130 endService( "TypesCheck_Impl::MiscTypes" );
135 PortableServer::ObjectId * TypesCheckEngine_factory( CORBA::ORB_ptr orb ,
136 PortableServer::POA_ptr poa ,
137 PortableServer::ObjectId * contId ,
138 const char *instanceName ,
139 const char *interfaceName ) {
140 MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
141 << instanceName << "," << interfaceName << "," << getpid() << ")");
142 TypesCheck_Impl * myTypesCheck = new TypesCheck_Impl(orb, poa, contId, instanceName, interfaceName);
143 return myTypesCheck->getId() ;