1 // Copyright (C) 2007-2022 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 SyrComponent : example of component performing some mathinatical operations
24 // File : TypesCheck_Impl.cxx
25 // Author : Jean Rahuel
26 // Module : SuperVisionTest
38 #include "TypesCheck_Impl.hxx"
39 #include "COMPONENT_version.h"
43 TypesCheck_Impl::TypesCheck_Impl( CORBA::ORB_ptr orb ,
44 PortableServer::POA_ptr poa ,
45 PortableServer::ObjectId * contId ,
46 const char *instanceName ,
47 const char *interfaceName ,
48 const bool kactivate, bool withRegistry ) :
49 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,withRegistry) {
50 MESSAGE("TypesCheck_Impl::TypesCheck_Impl this " << hex << this << dec
51 << "activate object instanceName("
52 << instanceName << ") interfaceName(" << interfaceName << ")" );
55 _id = _poa->activate_object(_thisObj);
59 TypesCheck_Impl::TypesCheck_Impl() {
60 beginService( "TypesCheck_Impl::TypesCheck_Impl" );
61 endService( "TypesCheck_Impl::TypesCheck_Impl" );
64 TypesCheck_Impl::~TypesCheck_Impl() {
65 beginService( "TypesCheck_Impl::~TypesCheck_Impl" );
66 endService( "TypesCheck_Impl::~TypesCheck_Impl" );
69 char* TypesCheck_Impl::getVersion()
71 #if COMPONENT_DEVELOPMENT
72 return CORBA::string_dup(COMPONENT_VERSION_STR"dev");
74 return CORBA::string_dup(COMPONENT_VERSION_STR);
78 void TypesCheck_Impl::StringCheck( const char * InString , _CORBA_String_out OutString ) {
79 beginService( "TypesCheck_Impl::StringCheck" );
80 OutString = CORBA::string_dup( InString ) ;
81 endService( "TypesCheck_Impl::StringCheck" );
84 void TypesCheck_Impl::BoolCheck( bool InBool , bool & OutBool ) {
85 beginService( "TypesCheck_Impl::BoolCheck" );
87 endService( "TypesCheck_Impl::BoolCheck" );
90 void TypesCheck_Impl::CharCheck( unsigned char InChar , unsigned char & OutChar ) {
91 beginService( "TypesCheck_Impl::CharCheck" );
93 endService( "TypesCheck_Impl::CharCheck" );
96 void TypesCheck_Impl::ShortCheck( short InShort , short & OutShort ) {
97 beginService( "TypesCheck_Impl::ShortCheck" );
99 endService( "TypesCheck_Impl::ShortCheck" );
102 void TypesCheck_Impl::IntCheck( int InInt , int & OutInt ) {
103 beginService( "TypesCheck_Impl::IntCheck" );
105 endService( "TypesCheck_Impl::IntCheck" );
108 void TypesCheck_Impl::LongCheck( CORBA::Long InLong , CORBA::Long & OutLong ) {
109 beginService( "TypesCheck_Impl::LongCheck" );
111 int outInt = OutLong ;
112 IntCheck( inInt , outInt ) ;
114 endService( "TypesCheck_Impl::LongCheck" );
117 void TypesCheck_Impl::FloatCheck( float InFloat , float & OutFloat ) {
118 beginService( "TypesCheck_Impl::FloatCheck" );
120 endService( "TypesCheck_Impl::FloatCheck" );
123 void TypesCheck_Impl::DoubleCheck( double InDouble , double & OutDouble ) {
124 beginService( "TypesCheck_Impl::DoubleCheck" );
125 OutDouble = InDouble ;
126 endService( "TypesCheck_Impl::DoubleCheck" );
129 void TypesCheck_Impl::ObjRefCheck( SuperVisionTest::Adder_ptr InObjRef , SuperVisionTest::Adder_out OutObjRef ) {
130 beginService( "TypesCheck_Impl::ObjRefCheck" );
131 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
132 endService( "TypesCheck_Impl::ObjRefCheck" );
135 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 ) {
136 beginService( "TypesCheck_Impl::MiscTypes" );
137 OutString = CORBA::string_dup( InString ) ;
143 OutDouble = InDouble ;
144 OutObjRef = SuperVisionTest::Adder::_duplicate( InObjRef ) ;
145 endService( "TypesCheck_Impl::MiscTypes" );
150 PortableServer::ObjectId * TypesCheckEngine_factory( CORBA::ORB_ptr orb ,
151 PortableServer::POA_ptr poa ,
152 PortableServer::ObjectId * contId ,
153 const char *instanceName ,
154 const char *interfaceName ) {
156 MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
157 << instanceName << "," << interfaceName << "," << getpid()<< ")");
159 MESSAGE("TypesCheckEngine_factory TypesCheckEngine ("
160 << instanceName << "," << interfaceName << "," << _getpid()<< ")");
162 CORBA::Object_var o = poa->id_to_reference(*contId);
163 Engines::Container_var cont = Engines::Container::_narrow(o);
164 TypesCheck_Impl * myTypesCheck = nullptr;
165 if(cont->is_SSL_mode())
167 myTypesCheck = new TypesCheck_Impl_SSL(orb, poa, contId, instanceName, interfaceName);
171 myTypesCheck = new TypesCheck_Impl_No_SSL(orb, poa, contId, instanceName, interfaceName);
173 return myTypesCheck->getId() ;