1 #include "ace/Get_Opt.h"
2 #include "Multiple_Inheritance_i.h"
3 #include "tao/Utils/ORB_Manager.h"
4 #include "ace/OS_NS_stdio.h"
5 #include "ace/OS_NS_string.h"
7 static ACE_TCHAR
*ior_output_file
= 0;
9 Multiple_Inheritance_i::Multiple_Inheritance_i ()
11 // Sun/CC 5.0 crashes if there is no explicit default
13 // Default constructor, do nothin..
17 parse_args (int argc
, ACE_TCHAR
**argv
)
19 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("f:"));
22 while ((c
= get_opts ()) != -1)
26 ior_output_file
= ACE_OS::strdup (get_opts
.opt_arg ());
30 ACE_ERROR_RETURN ((LM_ERROR
,
37 // Indicates successful parsing of the command line
43 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
45 Multiple_Inheritance_i servant
;
46 TAO_ORB_Manager orb_manager
;
48 ACE_DEBUG ((LM_DEBUG
, "\n\tMultiple Inheritance Server\n\n"));
51 orb_manager
.init_child_poa (argc
,
55 if (parse_args (argc
, argv
) != 0)
58 CORBA::String_var ior
=
59 orb_manager
.activate_under_child_poa ("my_object",
62 ACE_DEBUG ((LM_DEBUG
, "%C\n",
65 // If the ior_output_file exists, output the ior to it
66 if (ior_output_file
!= 0)
68 FILE *output_file
= ACE_OS::fopen (ior_output_file
, "w");
70 ACE_ERROR_RETURN ((LM_ERROR
,
71 "Cannot open output file for writing IOR: %s",
74 ACE_OS::fprintf (output_file
, "%s", ior
.in ());
75 ACE_OS::fclose (output_file
);
80 catch (const CORBA::SystemException
& sysex
)
82 sysex
._tao_print_exception ("System Exception");