Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / Load_Balancing / Identity_Server.h
bloba065ca77cc2da25034859c1cf137ab340b42c533
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>
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
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 /// Performs all the initializations necessary before going into the
44 /// ORB event loop.
45 int init (int argc, ACE_TCHAR *argv[]);
47 /// Run the server.
48 int run ();
50 private:
51 /// Parses the commandline arguments.
52 int parse_args (int argc, ACE_TCHAR *argv[]);
54 /**
55 * Creates the specified number of identity objects, and registers
56 * each one with the provided <Object_Group>. Identity servants are
57 * given names
58 *"Identity object 1" .... "Identity object <number_of_objects>".
60 void create_objects (size_t number_of_objects,
61 Load_Balancer::Object_Group_ptr group);
63 /// The ORB manager.
64 TAO_ORB_Manager orb_manager_;
66 /// The ior of the <Object_Group_Factory> object we shall use to
67 /// create <Object_Group>s to load balance our <Identity> objects.
68 const ACE_TCHAR *group_factory_ior_;
70 /// Number of <Identity> objects to create for registering with
71 /// the random <Object_Group>. The default value is 5.
72 size_t random_objects_;
74 /// Number of <Identity> objects to create for registering with the
75 /// round robin <Object_Group>. The default value is 5.
76 size_t rr_objects_;
79 #endif /* IDENTITY_SERVER_H_ */