summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h
blob: 4f85922775b2b04aeb6da00739edc0c78357d939 (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/Naming_Service
//
// = FILENAME
//    Naming_Utils.h
//
// = DESCRIPTION
//      This class implements a Naming Server wrapper class which holds
//      a Naming Context for TAO NameService.
//
// = AUTHORS
//    Nagarajan Surendran (naga@cs.wustl.edu)
//
// ============================================================================

#if !defined (_NAMING_SERVER_H)
#define _NAMING_SERVER_H

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

class TAO_ORBSVCS_Export TAO_Naming_Server
{
  // = TITLE
  //    Defines a wrapper class which holds a Naming Context
  //    implementation for TAO "NamingService" naming context.
  //
  // = DESCRIPTION
  //    This class takes an orb and Poa reference and activates the
  //    NamingService naming context object under that. It also
  //    defines the operator -> so that NamingContext functions like
  //    bind, unbind .. can be called on a NameServer object.
public:
  TAO_Naming_Server (void);
  //Default constructor.

  TAO_Naming_Server (CORBA::ORB_var &orb,
                     PortableServer::POA_var &root_poa);
  // Takes the POA under which to register the Naming Service
  // implementation object.

  int init (CORBA::ORB_var &orb,
            PortableServer::POA_var &root_poa);
  // Initialize the name server under the given ORB and POA.

  NS_NamingContext &GetNamingContext (void);
  // Returns the "NameService" NamingContext implementation object
  // reference.

  CORBA::String naming_service_ior (void);
  // Returns the ior of the naming service.

  CosNaming::NamingContext *operator -> (void) const;
  // Returns a NamingContext_ptr.

  ~TAO_Naming_Server (void);
  // Destructor.

private:
  NS_NamingContext naming_context_impl_;
  // Naming context implemetation for "NameService".

  CosNaming::NamingContext_ptr naming_context_ptr_;
  // NamingContext ptr.

  TAO_IOR_Multicast *ior_multicast_;
  // The ior_multicast event handler.

  CORBA::String_var naming_service_ior_;
  // The IOR string of the naming service.
};

#endif /* _NAMING_SERVER_H */