Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_Naming / Load_Balancing / LB_server.h
blob046cf5c9d8de031339c955a0afb3adf134ee04f1
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file LB_server.h
7 * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
8 * @author Ossama Othman <ossama@uci.edu>
9 */
10 //=============================================================================
13 #include "orbsvcs/FT_NamingManagerC.h"
14 #include "orbsvcs/PortableGroupC.h"
15 #include "tao/PortableServer/PortableServer.h"
16 #include "ace/Get_Opt.h"
17 #include "orbsvcs/Naming/Naming_Client.h"
19 // Forward Declaration of the kind of servant we would like to handle
20 // by the server.
21 class Basic;
23 /**
24 * @class LB_server
26 * @brief Encapsulate the test in class.
28 * TODO: Fix description
29 * This is a class used to retrieve the NamingManager reference and
30 * create the Object Group. Servants add themselves to the object
31 * group and the object group reference is published to the clients.
32 * Clients then invoke the "servant operations" on the NamingManager
33 * itself. At this point the Load Balancing cycle starts.
35 class LB_server
37 public:
38 /// Constructor
39 LB_server (int argc, ACE_TCHAR **argv);
41 /// destroys NamingManager, ORB and POA.
42 int destroy ();
44 /// start the ORB.
45 int start_orb_and_poa ();
47 /// Get the NamingManager Interface.
48 int init (int argc, ACE_TCHAR **argv);
50 /// Create the Object Group using the Load Manager Reference.
51 int create_object_group ();
53 /// register the servants with the object group.
54 int register_servant (Basic *servant, const char *loc);
56 /// obtain the name service facade
57 TAO_Naming_Client& name_svc ();
59 /// for servants to register to the initialised ORB.
60 CORBA::ORB_ptr orb ();
62 /// for servants to get the reference for object_group.
63 CORBA::Object_ptr object_group ();
65 /// for servants to get the reference for object_group.
66 FT_Naming::NamingManager_ptr naming_manager ();
68 private:
69 int parse_args (int, ACE_TCHAR **);
71 private:
72 /// Load Manager
73 FT_Naming::NamingManager_var naming_manager_;
75 /// Object Group.
76 CORBA::Object_var object_group_;
78 /// factory id for the object group.
79 PortableGroup::GenericFactory::FactoryCreationId_var fcid_;
81 /// Used to force the creation of the object group only once.
82 static int called_once_;
84 /// write the IOR to a file so that it can be read later.
85 int write_ior_to_file (const char *);
87 CORBA::ORB_var orb_;
88 int argc_;
89 ACE_TCHAR **argv_;
90 PortableServer::POA_var root_poa_;
91 const ACE_TCHAR *ior_output_file_;
92 TAO_Naming_Client name_svc_;