summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/Naming_Service/Naming_Service.h
blob: dfcf77754ce624974d3bca79d61d6266c4b3560c (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
// -*- C++ -*-

//==========================================================================
/**
 *  @file    Naming_Service.h
 *
 *    This class implements the functionality of a Naming_Service in
 *    a stand-alone process.
 *
 *  @author Nagarajan Surendran (naga@cs.wustl.edu) Marina Spivak <marina@cs.wustl.edu>
 */
//==========================================================================


#ifndef TAO_NAMING_SERVICE_H
#define TAO_NAMING_SERVICE_H

#include /**/ "ace/pre.h"
#include "tao/ORB.h"

#include "orbsvcs/Naming/Naming_Server.h"

/**
 * @class TAO_Naming_Service
 *
 * @brief Defines a class that encapsulates the implementation of the
 * COS Naming Service.
 *
 * This class makes use of the <TAO_Naming_Server>
 * to implement the COS Naming Service.
 */
class TAO_Naming_Service
{
public:
  /// Default Constructor.
  TAO_Naming_Service (void);

  /// Constructor taking the command-line arguments.
  TAO_Naming_Service (int argc, ACE_TCHAR* argv[]);

  /// Initialize the Naming Service with the arguments.
  virtual int init (int argc, ACE_TCHAR* argv[]);

  /// The opposite of init().
  virtual int fini ();

  /// Run the TAO_Naming_Service.
  virtual int run (void);

  /// Shut down the TAO_Naming_Service; you must still call fini().
  virtual void shutdown (void);

  /// Destructor.
  virtual ~TAO_Naming_Service (void);

protected:

  /// Parse the command line arguments to find
  /// the timeout period.
  int parse_args (int &argc, ACE_TCHAR* argv[]);

  /// The ORB.
  CORBA::ORB_var orb_;

  /// Naming Server instance.
  TAO_Naming_Server my_naming_server_;

  /// After how long the server should stop listening to requests (in
  /// seconds).
  long time_;

  /// Number of threads for running the ORB. Default is 1
  int num_threads_;
};

#include /**/ "ace/post.h"

#endif /* TAO_NAMING_SERVICE_H */