summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_ORB.h
blob: f7ecb37ebed909a9bcb486af5dc7c60472592457 (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
// This may look like C, but it's really -*- C++ -*-
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    iiopobj.h
//
// = AUTHOR
//     Copyright 1994-1995 by Sun Microsystems Inc.
//
// ============================================================================

#ifndef TAO_IIOPORB_H
#define TAO_IIOPORB_H

#include "ace/INET_Addr.h"

#include "tao/ORB.h"
#include "tao/IOR_LookupTable.h"

// ORB pseudo-objref

class TAO_Export IIOP_ORB : public CORBA_ORB
{
  // = TITLE
  //    Bridge implementation of <IIOP_ORB>.
  //
  // = DESCRIPTION
  //   Just implement some IIOP aspects of the ORB. This will be
  //   removed as the pluggable protocols changes are propagated.
  //
public:
  IIOP_ORB (void);
  // constructor

  ~IIOP_ORB (void);
  // destructor

  CORBA::Object_ptr string_to_object (const char *str,
                                      CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ());
  // Get an object reference from the IOR string.

  CORBA::String object_to_string (CORBA::Object_ptr obj,
                                  CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ());
  // Convert an object reference to an IOR stringified form.

  int _tao_add_to_IOR_table (ACE_CString object_id, CORBA::Object_ptr obj);
  // Add a mapping ObjectID->IOR to the table.

  int _tao_find_in_IOR_table (ACE_CString object_id, CORBA::Object_ptr &obj);
  // Find the given ObjectID in the table.

  TAO_ServantBase *_get_collocated_servant (TAO_Stub *sobj);
  // Return the object pointer of an collocated object it there is
  // one, otherwise, return 0.

  // = ACCESSORS
  void _use_omg_ior_format (CORBA::Boolean ior);
  // Set the IOR flag.
  CORBA::Boolean _use_omg_ior_format (void);
  // Get the IOR flag.

  void _optimize_collocation_objects (CORBA::Boolean opt);
  // Set collocation optimization status.
  CORBA::Boolean _optimize_collocation_objects (void);
  // Get collocation optimization status.

private:
  CORBA::Object_ptr file_string_to_object (const char* filename,
                                           CORBA::Environment& env);
  // Read an IOR from a file and then parse it, returning the object
  // reference.

private:
  CORBA::Boolean use_omg_ior_format_;
  // Decides whether to use the URL notation or to use IOR notation.

  CORBA::Boolean optimize_collocation_objects_;
  // Decides whether to use the URL notation or to use IOR notation.

  ACE_Unbounded_Set<ACE_INET_Addr> collocation_record_;

  TAO_IOR_LookupTable lookup_table_;
  // Table of ObjectID->IOR mappings.
  
  // = These are not provided.
  IIOP_ORB (const IIOP_ORB &);
  IIOP_ORB &operator = (const IIOP_ORB &);
};

typedef IIOP_ORB *IIOP_ORB_ptr;

#if defined (__ACE_INLINE__)
# include "tao/IIOP_ORB.i"
#endif /* __ACE_INLINE__ */

#endif  /* TAO_IIOPORB_H */