00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_ORB_TABLE_H
00016 #define TAO_ORB_TABLE_H
00017
00018 #include "ace/pre.h"
00019
00020 #include "tao/TAO_Export.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "tao/orbconf.h"
00027 #include "tao/CORBA_String.h"
00028
00029 #include "ace/Array_Map.h"
00030 #include "ace/Thread_Mutex.h"
00031
00032
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034
00035
00036 class TAO_ORB_Core;
00037
00038 namespace TAO
00039 {
00040 class ORB_Core_Ref_Counter;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class TAO_Export ORB_Table
00064 {
00065 public:
00066
00067
00068
00069
00070
00071
00072 ORB_Table (void);
00073
00074 typedef ACE_Array_Map<CORBA::String_var,
00075 ORB_Core_Ref_Counter,
00076 TAO::String_Var_Equal_To> Table;
00077 typedef Table::key_type key_type;
00078 typedef Table::data_type data_type;
00079 typedef Table::value_type value_type;
00080 typedef Table::size_type size_type;
00081 typedef Table::iterator iterator;
00082
00083
00084
00085
00086
00087 iterator begin (void);
00088 iterator end (void);
00089 int bind (const char *orb_id, ::TAO_ORB_Core *orb_core);
00090
00091
00092
00093
00094
00095
00096
00097 ::TAO_ORB_Core* find (const char *orb_id);
00098
00099 int unbind (const char *orb_id);
00100
00101
00102
00103
00104 ::TAO_ORB_Core * first_orb (void);
00105
00106
00107 static ORB_Table * instance (void);
00108
00109
00110
00111 void set_default (char const * orb_id);
00112
00113
00114
00115 void not_default (char const * orb_id);
00116
00117
00118 Table * table (void);
00119
00120
00121 TAO_SYNCH_MUTEX & lock (void);
00122
00123 private:
00124
00125
00126 ORB_Table (const ORB_Table &);
00127 void operator= (const ORB_Table &);
00128
00129
00130
00131 ::TAO_ORB_Core * find_i (char const * orb_id);
00132
00133 private:
00134
00135
00136 ::TAO_SYNCH_MUTEX lock_;
00137
00138
00139
00140 bool first_orb_not_default_;
00141
00142
00143 Table table_;
00144
00145
00146 ::TAO_ORB_Core * first_orb_;
00147 };
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 class ORB_Core_Ref_Counter
00159 {
00160 public:
00161
00162
00163 ORB_Core_Ref_Counter (void);
00164
00165
00166 ORB_Core_Ref_Counter (::TAO_ORB_Core * core);
00167
00168
00169 ~ORB_Core_Ref_Counter (void);
00170
00171
00172 ORB_Core_Ref_Counter (ORB_Core_Ref_Counter const & rhs);
00173
00174
00175 void operator= (ORB_Core_Ref_Counter const & rhs);
00176
00177
00178 ::TAO_ORB_Core * core (void) const { return this->core_; }
00179
00180 private:
00181 ::TAO_ORB_Core * core_;
00182 };
00183
00184 }
00185
00186 TAO_END_VERSIONED_NAMESPACE_DECL
00187
00188 #if defined (__ACE_INLINE__)
00189 # include "tao/ORB_Table.inl"
00190 #endif
00191
00192 #include "ace/post.h"
00193
00194 #endif