📄 valuedef_i.cpp
字号:
this->repo_->config ()->get_string_value (initializer_key,
"name",
holder);
retval[i].name = holder.fast_rep ();
status =
this->repo_->config ()->open_section (initializer_key,
"params",
0,
params_key);
if (status != 0)
{
retval[i].members.length (0);
continue;
}
this->repo_->config ()->get_integer_value (params_key,
"count",
arg_count);
retval[i].members.length (arg_count);
CORBA::Object_var obj;
for (CORBA::ULong j = 0; j < arg_count; ++j)
{
stringified = TAO_IFR_Service_Utils::int_to_string (j);
this->repo_->config ()->open_section (params_key,
stringified,
0,
arg_key);
this->repo_->config ()->get_string_value (arg_key,
"arg_name",
holder);
retval[i].members[j].name = holder.fast_rep ();
this->repo_->config ()->get_string_value (arg_key,
"arg_path",
holder);
TAO_IDLType_i *impl =
TAO_IFR_Service_Utils::path_to_idltype (holder,
this->repo_);
retval[i].members[j].type =
impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
obj =
TAO_IFR_Service_Utils::path_to_ir_object (holder,
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
retval[i].members[j].type_def =
CORBA::IDLType::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
}
}
return retval._retn ();
}
void
TAO_ValueDef_i::initializers (const CORBA::InitializerSeq &initializers
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->initializers_i (initializers
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::initializers_i (const CORBA::InitializerSeq &initializers
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->repo_->config ()->remove_section (this->section_key_,
"initializers",
1);
TAO_IFR_Generic_Utils<CORBA::InitializerSeq>::set_initializers (
initializers,
this->repo_->config (),
this->section_key_
);
}
CORBA::ValueDef_ptr
TAO_ValueDef_i::base_value (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_READ_GUARD_RETURN (CORBA::ValueDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
return this->base_value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::ValueDef_ptr
TAO_ValueDef_i::base_value_i (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_TString holder;
int status =
this->repo_->config ()->get_string_value (this->section_key_,
"base_value",
holder);
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,
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
return CORBA::ValueDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::base_value (CORBA::ValueDef_ptr base_value
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->base_value_i (base_value
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::base_value_i (CORBA::ValueDef_ptr base_value
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (CORBA::is_nil (base_value))
{
this->repo_->config ()->remove_value (this->section_key_,
"base_value");
return;
}
const char *base_path =
TAO_IFR_Service_Utils::reference_to_path (base_value);
// Get the servant's key into the temporary key holder, because
// the name clash checker for base valuetypes is static, and has
// no other way to know about a specific key.
this->repo_->config ()->expand_path (
this->repo_->root_key (),
base_path,
TAO_IFR_Service_Utils::tmp_key_,
0
);
TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
this->section_key_,
this->repo_,
CORBA::dk_Value
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
this->repo_->config ()->set_string_value (
this->section_key_,
"base_value",
base_value->_interface_repository_id ()
);
}
CORBA::ValueDefSeq *
TAO_ValueDef_i::abstract_base_values (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_READ_GUARD_RETURN (0);
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
return this->abstract_base_values_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::ValueDefSeq *
TAO_ValueDef_i::abstract_base_values_i (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
CORBA::ValueDefSeq *vd_seq = 0;
ACE_NEW_RETURN (vd_seq,
CORBA::ValueDefSeq,
0);
CORBA::ValueDefSeq_var retval = vd_seq;
ACE_Configuration_Section_Key bases_key;
int status =
this->repo_->config ()->open_section (this->section_key_,
"abstract_bases",
0,
bases_key);
if (status != 0)
{
vd_seq->length (0);
return retval._retn ();
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (bases_key,
"count",
count);
vd_seq->length (count);
char *stringified = 0;
ACE_TString holder;
CORBA::Object_var obj;
for (CORBA::ULong i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->get_string_value (bases_key,
stringified,
holder);
this->repo_->config ()->get_string_value (this->repo_->repo_ids_key (),
holder.fast_rep (),
holder);
obj = TAO_IFR_Service_Utils::path_to_ir_object (holder,
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
retval[i] = CORBA::ValueDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
}
return retval._retn ();
}
void
TAO_ValueDef_i::abstract_base_values (
const CORBA::ValueDefSeq &abstract_base_values
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->abstract_base_values_i (abstract_base_values
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::abstract_base_values_i (
const CORBA::ValueDefSeq &abstract_base_values
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->repo_->config ()->remove_section (this->section_key_,
"abstract_bases",
0);
CORBA::ULong count = abstract_base_values.length ();
if (count == 0)
{
return;
}
ACE_Configuration_Section_Key bases_key;
this->repo_->config ()->open_section (this->section_key_,
"abstract_bases",
0,
bases_key);
this->repo_->config ()->set_integer_value (bases_key,
"count",
count);
const char *base_id = 0;
const char *base_path = 0;
char *stringified = 0;
for (CORBA::ULong i = 0; i < count; ++i)
{
base_path =
TAO_IFR_Service_Utils::reference_to_path (
abstract_base_values[i].in ()
);
// Get the servant's key into the temporary key holder, because
// the name clash checker for base interfaces is static, and has
// no other way to know about a specific key.
this->repo_->config ()->expand_path (
this->repo_->root_key (),
base_path,
TAO_IFR_Service_Utils::tmp_key_,
0
);
TAO_IFR_Service_Utils::name_exists (&TAO_ValueDef_i::name_clash,
this->section_key_,
this->repo_,
CORBA::dk_Value
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
base_id = abstract_base_values[i]->_interface_repository_id ();
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->set_string_value (bases_key,
stringified,
base_id);
}
}
CORBA::Boolean
TAO_ValueDef_i::is_abstract (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_READ_GUARD_RETURN (0);
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
return this->is_abstract_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::Boolean
TAO_ValueDef_i::is_abstract_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
CORBA::ULong is_it = 0;
this->repo_->config ()->get_integer_value (this->section_key_,
"is_abstract",
is_it);
return ACE_static_cast (CORBA::Boolean,
is_it);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -