diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-07-14 02:42:43 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-07-14 02:42:43 +0000 |
commit | 7b8de206ed87be0c0797ef5300a9875cda700530 (patch) | |
tree | fd7d65a230845e7885594f4a591b89e8ff9e52eb | |
parent | 593d9f1d939990c4ef0a98b6a633c12955bf7aa3 (diff) | |
download | ATCD-7b8de206ed87be0c0797ef5300a9875cda700530.tar.gz |
Initial thread locking for IFR. WIP (work in progress), Jeff will finish this off soon.
-rw-r--r-- | TAO/orbsvcs/IFR_Service/Contained_i.cpp | 136 | ||||
-rw-r--r-- | TAO/orbsvcs/IFR_Service/Container_i.cpp | 265 | ||||
-rw-r--r-- | TAO/orbsvcs/IFR_Service/IFR_macro.h | 56 | ||||
-rw-r--r-- | TAO/orbsvcs/IFR_Service/Repository_i.cpp | 92 | ||||
-rw-r--r-- | TAO/orbsvcs/IFR_Service/Repository_i.h | 29 |
5 files changed, 376 insertions, 202 deletions
diff --git a/TAO/orbsvcs/IFR_Service/Contained_i.cpp b/TAO/orbsvcs/IFR_Service/Contained_i.cpp index 67472575d27..afeef2982cd 100644 --- a/TAO/orbsvcs/IFR_Service/Contained_i.cpp +++ b/TAO/orbsvcs/IFR_Service/Contained_i.cpp @@ -20,8 +20,17 @@ TAO_Contained_i::~TAO_Contained_i (void) { } -void -TAO_Contained_i::destroy (CORBA::Environment &) +void +TAO_Contained_i::destroy (CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + TAO_IFR_WRITE_GUARD; + + this->destroy_i (); +} + +void +TAO_Contained_i::destroy_i (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_TString id; @@ -79,7 +88,16 @@ TAO_Contained_i::destroy (CORBA::Environment &) char * TAO_Contained_i::id (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ + TAO_IFR_READ_GUARD_RETURN (0); + + return this->id_i (); +} + +char * +TAO_Contained_i::id_i (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ ACE_TString retval; this->repo_->config ()->get_string_value (this->section_key_, "id", @@ -88,11 +106,22 @@ TAO_Contained_i::id (CORBA::Environment &) return CORBA::string_dup (retval.c_str ()); } -void +void TAO_Contained_i::id (const char *id, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { + TAO_IFR_WRITE_GUARD; + + this->id_i (const char *id, + CORBA::Environment &ACE_TRY_ENV); +} + +void +TAO_Contained_i::id_i (const char *id, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ ACE_TString tmp; if (this->repo_->config ()->get_string_value ( this->repo_->repo_ids_key (), @@ -136,7 +165,16 @@ TAO_Contained_i::id (const char *id, char * TAO_Contained_i::name (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ + TAO_IFR_READ_GUARD_RETURN (0); + + return this->name_i (); +} + +char * +TAO_Contained_i::name_i (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ ACE_TString retval; this->repo_->config ()->get_string_value (this->section_key_, "name", @@ -148,7 +186,16 @@ TAO_Contained_i::name (CORBA::Environment &) char * TAO_Contained_i::version (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ + TAO_IFR_READ_GUARD_RETURN (0); + + return this->version_i (); +} + +char * +TAO_Contained_i::version_i (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ ACE_TString retval; this->repo_->config ()->get_string_value (this->section_key_, "version", @@ -157,7 +204,18 @@ TAO_Contained_i::version (CORBA::Environment &) return CORBA::string_dup (retval.c_str ()); } -void +void +TAO_Contained_i::name (const char *name, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + TAO_IFR_WRITE_GUARD; + + this->name_i (name, + ACE_TRY_ENV); +} + +void TAO_Contained_i::name (const char *name, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -194,17 +252,28 @@ TAO_Contained_i::name (const char *name, this->section_key_); } -void +void TAO_Contained_i::version (const char *version, CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) { + TAO_IFR_WRITE_GUARD; + + this->version_i (const char *version, + CORBA::Environment &); +} + +void +TAO_Contained_i::version_i (const char *version, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ this->repo_->config ()->set_string_value (this->section_key_, "version", version); } -IR::Container_ptr +IR::Container_ptr TAO_Contained_i::defined_in (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { @@ -232,10 +301,10 @@ TAO_Contained_i::defined_in (CORBA::Environment &ACE_TRY_ENV) "def_kind", kind); - IR::DefinitionKind def_kind = + IR::DefinitionKind def_kind = ACE_static_cast (IR::DefinitionKind, kind); - CORBA::Object_var obj = + CORBA::Object_var obj = this->repo_->servant_factory ()->create_objref (def_kind, container_path.c_str (), ACE_TRY_ENV); @@ -251,7 +320,7 @@ TAO_Contained_i::defined_in (CORBA::Environment &ACE_TRY_ENV) char * TAO_Contained_i::absolute_name (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ ACE_TString absolute_name; this->repo_->config ()->get_string_value (this->section_key_, "absolute_name", @@ -260,20 +329,22 @@ TAO_Contained_i::absolute_name (CORBA::Environment &) return CORBA::string_dup (absolute_name.c_str ()); } -IR::Repository_ptr +IR::Repository_ptr TAO_Contained_i::containing_repository (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ return this->repo_->repo_objref (); } -void +void TAO_Contained_i::move (IR::Container_ptr new_container, const char *new_name, const char *new_version, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { + TAO_IFR_WRITE_GUARD; + this->move_i (new_container, new_name, new_version, @@ -317,7 +388,7 @@ TAO_Contained_i::name_exists (const char *name, ACE_TString section_name; int index = 0; - + while (this->repo_->config ()->enumerate_sections (defns_key, index++, section_name) @@ -341,7 +412,7 @@ TAO_Contained_i::name_exists (const char *name, return 0; } -void +void TAO_Contained_i::contents_name_update (ACE_TString stem, ACE_Configuration_Section_Key key) { @@ -384,7 +455,7 @@ TAO_Contained_i::contents_name_update (ACE_TString stem, } } -void +void TAO_Contained_i::move_i (IR::Container_ptr new_container, const char *new_name, const char *new_version, @@ -392,11 +463,11 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - IR::Repository_var my_repo = + IR::Repository_var my_repo = this->containing_repository (ACE_TRY_ENV); ACE_CHECK; - IR::DefinitionKind container_dk = + IR::DefinitionKind container_dk = new_container->def_kind (ACE_TRY_ENV); ACE_CHECK; @@ -410,12 +481,12 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, } else { - IR::Contained_var contained = + IR::Contained_var contained = IR::Contained::_narrow (new_container, ACE_TRY_ENV); ACE_CHECK; - IR::Repository_var your_repo = + IR::Repository_var your_repo = contained->containing_repository (ACE_TRY_ENV); ACE_CHECK; @@ -535,7 +606,7 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, ACE_CHECK; } - IR::StructDef_var new_defn = + IR::StructDef_var new_defn = new_container->create_struct (id.in (), new_name, new_version, @@ -553,7 +624,7 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, TAO_UnionDef_i impl (this->repo_, this->section_key_); - IR::IDLType_var disc_type = + IR::IDLType_var disc_type = impl.discriminator_type_def (ACE_TRY_ENV); ACE_CHECK; @@ -680,17 +751,17 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, IR::AttributeMode mode = impl.mode (ACE_TRY_ENV); ACE_CHECK; - IR::ExceptionDefSeq_var get_excepts = + IR::ExceptionDefSeq_var get_excepts = impl.get_exceptions (ACE_TRY_ENV); ACE_CHECK; - IR::ExceptionDefSeq_var put_excepts = + IR::ExceptionDefSeq_var put_excepts = impl.put_exceptions (ACE_TRY_ENV); ACE_CHECK; if (container_dk == IR::dk_Interface) { - IR::InterfaceDef_var idef = + IR::InterfaceDef_var idef = IR::InterfaceDef::_narrow (new_container, ACE_TRY_ENV); ACE_CHECK; @@ -708,7 +779,7 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, } else if (container_dk == IR::dk_Value) { - IR::ValueDef_var vdef = + IR::ValueDef_var vdef = IR::ValueDef::_narrow (new_container, ACE_TRY_ENV); ACE_CHECK; @@ -751,7 +822,7 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, if (container_dk == IR::dk_Interface) { - IR::InterfaceDef_var idef = + IR::InterfaceDef_var idef = IR::InterfaceDef::_narrow (new_container, ACE_TRY_ENV); ACE_CHECK; @@ -770,7 +841,7 @@ TAO_Contained_i::move_i (IR::Container_ptr new_container, } else if (container_dk == IR::dk_Value) { - IR::ValueDef_var vdef = + IR::ValueDef_var vdef = IR::ValueDef::_narrow (new_container, ACE_TRY_ENV); ACE_CHECK; @@ -869,14 +940,14 @@ TAO_Contained_i::move_pre_process (IR::Container_ptr container, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - PortableServer::ObjectId_var container_oid = + PortableServer::ObjectId_var container_oid = this->repo_->ir_poa ()->reference_to_id (container, ACE_TRY_ENV); ACE_CHECK; CORBA::String_var container_path = PortableServer::ObjectId_to_string (container_oid.in ()); - + ACE_Configuration_Section_Key container_key; this->repo_->config ()->expand_path (this->repo_->root_key (), container_path.in (), @@ -1076,4 +1147,3 @@ TAO_Contained_i::move_contents (IR::Container_ptr new_container, } } } - diff --git a/TAO/orbsvcs/IFR_Service/Container_i.cpp b/TAO/orbsvcs/IFR_Service/Container_i.cpp index 17f1447ccf5..f99f8f80b3a 100644 --- a/TAO/orbsvcs/IFR_Service/Container_i.cpp +++ b/TAO/orbsvcs/IFR_Service/Container_i.cpp @@ -67,7 +67,7 @@ TAO_Container_i::destroy (CORBA::Environment &ACE_TRY_ENV) // This entry may already have been destroyed. if (status == 0) { - TAO_IDLType_i *impl = + TAO_IDLType_i *impl = this->repo_->servant_factory ()->create_idltype (entry_key, ACE_TRY_ENV); ACE_CHECK; @@ -153,11 +153,22 @@ TAO_Container_i::destroy (CORBA::Environment &ACE_TRY_ENV) } } -IR::Contained_ptr +IR::Contained_ptr TAO_Container_i::lookup (const char *search_name, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { + TAO_IFR_READ_GUARD_RETURN (0); + + return this->lookup_i (search_name, + ACE_TRY_ENV); +} + +IR::Contained_ptr +TAO_Container_i::lookup_i (const char *search_name, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ ACE_Configuration_Section_Key iter_key; ACE_Configuration_Section_Key work_key; ACE_TString work_string; @@ -187,7 +198,7 @@ TAO_Container_i::lookup (const char *search_name, { pos = work_string.find ("::"); so_far_so_good = 0; - + ACE_Configuration_Section_Key defns_key; status = this->repo_->config ()->open_section (iter_key, @@ -224,7 +235,7 @@ TAO_Container_i::lookup (const char *search_name, if (so_far_so_good) { if (pos != ACE_TString::npos) - { + { work_string = work_string.substr (pos + 2); continue; } @@ -243,7 +254,7 @@ TAO_Container_i::lookup (const char *search_name, def_kind = ACE_static_cast (IR::DefinitionKind, kind); - if (def_kind == IR::dk_Interface + if (def_kind == IR::dk_Interface || def_kind == IR::dk_Value) { ACE_Configuration_Section_Key attrs_key; @@ -371,7 +382,7 @@ TAO_Container_i::contents (IR::DefinitionKind limit_type, CORBA::Boolean exclude_inherited, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ if (limit_type == IR::dk_none) return 0; @@ -513,7 +524,7 @@ TAO_Container_i::lookup_name (const char *search_name, limit_type, exclude_inherited, ACE_TRY_ENV); - + size_t size = kind_queue.size (); IR::ContainedSeq *holder; @@ -556,7 +567,7 @@ TAO_Container_i::describe_contents (IR::DefinitionKind limit_type, CORBA::Long max_returned_objs, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ IR::ContainedSeq_var contents = this->contents (limit_type, exclude_inherited, ACE_TRY_ENV); @@ -568,8 +579,8 @@ TAO_Container_i::describe_contents (IR::DefinitionKind limit_type, if (max_returned_objs == -1) ret_len = length; else - ret_len = length < ACE_static_cast (CORBA::ULong, max_returned_objs) - ? length + ret_len = length < ACE_static_cast (CORBA::ULong, max_returned_objs) + ? length : max_returned_objs; IR::Container::DescriptionSeq *desc_seq; @@ -589,7 +600,7 @@ TAO_Container_i::describe_contents (IR::DefinitionKind limit_type, desc = contents[i]->describe (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - retval[i].contained_object = + retval[i].contained_object = IR::Contained::_duplicate (contents[i]); retval[i].kind = desc->kind; @@ -600,28 +611,28 @@ TAO_Container_i::describe_contents (IR::DefinitionKind limit_type, return retval._retn (); } -IR::ModuleDef_ptr +IR::ModuleDef_ptr TAO_Container_i::create_module (const char *id, const char *name, const char *version, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Module, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ModuleDef::_nil ()); if (!legal_op) return IR::ModuleDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ModuleDef::_nil ()); if (bad_params) return IR::ModuleDef::_nil (); - + ACE_Configuration_Section_Key defns_key; // Create/open section for members defined in this scope. @@ -633,9 +644,9 @@ TAO_Container_i::create_module (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Module); @@ -658,7 +669,7 @@ TAO_Container_i::create_module (const char *id, ACE_TRY_ENV); } -IR::ConstantDef_ptr +IR::ConstantDef_ptr TAO_Container_i::create_constant (const char *id, const char *name, const char *version, @@ -666,22 +677,22 @@ TAO_Container_i::create_constant (const char *id, const CORBA::Any &value, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Constant, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ConstantDef::_nil ()); if (!legal_op) return IR::ConstantDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ConstantDef::_nil ()); if (bad_params) return IR::ConstantDef::_nil (); - + // Create/open section for members defined in this scope. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -692,21 +703,21 @@ TAO_Container_i::create_constant (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Constant); // Get the path to our type and store it. - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (type, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ConstantDef::_nil ()); - CORBA::String_var type_path = + CORBA::String_var type_path = PortableServer::ObjectId_to_string (oid.in ()); this->repo_->config ()->set_string_value (new_key, @@ -756,7 +767,7 @@ TAO_Container_i::create_constant (const char *id, ACE_TRY_ENV); } -IR::StructDef_ptr +IR::StructDef_ptr TAO_Container_i::create_struct (const char *id, const char *name, const char *version, @@ -770,15 +781,15 @@ TAO_Container_i::create_struct (const char *id, if (!legal_op) return IR::StructDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::StructDef::_nil ()); if (bad_params) return IR::StructDef::_nil (); - + // Create/open section for members defined in this scope. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -789,9 +800,9 @@ TAO_Container_i::create_struct (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Struct); @@ -825,7 +836,7 @@ TAO_Container_i::create_struct (const char *id, "name", name); - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (members[i].type_def, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::StructDef::_nil ()); @@ -860,7 +871,7 @@ TAO_Container_i::create_struct (const char *id, ACE_TRY_ENV); } -IR::UnionDef_ptr +IR::UnionDef_ptr TAO_Container_i::create_union (const char *id, const char *name, const char *version, @@ -868,22 +879,22 @@ TAO_Container_i::create_union (const char *id, const IR::UnionMemberSeq &members, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Union, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::UnionDef::_nil ()); if (!legal_op) return IR::UnionDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::UnionDef::_nil ()); if (bad_params) return IR::UnionDef::_nil (); - + // Create new section, or open if it already exists. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -894,22 +905,22 @@ TAO_Container_i::create_union (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Union); // Add a field to hold the path to the discriminator type. - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (discriminator_type, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::UnionDef::_nil ()); CORBA::String_var disc_path = PortableServer::ObjectId_to_string (oid.in ()); - + this->repo_->config ()->set_string_value (new_key, "disc_path", disc_path.in ()); @@ -943,7 +954,7 @@ TAO_Container_i::create_union (const char *id, "name", name); - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (members[i].type_def, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::UnionDef::_nil ()); @@ -982,7 +993,7 @@ TAO_Container_i::create_union (const char *id, ACE_TRY_ENV); } -IR::EnumDef_ptr +IR::EnumDef_ptr TAO_Container_i::create_enum (const char *id, const char *name, const char *version, @@ -996,15 +1007,15 @@ TAO_Container_i::create_enum (const char *id, if (!legal_op) return IR::EnumDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::EnumDef::_nil ()); if (bad_params) return IR::EnumDef::_nil (); - + // Create new section, or open if it already exists. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1015,9 +1026,9 @@ TAO_Container_i::create_enum (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Enum); @@ -1028,7 +1039,7 @@ TAO_Container_i::create_enum (const char *id, "count", count); - // Create a section for each member, named for + // Create a section for each member, named for // its ordinal position in the enum, for (CORBA::ULong i = 0; i < count; i++) { @@ -1067,29 +1078,29 @@ TAO_Container_i::create_enum (const char *id, ACE_TRY_ENV); } -IR::AliasDef_ptr +IR::AliasDef_ptr TAO_Container_i::create_alias (const char *id, const char *name, const char *version, IR::IDLType_ptr original_type, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Alias, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::AliasDef::_nil ()); if (!legal_op) return IR::AliasDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::AliasDef::_nil ()); if (bad_params) return IR::AliasDef::_nil (); - + // Create new section. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1100,20 +1111,20 @@ TAO_Container_i::create_alias (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Alias); // Get the path to our original type and store it. - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (original_type, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::AliasDef::_nil ()); - CORBA::String_var unalias_path = + CORBA::String_var unalias_path = PortableServer::ObjectId_to_string (oid.in ()); this->repo_->config ()->set_string_value (new_key, @@ -1131,7 +1142,7 @@ TAO_Container_i::create_alias (const char *id, ACE_TRY_ENV); } -IR::InterfaceDef_ptr +IR::InterfaceDef_ptr TAO_Container_i::create_interface (const char *id, const char *name, const char *version, @@ -1140,22 +1151,22 @@ TAO_Container_i::create_interface (const char *id, CORBA::Boolean is_local, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Interface, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::InterfaceDef::_nil ()); if (!legal_op) return IR::InterfaceDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::InterfaceDef::_nil ()); if (bad_params) return IR::InterfaceDef::_nil (); - + // Create new section. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1166,9 +1177,9 @@ TAO_Container_i::create_interface (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Interface); @@ -1197,7 +1208,7 @@ TAO_Container_i::create_interface (const char *id, // Store the path to each base interface. for (CORBA::ULong i = 0; i < length; i++) { - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (base_interfaces[i], ACE_TRY_ENV); ACE_CHECK_RETURN (IR::InterfaceDef::_nil ()); @@ -1224,7 +1235,7 @@ TAO_Container_i::create_interface (const char *id, ACE_TRY_ENV); } -IR::ValueDef_ptr +IR::ValueDef_ptr TAO_Container_i::create_value (const char * /* id */, const char * /* name */, const char * /* version */, @@ -1237,34 +1248,34 @@ TAO_Container_i::create_value (const char * /* id */, const IR::InitializerSeq & /* initializers */, CORBA::Environment & /* ACE_TRY_ENV */) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ // TODO return 0; } -IR::ValueBoxDef_ptr +IR::ValueBoxDef_ptr TAO_Container_i::create_value_box (const char *id, const char *name, const char *version, IR::IDLType_ptr original_type_def, CORBA::Environment &ACE_TRY_ENV ) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_ValueBox, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ValueBoxDef::_nil ()); if (!legal_op) return IR::ValueBoxDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ValueBoxDef::_nil ()); if (bad_params) return IR::ValueBoxDef::_nil (); - + // Create new section. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1275,20 +1286,20 @@ TAO_Container_i::create_value_box (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_ValueBox); // Get the path to our original type and store it. - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (original_type_def, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ValueBoxDef::_nil ()); - CORBA::String_var boxed_path = + CORBA::String_var boxed_path = PortableServer::ObjectId_to_string (oid.in ()); this->repo_->config ()->set_string_value (new_key, @@ -1306,29 +1317,29 @@ TAO_Container_i::create_value_box (const char *id, ACE_TRY_ENV); } -IR::ExceptionDef_ptr +IR::ExceptionDef_ptr TAO_Container_i::create_exception (const char *id, const char *name, const char *version, const IR::StructMemberSeq &members, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Exception, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ExceptionDef::_nil ()); if (!legal_op) return IR::ExceptionDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ExceptionDef::_nil ()); if (bad_params) return IR::ExceptionDef::_nil (); - + // Create/open section for members defined in this scope. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1339,9 +1350,9 @@ TAO_Container_i::create_exception (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Exception); @@ -1373,7 +1384,7 @@ TAO_Container_i::create_exception (const char *id, "name", name); - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->repo_->ir_poa ()->reference_to_id (members[i].type_def, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ExceptionDef::_nil ()); @@ -1397,28 +1408,28 @@ TAO_Container_i::create_exception (const char *id, ACE_TRY_ENV); } -IR::NativeDef_ptr +IR::NativeDef_ptr TAO_Container_i::create_native (const char *id, const char *name, const char *version, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) -{ +{ CORBA::Boolean legal_op = this->valid_container (IR::dk_Native, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::NativeDef::_nil ()); if (!legal_op) return IR::NativeDef::_nil (); - - CORBA::Boolean bad_params = this->pre_exist (id, - name, + + CORBA::Boolean bad_params = this->pre_exist (id, + name, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::NativeDef::_nil ()); if (bad_params) return IR::NativeDef::_nil (); - + // Create new section. ACE_Configuration_Section_Key defns_key; this->repo_->config ()->open_section (this->section_key_, @@ -1429,9 +1440,9 @@ TAO_Container_i::create_native (const char *id, // Common to all IR objects created in IR::Container. ACE_Configuration_Section_Key new_key; ACE_TString path = this->create_common (defns_key, - new_key, - id, - name, + new_key, + id, + name, version, "defns\\", IR::dk_Native); @@ -1447,7 +1458,7 @@ TAO_Container_i::create_native (const char *id, ACE_TRY_ENV); } -void +void TAO_Container_i::lookup_name_recursive ( ACE_Unbounded_Queue<IR::DefinitionKind> &kind_queue, ACE_Unbounded_Queue<ACE_TString> &path_queue, @@ -1498,7 +1509,7 @@ TAO_Container_i::lookup_name_recursive ( if (!ACE_OS::strcmp (name.c_str (), search_name)) { kind_queue.enqueue_tail (def_kind); - + ACE_TString id; this->repo_->config ()->get_string_value (defn_key, "id", @@ -1669,7 +1680,7 @@ TAO_Container_i:: lookup_attr ( } } -void +void TAO_Container_i::lookup_op ( ACE_Unbounded_Queue<IR::DefinitionKind> &kind_queue, ACE_Unbounded_Queue<ACE_TString> &path_queue, @@ -1806,7 +1817,7 @@ TAO_Container_i::name_exists (const char *name, if (member_name == name) { - ACE_THROW_RETURN (CORBA::BAD_PARAM (3, + ACE_THROW_RETURN (CORBA::BAD_PARAM (3, CORBA::COMPLETED_NO), 1); } @@ -1841,13 +1852,13 @@ TAO_Container_i::name_exists (const char *name, if (defn_name == name) { - ACE_THROW_RETURN (CORBA::BAD_PARAM (3, + ACE_THROW_RETURN (CORBA::BAD_PARAM (3, CORBA::COMPLETED_NO), 1); } } } - + // If we are an interface, check the inherited members. IR::DefinitionKind def_kind = this->def_kind (ACE_TRY_ENV); ACE_CHECK_RETURN (1); @@ -1887,16 +1898,16 @@ TAO_Container_i::name_exists (const char *name, if (base_name == name) { - ACE_THROW_RETURN (CORBA::BAD_PARAM (5, + ACE_THROW_RETURN (CORBA::BAD_PARAM (5, CORBA::COMPLETED_NO), 1); } } } } - + return 0; -} +} CORBA::Boolean TAO_Container_i::id_exists (const char *id, @@ -1910,7 +1921,7 @@ TAO_Container_i::id_exists (const char *id, holder) == 0) { - ACE_THROW_RETURN (CORBA::BAD_PARAM (2, + ACE_THROW_RETURN (CORBA::BAD_PARAM (2, CORBA::COMPLETED_NO), 1); } @@ -1919,7 +1930,7 @@ TAO_Container_i::id_exists (const char *id, } -CORBA::Boolean +CORBA::Boolean TAO_Container_i::pre_exist (const char *id, const char *name, CORBA::Environment &ACE_TRY_ENV) @@ -2010,7 +2021,7 @@ TAO_Container_i::create_common ( this->repo_->config ()->set_string_value (new_key, "container_id", container_id); - + ACE_TString path; if (container_id == "") // This Container is the Repository. { @@ -2088,7 +2099,7 @@ TAO_Container_i::valid_container (const IR::DefinitionKind op_kind, if (error_flag == 1) { - ACE_THROW_RETURN (CORBA::BAD_PARAM (4, + ACE_THROW_RETURN (CORBA::BAD_PARAM (4, CORBA::COMPLETED_NO), 0); } diff --git a/TAO/orbsvcs/IFR_Service/IFR_macro.h b/TAO/orbsvcs/IFR_Service/IFR_macro.h new file mode 100644 index 00000000000..19d450f4092 --- /dev/null +++ b/TAO/orbsvcs/IFR_Service/IFR_macro.h @@ -0,0 +1,56 @@ +// $Id$ + +#ifndef TAO_IFR_MACROS_H +#define TAO_IFR_MACROS_H +#include "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#define TAO_IFR_WRITE_GUARD \ + ACE_WRITE_GUARD_THROW_EX (ACE_Lock, \ + monitor, \ + this->repo_->lock (), \ + CORBA::SystemException ( \ + CORBA_SystemException::_tao_minor_code ( \ + TAO_GUARD_FAILURE, \ + 0), \ + CORBA::COMPLETED_NO)); \ + ACE_CHECK + +#define TAO_IFR_WRITE_GUARD_RETURN(RETURN) \ + ACE_WRITE_GUARD_THROW_EX (ACE_Lock, \ + monitor, \ + this->repo_->lock (), \ + CORBA::SystemException ( \ + CORBA_SystemException::_tao_minor_code ( \ + TAO_GUARD_FAILURE, \ + 0), \ + CORBA::COMPLETED_NO)); \ + ACE_CHECK_RETURN (RETURN) + +#define TAO_IFR_READ_GUARD \ + ACE_READ_GUARD_THROW_EX (ACE_Lock, \ + monitor, \ + this->repo_->lock (), \ + CORBA::SystemException ( \ + CORBA_SystemException::_tao_minor_code ( \ + TAO_GUARD_FAILURE, \ + 0), \ + CORBA::COMPLETED_NO)); \ + ACE_CHECK + +#define TAO_IFR_READ_GUARD_RETURN(RETURN) \ + ACE_READ_GUARD_THROW_EX (ACE_Lock, \ + monitor, \ + this->repo_->lock (), \ + CORBA::SystemException ( \ + CORBA_SystemException::_tao_minor_code ( \ + TAO_GUARD_FAILURE, \ + 0), \ + CORBA::COMPLETED_NO)); \ + ACE_CHECK_RETURN (RETURN) + +#include "ace/post.h" +#endif /* TAO_IFR_MACROS_H */ diff --git a/TAO/orbsvcs/IFR_Service/Repository_i.cpp b/TAO/orbsvcs/IFR_Service/Repository_i.cpp index 511cdb39686..a77b89494af 100644 --- a/TAO/orbsvcs/IFR_Service/Repository_i.cpp +++ b/TAO/orbsvcs/IFR_Service/Repository_i.cpp @@ -19,7 +19,28 @@ TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb, config_ (config), servant_factory_ (0), extension_ (CORBA::string_dup ("TAO_IFR_name_extension")) + lock_ (0) { +#if defined (ACE_HAS_THREADS) + + if (1) //enable_locking + { + ACE_NEW (this->lock_, + ACE_Lock_Adapter<ACE_SYNCH_MUTEX> ()); + } + else + { + ACE_NEW (this->lock_, + ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> ()); + } + +#else + + ACE_NEW (this->lock_, + ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> ()); + +#endif /* ACE_HAS_THREADS */ + ACE_TRY_NEW_ENV { ACE_NEW_THROW_EX (this->servant_factory_, @@ -68,13 +89,13 @@ TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb, 1, // Will create if IFR is not persistent. this->root_key_); - this->config_->open_section (this->root_key_, - "defns", + this->config_->open_section (this->root_key_, + "defns", 1, // Will create if IFR is not persistent. this->named_objs_key_); - this->config_->open_section (this->root_key_, - "repo_ids", + this->config_->open_section (this->root_key_, + "repo_ids", 1, // Will create if IFR is not persistent. this->repo_ids_key_); @@ -104,7 +125,7 @@ TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb, this->pkind_to_string (pkind), 1, key); - + this->config_->set_integer_value (key, "def_kind", IR::dk_Primitive); @@ -118,27 +139,27 @@ TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb, this->config_->open_section (this->root_key_, "strings", - 1, + 1, this->strings_key_); this->config_->open_section (this->root_key_, "wstrings", - 1, + 1, this->wstrings_key_); this->config_->open_section (this->root_key_, "fixeds", - 1, + 1, this->fixeds_key_); this->config_->open_section (this->root_key_, "arrays", - 1, + 1, this->arrays_key_); this->config_->open_section (this->root_key_, "sequences", - 1, + 1, this->sequences_key_); u_int count = 0; @@ -197,6 +218,13 @@ TAO_Repository_i::TAO_Repository_i (CORBA::ORB_ptr orb, TAO_Repository_i::~TAO_Repository_i (void) { delete this->servant_factory_; + delete this->lock_; +} + +ACE_Lock & +TAO_Repository_i::lock (void) +{ + return *this->lock_; } IR::DefinitionKind @@ -206,14 +234,14 @@ TAO_Repository_i::def_kind (CORBA::Environment &) return IR::dk_Repository; } -void +void TAO_Repository_i::destroy (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_THROW (CORBA::BAD_INV_ORDER (2, CORBA::COMPLETED_NO)); } -IR::Contained_ptr +IR::Contained_ptr TAO_Repository_i::lookup_id (const char *search_id, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -249,7 +277,7 @@ TAO_Repository_i::lookup_id (const char *search_id, ACE_TRY_ENV); } -CORBA::TypeCode_ptr +CORBA::TypeCode_ptr TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -272,7 +300,7 @@ TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc, CORBA::TypeCode_var ctype = tc->content_type (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); - CORBA::TypeCode_var canon_ctype = + CORBA::TypeCode_var canon_ctype = this->get_canonical_typecode (ctype.in (), ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); @@ -289,7 +317,7 @@ TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc, CORBA::TypeCode_var ctype = tc->content_type (ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); - CORBA::TypeCode_var canon_ctype = + CORBA::TypeCode_var canon_ctype = this->get_canonical_typecode (ctype.in (), ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); @@ -341,7 +369,7 @@ TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc, } else { - TAO_IDLType_i *impl = + TAO_IDLType_i *impl = this->servant_factory ()->create_idltype (key, ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); @@ -354,7 +382,7 @@ TAO_Repository_i::get_canonical_typecode (CORBA::TypeCode_ptr tc, } } -IR::PrimitiveDef_ptr +IR::PrimitiveDef_ptr TAO_Repository_i::get_primitive (IR::PrimitiveKind kind, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -373,7 +401,7 @@ TAO_Repository_i::get_primitive (IR::PrimitiveKind kind, ACE_TRY_ENV); } -IR::StringDef_ptr +IR::StringDef_ptr TAO_Repository_i::create_string (CORBA::ULong bound, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -408,7 +436,7 @@ TAO_Repository_i::create_string (CORBA::ULong bound, name.in ()); // Create the object reference. - ACE_TString obj_id ("strings\\"); + ACE_TString obj_id ("strings\\"); obj_id += name.in (); CORBA::Object_var obj = @@ -421,7 +449,7 @@ TAO_Repository_i::create_string (CORBA::ULong bound, ACE_TRY_ENV); } -IR::WstringDef_ptr +IR::WstringDef_ptr TAO_Repository_i::create_wstring (CORBA::ULong bound, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -456,7 +484,7 @@ TAO_Repository_i::create_wstring (CORBA::ULong bound, name.in ()); // Create the object reference. - ACE_TString obj_id ("wstrings\\"); + ACE_TString obj_id ("wstrings\\"); obj_id += name.in (); CORBA::Object_var obj = @@ -469,18 +497,18 @@ TAO_Repository_i::create_wstring (CORBA::ULong bound, ACE_TRY_ENV); } -IR::SequenceDef_ptr +IR::SequenceDef_ptr TAO_Repository_i::create_sequence (CORBA::ULong bound, IR::IDLType_ptr element_type, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->ir_poa_->reference_to_id (element_type, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::SequenceDef::_nil ()); - CORBA::String_var element_path = + CORBA::String_var element_path = PortableServer::ObjectId_to_string (oid.in ()); u_int count = 0; @@ -534,18 +562,18 @@ TAO_Repository_i::create_sequence (CORBA::ULong bound, ACE_TRY_ENV); } -IR::ArrayDef_ptr +IR::ArrayDef_ptr TAO_Repository_i::create_array (CORBA::ULong length, IR::IDLType_ptr element_type, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - PortableServer::ObjectId_var oid = + PortableServer::ObjectId_var oid = this->ir_poa_->reference_to_id (element_type, ACE_TRY_ENV); ACE_CHECK_RETURN (IR::ArrayDef::_nil ()); - CORBA::String_var element_path = + CORBA::String_var element_path = PortableServer::ObjectId_to_string (oid.in ()); u_int count = 0; @@ -599,7 +627,7 @@ TAO_Repository_i::create_array (CORBA::ULong length, ACE_TRY_ENV); } -IR::FixedDef_ptr +IR::FixedDef_ptr TAO_Repository_i::create_fixed (CORBA::UShort /* digits */, CORBA::Short /* scale */, CORBA::Environment &ACE_TRY_ENV) @@ -608,7 +636,7 @@ TAO_Repository_i::create_fixed (CORBA::UShort /* digits */, ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), IR::FixedDef::_nil ()); } -PortableServer::POA_ptr +PortableServer::POA_ptr TAO_Repository_i::ir_poa (void) const { return this->ir_poa_; @@ -638,7 +666,7 @@ TAO_Repository_i::repo_objref (void) const return IR::Repository::_duplicate (this->repo_objref_); } -void +void TAO_Repository_i::repo_objref (IR::Repository_ptr objref) { this->repo_objref_ = objref; @@ -736,13 +764,13 @@ TAO_Repository_i::pkind_to_string (IR::PrimitiveKind pkind) const return TAO_Repository_i::TAO_IFR_primitive_kinds[pkind]; } -u_int +u_int TAO_Repository_i::num_pkinds (void) const { return sizeof (TAO_Repository_i::TAO_IFR_primitive_kinds) / sizeof (char*); } -void +void TAO_Repository_i::shutdown (void) { this->orb_->shutdown (0); diff --git a/TAO/orbsvcs/IFR_Service/Repository_i.h b/TAO/orbsvcs/IFR_Service/Repository_i.h index cd25492f832..ed33f158d29 100644 --- a/TAO/orbsvcs/IFR_Service/Repository_i.h +++ b/TAO/orbsvcs/IFR_Service/Repository_i.h @@ -33,6 +33,8 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ +#include "IFR_macro.h" + class IFR_Servant_Factory; class TAO_Repository_i : public virtual TAO_Container_i @@ -42,7 +44,7 @@ class TAO_Repository_i : public virtual TAO_Container_i // // = DESCRIPTION // Provides global access to the Interface Repository, but - // does not support access to information related to + // does not support access to information related to // CORBA Components. // public: @@ -70,35 +72,35 @@ public: virtual IR::Contained_ptr lookup_id ( const char *search_id, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); virtual CORBA::TypeCode_ptr get_canonical_typecode ( CORBA::TypeCode_ptr tc, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); virtual IR::PrimitiveDef_ptr get_primitive ( IR::PrimitiveKind kind, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC (( CORBA::SystemException)); virtual IR::StringDef_ptr create_string ( CORBA::ULong bound, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); virtual IR::WstringDef_ptr create_wstring ( CORBA::ULong bound, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -106,7 +108,7 @@ public: virtual IR::SequenceDef_ptr create_sequence ( CORBA::ULong bound, IR::IDLType_ptr element_type, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC (( CORBA::SystemException)); @@ -114,7 +116,7 @@ public: virtual IR::ArrayDef_ptr create_array ( CORBA::ULong length, IR::IDLType_ptr element_type, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -122,7 +124,7 @@ public: virtual IR::FixedDef_ptr create_fixed ( CORBA::UShort digits, CORBA::Short scale, - CORBA::Environment &ACE_TRY_ENV = + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () ) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -175,9 +177,13 @@ public: void shutdown (void); // Used ONLY with Purify, for memory leak checking. - // A call to this can be temporariily appended to the + // A call to this can be temporariily appended to the // destroy() method of the last thing to be destroyed // by the test code. + + ACE_Lock &lock (void); + // Repo lock. + protected: CORBA::ORB_ptr orb_; // Reference to our ORB. @@ -227,6 +233,9 @@ protected: CORBA::String_var extension_; // Added to names to temporarily avoid name clashes. + ACE_Lock *lock_; + // Lock. + private: static const char *TAO_IFR_primitive_kinds[]; // Set of strings corresponding to the IR::PrimitiveKind |