summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Concurrency/NS_client.h
blob: 6c6407511e883fafc0fe2460b44d60665cd54516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/tests
//
// = FILENAME
//    NS_client.h
//
// = DESCRIPTION
//      This class tests the facilities to connect to the naming
//      service and to resolve the name for the concurrency service client.
//
// = AUTHORS
//      Sergio Flores-Gaitan <sergio@cs.wustl.edu>
//      Torben Worm <tworm@cs.wustl.edu>
//
// ============================================================================

#include "ace/Get_Opt.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/corba.h"
#include "orbsvcs/orbsvcs/CosNamingC.h"

class CosNaming_Client
{
  // = TITLE
  //    Defines a class that encapsulates behaviour of the CosNaming
  //    client example.  Provides a better understanding of the logic
  //    in an object oriented way.
  //
  // = DESCRIPTION
  //    This class declares an interface to run the example client for
  //    CosNaming CORBA server.  All the complexity for initializing
  //    the server is hidden in the class.  Just the run() interface
  //    is needed.
public:
  // = Initialization and termination methods.
  CosNaming_Client (void);
  // Constructor.

  ~CosNaming_Client (void);
  // Destructor.

  int run (void);
  // Execute client example code.

  int init (int argc, char **argv);
  // Initialize the client communication endpoint with server.

private:
  int parse_args (void);
  // Parses the arguments passed on the command line.

  int resolve_name(char *c, char *n);
  // Resolves the name given on the command-line (-n option).

  void list_contents(void);
  // Lists the contents of the naming service.

  CORBA::ORB_var orb_;
  // Our ORB.

  TAO_Naming_Client my_name_client_;
  // And our Naming Client!

  int list_contents_;
  // Iterate through the naming service and list the contents.

  int resolve_name_;
  // Flag set by the -n option.

  char *name_to_resolve_;
  // Parameter given to the -n option.

  char *context_to_resolve_;
  // Parameter given to the -c option.

  int argc_;
  // # of arguments on the command line.

  char **argv_;
  // arguments from command line.

  int exit_later_;
  // Flag to tell server to not exit immediately.
};