summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp87
1 files changed, 63 insertions, 24 deletions
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
index 708abb65821..b74f39c8a74 100644
--- a/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueDef_i.cpp
@@ -402,22 +402,19 @@ TAO_ValueDef_i::base_value (void)
CORBA::ValueDef_ptr
TAO_ValueDef_i::base_value_i (void)
{
- ACE_TString holder;
+ ACE_TString base_path;
int status =
this->repo_->config ()->get_string_value (this->section_key_,
"base_value",
- holder);
+ base_path);
if (status != 0)
{
return CORBA::ValueDef::_nil ();
}
- this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
- holder.fast_rep (),
- holder);
CORBA::Object_var obj =
- TAO_IFR_Service_Utils::path_to_ir_object (holder,
+ TAO_IFR_Service_Utils::path_to_ir_object (base_path,
this->repo_);
return CORBA::ValueDef::_narrow (obj.in ());
@@ -463,7 +460,7 @@ TAO_ValueDef_i::base_value_i (CORBA::ValueDef_ptr base_value)
this->repo_->config ()->set_string_value (
this->section_key_,
"base_value",
- base_value->_interface_repository_id ()
+ base_path
);
}
@@ -726,7 +723,7 @@ TAO_ValueDef_i::is_a_i (const char *id)
{
if (ACE_OS::strcmp (id, "IDL:omg.org/CORBA/ValueBase:1.0") == 0)
{
- return 1;
+ return true;
}
ACE_TString holder;
@@ -737,21 +734,34 @@ TAO_ValueDef_i::is_a_i (const char *id)
// Is it our type?
if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
{
- return 1;
+ return true;
}
- this->repo_->config ()->get_string_value (this->section_key_,
- "base_value",
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+
+ if (status == 0)
+ {
+ ACE_Configuration_Section_Key base_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ base_key,
+ 0);
+ this->repo_->config ()->get_string_value (base_key,
+ "id",
holder);
- // Is it our concrete base type?
- if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
- {
- return 1;
+ // Is it our concrete base type?
+ if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
+ {
+ return true;
+ }
}
ACE_Configuration_Section_Key bases_key;
- int status =
+ status =
this->repo_->config ()->open_section (this->section_key_,
"abstract_bases",
0,
@@ -759,7 +769,7 @@ TAO_ValueDef_i::is_a_i (const char *id)
if (status != 0)
{
- return 0;
+ return false;
}
CORBA::ULong count = 0;
@@ -789,11 +799,11 @@ TAO_ValueDef_i::is_a_i (const char *id)
if (success)
{
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
CORBA::ValueDef::FullValueDescription *
@@ -1263,9 +1273,23 @@ TAO_ValueDef_i::describe_value_i (void)
"is_truncatable",
val);
fv_desc->is_truncatable = static_cast<CORBA::Boolean> (val);
- this->repo_->config ()->get_string_value (this->section_key_,
- "base_value",
+ status = this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+
+ if (status == 0)
+ {
+ ACE_Configuration_Section_Key base_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ base_key,
+ 0);
+ this->repo_->config ()->get_string_value (base_key,
+ "id",
holder);
+ }
+
+ // If status isn't 0, then holder will contain empty string anyway.
fv_desc->base_value = holder.fast_rep ();
fv_desc->type = this->type_i ();
@@ -1664,9 +1688,24 @@ TAO_ValueDef_i::fill_value_description (CORBA::ValueDescription &desc)
tmp = this->is_truncatable_i ();
desc.is_truncatable = static_cast<CORBA::Boolean> (tmp);
- this->repo_->config ()->get_string_value (this->section_key_,
- "base_value",
- holder);
+ int status =
+ this->repo_->config ()->get_string_value (this->section_key_,
+ "base_value",
+ holder);
+
+ if (status == 0)
+ {
+ ACE_Configuration_Section_Key base_key;
+ this->repo_->config ()->expand_path (this->repo_->root_key (),
+ holder,
+ base_key,
+ 0);
+ this->repo_->config ()->get_string_value (base_key,
+ "id",
+ holder);
+ }
+
+ // If status isn't 0, then holder will be empty anyway.
desc.base_value = holder.fast_rep ();
}