~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/examples/Load_Balancing_persistent/Identity_Server.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Identity_Server.h,v 1.4 2002/01/29 20:20:40 okellogg Exp
2
 
// -*- C++ -*-
3
 
 
4
 
// ============================================================================
5
 
//
6
 
// = LIBRARY
7
 
//    TAO/examples/Load_Balancing
8
 
//
9
 
// = FILENAME
10
 
//    Identity_Server.h
11
 
//
12
 
// = DESCRIPTION
13
 
//    Driver for identity server, which is used to test/demonstrate
14
 
//    the functionality of the Load Balancing service.
15
 
//
16
 
// = AUTHORS
17
 
//    Marina Spivak <marina@cs.wustl.edu>
18
 
//    with modifications by Bala Natarajan <bala@cs.wustl.edu>
19
 
// ============================================================================
20
 
 
21
 
#ifndef IDENTITY_SERVER_H_
22
 
#define IDENTITY_SERVER_H_
23
 
 
24
 
#include "tao/PortableServer/ORB_Manager.h"
25
 
#include "Load_BalancerC.h"
26
 
 
27
 
#if !defined (ACE_LACKS_PRAGMA_ONCE)
28
 
# pragma once
29
 
#endif /* ACE_LACKS_PRAGMA_ONCE */
30
 
 
31
 
class Identity_Server
32
 
{
33
 
  // =TITLE
34
 
  //   Contacts the <Object_Group_Factory> in the Load Balancing Server
35
 
  //   to create two <Object_Group>s, one round robin and one random.
36
 
  //   Then, creates a number of <Identity> objects and registers them with
37
 
  //   the created <Object_Group>s in a manner specified by the
38
 
  //   commandline arguments.
39
 
  //
40
 
public:
41
 
 
42
 
  Identity_Server (void);
43
 
  // Default constructor.
44
 
 
45
 
  ~Identity_Server (void);
46
 
  // Destructor.
47
 
 
48
 
  int parse_args (int argc, char *argv[]);
49
 
  // Parses the commandline arguments.
50
 
 
51
 
  int init (int argc, char *argv[]);
52
 
  // Performs all the initializations necessary before going into the
53
 
  // ORB event loop.
54
 
 
55
 
  int register_groups (ACE_ENV_SINGLE_ARG_DECL);
56
 
 
57
 
 
58
 
  int run (ACE_ENV_SINGLE_ARG_DECL);
59
 
  // Run the server.
60
 
 
61
 
private:
62
 
 
63
 
 
64
 
  void create_objects (size_t number_of_objects,
65
 
                       Load_Balancer::Object_Group_ptr group
66
 
                       ACE_ENV_ARG_DECL);
67
 
  // Creates the specified number of identity objects, and registers
68
 
  // each one with the provided <Object_Group>.  Identity servants are
69
 
  // given names
70
 
  //"Identity object 1" .... "Identity object <number_of_objects>".
71
 
 
72
 
 
73
 
  TAO_ORB_Manager orb_manager_;
74
 
  // The ORB manager.
75
 
 
76
 
  const char *group_factory_ior_;
77
 
  // The ior of the <Object_Group_Factory> object we shall use to
78
 
  // create <Object_Group>s to load balance our <Identity> objects.
79
 
 
80
 
  size_t random_objects_;
81
 
  // Number of <Identity> objects to create for registering with
82
 
  // the random <Object_Group>.  The default value is 5.
83
 
 
84
 
  size_t rr_objects_;
85
 
  // Number of <Identity> objects to create for registering with the
86
 
  // round robin <Object_Group>.  The default value is 5.
87
 
 
88
 
  PortableServer::POA_var persistent_POA_;
89
 
};
90
 
 
91
 
#endif /* IDENTITY_SERVER_H_ */