summaryrefslogtreecommitdiff
path: root/TAO/tao/Connector_Registry.h
blob: 19bd5ea2e1e677a0c771628cf36b75903b023379 (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
94
95
96
97
98
99
100
101
102
103
104
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Connector_Registry.h
 *
 *  Interface for the TAO Connector Registry
 *
 *  @author  Fred Kuhns <fredk@cs.wustl.edu>
 */
//=============================================================================

#ifndef TAO_CONNECTOR_REGISTRY_H
#define TAO_CONNECTOR_REGISTRY_H
#include /**/ "ace/pre.h"

#include /**/ "tao/TAO_Export.h"

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

#include "tao/Basic_Types.h"
#include "ace/Global_Macros.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Forward declarations.
class TAO_ORB_Core;
class TAO_Connector;
class TAO_MProfile;
class TAO_Profile;
class TAO_InputCDR;

typedef TAO_Connector** TAO_ConnectorSetIterator;

/**
 * @class TAO_Connector_Registry
 *
 * @brief Per-ORB TAO Connector Registry
 *
 * Connector Registry and Generic Connector interface definitions.
 * All loaded ESIOP or GIOP connector bridges must register with
 * this object.
 * This class is able to dynamically load a set of
 * concrete protocol connectors which have registered with the service
 * configurator and added their Factory name to the Resource_Factory
 * line of the svc.conf file.
 */
class TAO_Export TAO_Connector_Registry
{
public:
  ///  Default constructor.
  TAO_Connector_Registry ();

  ///  Default destructor.
  ~TAO_Connector_Registry ();

  /// Return the connector bridges
  TAO_Connector *get_connector (CORBA::ULong tag) const;

  /// Initialize all registered connectors.
  int open (TAO_ORB_Core *orb_core);

  /// Close all open connectors.
  int close_all ();

  /// Parse a string containing a URL style IOR and return an
  /// MProfile.
  int make_mprofile (const char *ior, TAO_MProfile &mprofile);

  /// Create a profile based on the contents of @a cdr
  TAO_Profile* create_profile (TAO_InputCDR& cdr);

  /// Obtain the object key delimiter used by the protocol specified in
  /// the provided URL style IOR.
  char object_key_delimiter (const char *ior);

  // = Iterator.
  TAO_ConnectorSetIterator begin () const;
  TAO_ConnectorSetIterator end () const;

private:
  TAO_Connector_Registry (const TAO_Connector_Registry&) = delete;
  void operator= (const TAO_Connector_Registry&) = delete;
  TAO_Connector_Registry (TAO_Connector_Registry&&) = delete;
  void operator= (TAO_Connector_Registry&&) = delete;

private:
  /// List of connectors that are currently open.
  TAO_Connector** connectors_;

  /// Number of connectors that are currently open.
  size_t size_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined(__ACE_INLINE__)
#include "tao/Connector_Registry.inl"
#endif /* __ACE_INLINE__ */

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