Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef TAO_ORB_H
00018 #define TAO_ORB_H
00019
00020 #include "ace/pre.h"
00021
00022 #include "tao/UserException.h"
00023
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif
00027
00028 #include "tao/orb_typesC.h"
00029 #include "tao/objectid.h"
00030 #include "tao/CORBA_methods.h"
00031 #include "tao/VarOut_T.h"
00032 #include "tao/Pseudo_VarOut_T.h"
00033 #include "tao/Seq_Var_T.h"
00034 #include "tao/Seq_Out_T.h"
00035 #include "tao/Sequence_T.h"
00036 #include "tao/Policy_ForwardC.h"
00037 #include "tao/ServicesC.h"
00038
00039 #include "ace/Thread_Mutex.h"
00040 #include "ace/Guard_T.h"
00041 #include "ace/Atomic_Op.h"
00042
00043 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00044
00045 typedef enum
00046 {
00047 TAO_SERVICEID_NAMESERVICE,
00048 TAO_SERVICEID_TRADINGSERVICE,
00049 TAO_SERVICEID_IMPLREPOSERVICE,
00050 TAO_SERVICEID_INTERFACEREPOSERVICE,
00051 TAO_SERVICEID_MCASTSERVER
00052 } TAO_Service_ID;
00053
00054
00055 class TAO_MProfile;
00056 class TAO_Client_Strategy_Factory;
00057 class TAO_Server_Strategy_Factory;
00058 class TAO_InputCDR;
00059 class TAO_OutputCDR;
00060 class TAO_Stub;
00061 class TAO_Valuetype_Adapter;
00062 class TAO_Acceptor_Filter;
00063 class TAO_ORB_Core;
00064
00065
00066
00067 namespace CORBA
00068 {
00069 class EnumMemberSeq;
00070 class StructMemberSeq;
00071 class UnionMemberSeq;
00072 class ValueMemberSeq;
00073 class ORB_ObjectIdList;
00074
00075 class ExceptionList;
00076 typedef ExceptionList * ExceptionList_ptr;
00077
00078 class ContextList;
00079 typedef ContextList * ContextList_ptr;
00080
00081 class Context;
00082 typedef Context * Context_ptr;
00083
00084 class NVList;
00085 typedef NVList *NVList_ptr;
00086
00087 class NamedValue;
00088 typedef NamedValue *NamedValue_ptr;
00089
00090 class Policy;
00091 typedef Policy *Policy_ptr;
00092
00093 typedef CORBA::ULong PolicyType;
00094
00095
00096
00097 typedef
00098 TAO_VarSeq_Var_T<
00099 ORB_ObjectIdList
00100 >
00101 ORB_ObjectIdList_var;
00102
00103 typedef
00104 TAO_Seq_Out_T<
00105 ORB_ObjectIdList
00106 >
00107 ORB_ObjectIdList_out;
00108
00109 class ValueFactoryBase;
00110 typedef ValueFactoryBase *ValueFactory;
00111
00112 typedef UShort ServiceType;
00113
00114 class Request;
00115 typedef Request * Request_ptr;
00116 typedef TAO_Pseudo_Var_T<Request> Request_var;
00117 typedef TAO_Pseudo_Out_T<Request> Request_out;
00118
00119 class ORB;
00120 typedef ORB * ORB_ptr;
00121 typedef TAO_Pseudo_Var_T<ORB> ORB_var;
00122 typedef TAO_Pseudo_Out_T<ORB> ORB_out;
00123
00124 typedef CORBA::Short ValueModifier;
00125
00126 #if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00127
00128
00129
00130
00131 typedef
00132 TAO::unbounded_object_reference_sequence<
00133 CORBA::Request, CORBA::Request_var
00134 >
00135 RequestSeq;
00136
00137 typedef
00138 TAO_VarSeq_Var_T<
00139 RequestSeq
00140 >
00141 RequestSeq_var;
00142
00143 typedef
00144 TAO_Seq_Out_T<
00145 RequestSeq
00146 >
00147 RequestSeq_out;
00148 #endif
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 class TAO_Export ORB
00163 {
00164 public:
00165
00166 class TAO_Export InvalidName : public CORBA::UserException
00167 {
00168 public:
00169 InvalidName (void);
00170 InvalidName (const InvalidName &);
00171 ~InvalidName (void);
00172
00173 InvalidName &operator= (const InvalidName &);
00174
00175 static InvalidName *_downcast (CORBA::Exception *);
00176 static CORBA::Exception *_alloc (void);
00177
00178 virtual CORBA::Exception *_tao_duplicate (void) const;
00179
00180 virtual void _raise (void) const;
00181
00182 virtual void _tao_encode (TAO_OutputCDR &) const;
00183
00184 virtual void _tao_decode (TAO_InputCDR &);
00185 };
00186
00187 typedef char *ObjectId;
00188 typedef CORBA::String_var ObjectId_var;
00189 typedef CORBA::String_out ObjectId_out;
00190 static CORBA::TypeCode_ptr const _tc_ObjectId;
00191
00192 typedef CORBA::ORB_ObjectIdList ObjectIdList;
00193 typedef CORBA::ORB_ObjectIdList_var ObjectIdList_var;
00194 typedef CORBA::ORB_ObjectIdList_out ObjectIdList_out;
00195 typedef CORBA::ORB_ObjectIdList *ObjectIdList_ptr;
00196 static CORBA::TypeCode_ptr const _tc_ObjectIdList;
00197
00198
00199
00200
00201
00202
00203 static CORBA::ORB_ptr _duplicate (CORBA::ORB_ptr orb);
00204
00205
00206
00207 static CORBA::ORB_ptr _nil (void);
00208
00209
00210 char * id (void);
00211
00212
00213
00214
00215
00216
00217 CORBA::Object_ptr string_to_object (const char *str);
00218
00219 #if defined (ACE_USES_WCHAR)
00220
00221
00222
00223
00224
00225
00226 CORBA::Object_ptr string_to_object (const wchar_t *str);
00227 #endif
00228
00229
00230
00231
00232
00233
00234
00235 char * object_to_string (CORBA::Object_ptr obj);
00236
00237 #if !defined(CORBA_E_MICRO)
00238
00239 CORBA::ValueFactory register_value_factory (
00240 const char *repository_id,
00241 CORBA::ValueFactory factory);
00242 #endif
00243
00244 #if !defined(CORBA_E_MICRO)
00245 void unregister_value_factory (const char * repository_id);
00246 #endif
00247
00248 #if !defined(CORBA_E_MICRO)
00249 CORBA::ValueFactory lookup_value_factory (const char *repository_id);
00250 #endif
00251
00252 #if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00253
00254 void create_list (CORBA::Long count, CORBA::NVList_ptr &new_list);
00255
00256 void create_operation_list(CORBA::OperationDef_ptr opDef,
00257 CORBA::NVList_ptr& result);
00258
00259 void create_named_value (CORBA::NamedValue_ptr &nmval);
00260
00261 void create_exception_list (CORBA::ExceptionList_ptr &exclist);
00262
00263 void create_environment (CORBA::Environment_ptr &new_env);
00264
00265
00266
00267
00268 void create_context_list (CORBA::ContextList_ptr &ctxtlist);
00269
00270 void get_default_context (CORBA::Context_ptr &ctx);
00271
00272 CORBA::Boolean get_service_information (
00273 CORBA::ServiceType service_type,
00274 CORBA::ServiceInformation_out service_information);
00275
00276 void send_multiple_requests_oneway (const CORBA::RequestSeq &req);
00277
00278 void send_multiple_requests_deferred (const CORBA::RequestSeq &req);
00279
00280 void get_next_response (CORBA::Request_ptr &req);
00281
00282 CORBA::Boolean poll_next_response (void);
00283
00284
00285
00286 CORBA::TypeCode_ptr create_struct_tc (
00287 const char *id,
00288 const char *name,
00289 const CORBA::StructMemberSeq &members);
00290
00291 CORBA::TypeCode_ptr create_union_tc (
00292 const char *id,
00293 const char *name,
00294 CORBA::TypeCode_ptr discriminator_type,
00295 const CORBA::UnionMemberSeq &members);
00296
00297 CORBA::TypeCode_ptr create_enum_tc (
00298 const char *id,
00299 const char *name,
00300 const CORBA::EnumMemberSeq &members);
00301
00302 CORBA::TypeCode_ptr create_alias_tc (
00303 const char *id,
00304 const char *name,
00305 CORBA::TypeCode_ptr original_type);
00306
00307 CORBA::TypeCode_ptr create_exception_tc (
00308 const char *id,
00309 const char *name,
00310 const CORBA::StructMemberSeq &members);
00311
00312 CORBA::TypeCode_ptr create_interface_tc (const char *id, const char *name);
00313
00314 CORBA::TypeCode_ptr create_string_tc (CORBA::ULong bound);
00315
00316 CORBA::TypeCode_ptr create_wstring_tc (CORBA::ULong bound);
00317
00318 CORBA::TypeCode_ptr create_fixed_tc (
00319 CORBA::UShort digits,
00320 CORBA::UShort scale);
00321
00322 CORBA::TypeCode_ptr create_sequence_tc (
00323 CORBA::ULong bound,
00324 CORBA::TypeCode_ptr element_type);
00325
00326 CORBA::TypeCode_ptr create_array_tc (
00327 CORBA::ULong length,
00328 CORBA::TypeCode_ptr element_type);
00329
00330 CORBA::TypeCode_ptr create_value_tc (
00331 const char *id,
00332 const char *name,
00333 CORBA::ValueModifier type_modifier,
00334 CORBA::TypeCode_ptr concrete_base,
00335 const CORBA::ValueMemberSeq &members);
00336
00337 CORBA::TypeCode_ptr create_value_box_tc (
00338 const char *id,
00339 const char *name,
00340 CORBA::TypeCode_ptr boxed_type);
00341
00342 CORBA::TypeCode_ptr create_native_tc (const char *id, const char *name);
00343
00344 CORBA::TypeCode_ptr create_recursive_tc (const char *id);
00345
00346 CORBA::TypeCode_ptr create_abstract_interface_tc (
00347 const char *id,
00348 const char *name);
00349
00350 CORBA::TypeCode_ptr create_local_interface_tc (
00351 const char *id,
00352 const char *name);
00353
00354 CORBA::TypeCode_ptr create_component_tc (
00355 const char *id,
00356 const char *name);
00357
00358 CORBA::TypeCode_ptr create_home_tc (
00359 const char *id,
00360 const char *name);
00361
00362 CORBA::TypeCode_ptr create_event_tc (
00363 const char *id,
00364 const char *name,
00365 CORBA::ValueModifier type_modifier,
00366 CORBA::TypeCode_ptr concrete_base,
00367 const CORBA::ValueMemberSeq &members);
00368
00369 #endif
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379 void run (void);
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394 void run (ACE_Time_Value &tv);
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411 void run (ACE_Time_Value *tv);
00412
00413
00414
00415 CORBA::Boolean work_pending (void);
00416
00417
00418
00419
00420
00421
00422
00423
00424 CORBA::Boolean work_pending (ACE_Time_Value &tv);
00425
00426
00427
00428
00429
00430
00431
00432 void perform_work (void);
00433 void perform_work (ACE_Time_Value &tv);
00434 void perform_work (ACE_Time_Value *tv);
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444 void shutdown (CORBA::Boolean wait_for_completion = false);
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 void destroy (void);
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476 CORBA::Object_ptr resolve_initial_references (
00477 const char *name,
00478 ACE_Time_Value *timeout = 0);
00479
00480 #if !defined(CORBA_E_MICRO)
00481
00482 void register_initial_reference (const char * id, CORBA::Object_ptr obj);
00483
00484
00485 CORBA::Object_ptr unregister_initial_reference (const char * id);
00486 #endif
00487
00488
00489
00490 CORBA::ORB::ObjectIdList_ptr list_initial_services (void);
00491
00492 #if !defined(CORBA_E_MICRO)
00493 CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
00494 const CORBA::Any& val);
00495 #endif
00496
00497
00498
00499
00500
00501 #if !defined(CORBA_E_MICRO)
00502
00503
00504 CORBA::Policy_ptr _create_policy (CORBA::PolicyType type);
00505 #endif
00506
00507
00508 unsigned long _incr_refcnt (void);
00509 unsigned long _decr_refcnt (void);
00510 unsigned long _refcnt (void) const;
00511
00512
00513 void _use_omg_ior_format (CORBA::Boolean ior);
00514
00515
00516 CORBA::Boolean _use_omg_ior_format (void);
00517
00518
00519 TAO_ORB_Core *orb_core (void) const;
00520
00521
00522 static CORBA::ORB_ptr _tao_make_ORB (TAO_ORB_Core * orb_core);
00523
00524
00525 typedef ORB_ptr _ptr_type;
00526 typedef ORB_var _var_type;
00527 typedef ORB_out _out_type;
00528
00529
00530 ACE_Time_Value *get_timeout (void);
00531
00532 protected:
00533
00534
00535 ORB (TAO_ORB_Core *orb_core);
00536
00537
00538
00539
00540
00541
00542 ~ORB (void);
00543
00544
00545 CORBA::Object_ptr resolve_policy_manager (void);
00546
00547
00548 CORBA::Object_ptr resolve_policy_current (void);
00549
00550 private:
00551
00552
00553
00554
00555
00556
00557
00558 void resolve_service (TAO::MCAST_SERVICEID service_id);
00559
00560
00561 CORBA::Object_ptr ior_string_to_object (const char* ior);
00562
00563
00564 CORBA::Object_ptr url_ior_string_to_object (const char* ior);
00565
00566
00567
00568 void check_shutdown (void);
00569
00570
00571 void set_timeout (ACE_Time_Value * timeout);
00572
00573 private:
00574
00575
00576
00577 ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
00578
00579
00580 TAO_ORB_Core * orb_core_;
00581
00582
00583 CORBA::Boolean use_omg_ior_format_;
00584
00585
00586 ORB (const ORB &);
00587 ORB &operator= (const ORB &);
00588
00589
00590 ACE_Time_Value * timeout_;
00591
00592 };
00593 }
00594
00595
00596 TAO_END_VERSIONED_NAMESPACE_DECL
00597
00598 #if defined (__ACE_INLINE__)
00599 # include "tao/ORB.inl"
00600 #endif
00601
00602 #include "ace/post.h"
00603
00604 #endif