📄 valuedef_i.cpp
字号:
void
TAO_ValueDef_i::is_abstract (CORBA::Boolean is_abstract
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->is_abstract (is_abstract
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::is_abstract_i (CORBA::Boolean is_abstract
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->repo_->config ()->set_integer_value (
this->section_key_,
"is_abstract",
ACE_static_cast (CORBA::ULong,
is_abstract));
}
CORBA::Boolean
TAO_ValueDef_i::is_custom (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_custom_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::Boolean
TAO_ValueDef_i::is_custom_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_custom",
is_it);
return ACE_static_cast (CORBA::Boolean,
is_it);
}
void
TAO_ValueDef_i::is_custom (CORBA::Boolean is_custom
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->is_custom_i (is_custom
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::is_custom_i (CORBA::Boolean is_custom
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->repo_->config ()->set_integer_value (
this->section_key_,
"is_custom",
ACE_static_cast (CORBA::ULong,
is_custom));
}
CORBA::Boolean
TAO_ValueDef_i::is_truncatable (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_truncatable_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::Boolean
TAO_ValueDef_i::is_truncatable_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_truncatable",
is_it);
return ACE_static_cast (CORBA::Boolean,
is_it);
}
void
TAO_ValueDef_i::is_truncatable (CORBA::Boolean is_truncatable
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD;
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
this->is_truncatable_i (is_truncatable
ACE_ENV_ARG_PARAMETER);
}
void
TAO_ValueDef_i::is_truncatable_i (CORBA::Boolean is_truncatable
ACE_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->repo_->config ()->set_integer_value (
this->section_key_,
"is_truncatable",
ACE_static_cast (CORBA::ULong,
is_truncatable));
}
CORBA::Boolean
TAO_ValueDef_i::is_a (const char *id
ACE_ENV_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_a_i (id
ACE_ENV_ARG_PARAMETER);
}
CORBA::Boolean
TAO_ValueDef_i::is_a_i (const char *id
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (ACE_OS::strcmp (id, "IDL:omg.org/CORBA/ValueBase:1.0") == 0)
{
return 1;
}
ACE_TString holder;
this->repo_->config ()->get_string_value (this->section_key_,
"id",
holder);
// Is it our type?
if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
{
return 1;
}
this->repo_->config ()->get_string_value (this->section_key_,
"base_value",
holder);
// Is it our concrete base type?
if (ACE_OS::strcmp (holder.fast_rep (), id) == 0)
{
return 1;
}
ACE_Configuration_Section_Key bases_key;
int status =
this->repo_->config ()->open_section (this->section_key_,
"abstract_bases",
0,
bases_key);
if (status != 0)
{
return 0;
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (bases_key,
"count",
count);
char *stringified = 0;
ACE_Configuration_Section_Key base_key;
CORBA::Boolean success = 0;
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);
this->repo_->config ()->expand_path (this->repo_->root_key (),
holder,
base_key,
0);
TAO_ValueDef_i impl (this->repo_);
impl.section_key (base_key);
success = impl.is_a_i (id
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
if (success)
{
return 1;
}
}
return 0;
}
CORBA::ValueDef::FullValueDescription *
TAO_ValueDef_i::describe_value (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->describe_value_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
CORBA::ValueDef::FullValueDescription *
TAO_ValueDef_i::describe_value_i (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
CORBA::ValueDef::FullValueDescription *fv_desc = 0;
ACE_NEW_RETURN (fv_desc,
CORBA::ValueDef::FullValueDescription,
0);
CORBA::ValueDef::FullValueDescription_var retval = fv_desc;
ACE_TString holder;
this->repo_->config ()->get_string_value (this->section_key_,
"name",
holder);
fv_desc->name = holder.fast_rep ();
this->repo_->config ()->get_string_value (this->section_key_,
"id",
holder);
fv_desc->id = holder.fast_rep ();
CORBA::ULong val = 0;
this->repo_->config ()->get_integer_value (this->section_key_,
"is_abstract",
val);
fv_desc->is_abstract = ACE_static_cast (CORBA::Boolean, val);
this->repo_->config ()->get_integer_value (this->section_key_,
"is_custom",
val);
fv_desc->is_custom = ACE_static_cast (CORBA::Boolean, val);
this->repo_->config ()->get_string_value (this->section_key_,
"container_id",
holder);
fv_desc->defined_in = holder.fast_rep ();
this->repo_->config ()->get_string_value (this->section_key_,
"version",
holder);
fv_desc->version = holder.fast_rep ();
// Operations.
fv_desc->operations.length (0);
ACE_Configuration_Section_Key ops_key;
int status =
this->repo_->config ()->open_section (this->section_key_,
"ops",
0,
ops_key);
CORBA::ULong count = 0;
CORBA::ULong param_count = 0;
char *stringified = 0;
CORBA::ULong i = 0;
CORBA::ULong j = 0;
TAO_IDLType_i *idl_type = 0;
CORBA::Object_var obj;
if (status == 0)
{
this->repo_->config ()->get_integer_value (ops_key,
"count",
count);
fv_desc->operations.length (count);
ACE_Configuration_Section_Key op_key, result_key, contexts_key;
ACE_Configuration_Section_Key params_key, excepts_key;
for (i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->open_section (ops_key,
stringified,
0,
op_key);
this->repo_->config ()->get_string_value (op_key,
"name",
holder);
fv_desc->operations[i].name = holder.fast_rep ();
this->repo_->config ()->get_string_value (op_key,
"id",
holder);
fv_desc->operations[i].id = holder.fast_rep ();
this->repo_->config ()->get_string_value (this->section_key_,
"id",
holder);
fv_desc->operations[i].defined_in = holder.fast_rep ();
this->repo_->config ()->get_string_value (op_key,
"result",
holder);
idl_type =
TAO_IFR_Service_Utils::path_to_idltype (holder,
this->repo_);
fv_desc->operations[i].result =
idl_type->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
this->repo_->config ()->get_integer_value (op_key,
"mode",
val);
fv_desc->operations[i].mode = ACE_static_cast (CORBA::OperationMode,
val);
CORBA::TCKind kind =
fv_desc->operations[i].result->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
if (fv_desc->operations[i].mode == CORBA::OP_ONEWAY
&& kind != CORBA::tk_void)
{
ACE_THROW_RETURN (CORBA::BAD_PARAM (31,
CORBA::COMPLETED_NO),
0);
}
// Operation contexts.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -