Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / AMI / ami_test_i.cpp
blobae02f995243b290b19acbc875d63bf1f463eab00
2 //=============================================================================
3 /**
4 * @file ami_test_i.cpp
6 * Implementation of the AMI Test interface.
8 * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
9 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
11 //=============================================================================
13 #include "ami_test_i.h"
14 #include "tao/debug.h"
16 AMI_Test_i::AMI_Test_i (CORBA::ORB_ptr orb,
17 CORBA::Long in_l,
18 const char * in_str,
19 bool check_params)
20 : orb_ (CORBA::ORB::_duplicate (orb)),
21 yadda_ ((CORBA::Long) 140474),
22 in_l_ (in_l),
23 in_str_(CORBA::string_dup(in_str)),
24 check_params_(check_params)
28 CORBA::Long
29 AMI_Test_i::foo (CORBA::Long_out out_l,
30 CORBA::Long in_l,
31 const char* in_str)
33 out_l = 931233;
35 //if (TAO_debug_level > 0)
36 ACE_DEBUG ((LM_DEBUG,
37 "%N:%l:(%P:%t):AMI_Test_i::foo: %d %C\n",
38 in_l,
39 in_str));
41 if (in_l == 0)
43 ACE_DEBUG ((LM_DEBUG,
44 "Throwing Exception: A::DidTheRightThing\n"));
45 throw A::DidTheRightThing(42, "Hello world");
48 if (check_params_)
50 if (in_l_ != in_l || ACE_OS::strcmp(in_str_.in (), in_str) != 0)
52 ACE_ERROR ((LM_ERROR,
53 "ERROR: Parameter corruption on in parameters: %d %d %C %C.\n",
54 in_l_, in_l, in_str_.in (), in_str));
55 return 0;
59 return 931234;
62 void
63 AMI_Test_i::shutdown ()
65 this->orb_->shutdown (false);
68 CORBA::Long
69 AMI_Test_i::yadda ()
71 ACE_DEBUG ((LM_DEBUG,
72 "%N:%l:(%P:%t):AMI_Test_i::(get_)yadda\n"));
73 return yadda_;
76 void
77 AMI_Test_i::yadda (CORBA::Long yadda)
79 ACE_DEBUG ((LM_DEBUG,
80 "%N:%l:(%P:%t):AMI_Test_i::(set_)yadda\n"));
81 yadda_ = yadda;
84 void
85 AMI_Test_i::inout_arg_test (char *&)
87 // No action, this operation is to test code generation for INOUT
88 // args in AMI operations.