Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / Load_Balancing_persistent / Identity_Server.h
blob1ee2731d5073ee96df463134277c150330f2e5b6
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Identity_Server.h
7 * Driver for identity server, which is used to test/demonstrate
8 * the functionality of the Load Balancing service.
10 * @author Marina Spivak <marina@cs.wustl.edu> with modifications by Bala Natarajan <bala@cs.wustl.edu>
12 //=============================================================================
15 #ifndef IDENTITY_SERVER_H_
16 #define IDENTITY_SERVER_H_
18 #include "tao/Utils/ORB_Manager.h"
19 #include "Load_BalancerC.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 /**
26 * @class Identity_Server
27 =TITLE
28 * Contacts the <Object_Group_Factory> in the Load Balancing Server
29 * to create two <Object_Group>s, one round robin and one random.
30 * Then, creates a number of <Identity> objects and registers them with
31 * the created <Object_Group>s in a manner specified by the
32 * commandline arguments.
34 class Identity_Server
36 public:
37 /// Default constructor.
38 Identity_Server ();
40 /// Destructor.
41 ~Identity_Server ();
43 /// Parses the commandline arguments.
44 int parse_args (int argc, ACE_TCHAR *argv[]);
46 /// Performs all the initializations necessary before going into the
47 /// ORB event loop.
48 int init (int argc, ACE_TCHAR *argv[]);
50 int register_groups ();
53 /// Run the server.
54 int run ();
56 private:
57 /**
58 * Creates the specified number of identity objects, and registers
59 * each one with the provided <Object_Group>. Identity servants are
60 * given names
61 *"Identity object 1" .... "Identity object <number_of_objects>".
63 void create_objects (size_t number_of_objects,
64 Load_Balancer::Object_Group_ptr group);
67 /// The ORB manager.
68 TAO_ORB_Manager orb_manager_;
70 /// The ior of the <Object_Group_Factory> object we shall use to
71 /// create <Object_Group>s to load balance our <Identity> objects.
72 const ACE_TCHAR *group_factory_ior_;
74 /// Number of <Identity> objects to create for registering with
75 /// the random <Object_Group>. The default value is 5.
76 size_t random_objects_;
78 /// Number of <Identity> objects to create for registering with the
79 /// round robin <Object_Group>. The default value is 5.
80 size_t rr_objects_;
82 PortableServer::POA_var persistent_POA_;
85 #endif /* IDENTITY_SERVER_H_ */