📄 homedef_i.cpp
字号:
// @@@ (JP) No OMG-defined exception for this, but maybe there
// will be.
}
this->repo_->config ()->set_integer_value (param_key,
"mode",
CORBA::PARAM_IN);
}
}
// Store the operation's exception info.
length = exceptions.length ();
if (length > 0)
{
ACE_Configuration_Section_Key excepts_key;
this->repo_->config ()->open_section (new_key,
"excepts",
1,
excepts_key);
this->repo_->config ()->set_integer_value (excepts_key,
"count",
length);
char *type_path = 0;
for (i = 0; i < length; ++i)
{
type_path =
TAO_IFR_Service_Utils::reference_to_path (exceptions[i].in ());
char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->set_string_value (excepts_key,
stringified,
type_path);
}
}
// Create the object reference.
return
TAO_IFR_Service_Utils::create_objref (created_kind,
result_path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
}
void
TAO_HomeDef_i::fill_op_desc_seq (ACE_Configuration_Section_Key &key,
CORBA::OpDescriptionSeq &ods,
const char *sub_section
ACE_ENV_ARG_DECL)
{
ods.length (0);
ACE_Configuration_Section_Key sub_key;
int status =
this->repo_->config ()->open_section (key,
sub_section,
0,
sub_key);
if (status != 0)
{
return;
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (sub_key,
"count",
count);
ods.length (count);
char *stringified = 0;
for (CORBA::ULong i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->fill_op_desc (sub_key,
ods[i],
stringified
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
}
void
TAO_HomeDef_i::fill_op_desc (ACE_Configuration_Section_Key &key,
CORBA::OperationDescription &od,
const char *sub_section
ACE_ENV_ARG_DECL)
{
ACE_Configuration_Section_Key op_key;
this->repo_->config ()->open_section (key,
sub_section,
0,
op_key);
TAO_IFR_Desc_Utils<CORBA::OperationDescription,
TAO_OperationDef_i>::fill_desc_begin (
od,
this->repo_,
op_key
ACE_ENV_ARG_PARAMETER
);
ACE_CHECK;
ACE_TString result_path;
this->repo_->config ()->get_string_value (key,
"result",
result_path);
TAO_IDLType_i *result =
TAO_IFR_Service_Utils::path_to_idltype (result_path,
this->repo_);
od.result = result->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
TAO_OperationDef_i impl (this->repo_);
impl.section_key (op_key);
od.mode = impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
TAO_IFR_Strseq_Utils<CORBA::ContextIdSeq>::fill_string_seq (
"contexts",
this->repo_->config (),
op_key,
od.contexts
);
this->fill_param_desc_seq (op_key,
od.parameters,
"params"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
this->fill_exc_desc_seq (op_key,
od.exceptions,
"excepts"
ACE_ENV_ARG_PARAMETER);
}
void
TAO_HomeDef_i::fill_param_desc_seq (ACE_Configuration_Section_Key &key,
CORBA::ParDescriptionSeq &pds,
const char *sub_section
ACE_ENV_ARG_DECL)
{
pds.length (0);
ACE_Configuration_Section_Key params_key;
int status =
this->repo_->config ()->open_section (key,
sub_section,
0,
params_key);
if (status != 0)
{
return;
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (params_key,
"count",
count);
pds.length (count);
char *stringified = 0;
for (CORBA::ULong i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->fill_param_desc (params_key,
pds[i],
stringified
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
}
void
TAO_HomeDef_i::fill_param_desc (ACE_Configuration_Section_Key &key,
CORBA::ParameterDescription &pd,
const char *sub_section
ACE_ENV_ARG_DECL)
{
ACE_Configuration_Section_Key param_key;
this->repo_->config ()->open_section (key,
sub_section,
0,
param_key);
ACE_TString holder;
this->repo_->config ()->get_string_value (param_key,
"name",
holder);
pd.name = holder.fast_rep ();
this->repo_->config ()->get_string_value (param_key,
"type_path",
holder);
TAO_IDLType_i *impl = TAO_IFR_Service_Utils::path_to_idltype (holder,
this->repo_);
pd.type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
CORBA::Object_var obj =
TAO_IFR_Service_Utils::path_to_ir_object (holder,
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
pd.type_def = CORBA::IDLType::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::ULong val;
this->repo_->config ()->get_integer_value (param_key,
"mode",
val);
pd.mode = ACE_static_cast (CORBA::ParameterMode,
val);
}
void
TAO_HomeDef_i::fill_exc_desc_seq (ACE_Configuration_Section_Key &key,
CORBA::ExcDescriptionSeq &eds,
const char *sub_section
ACE_ENV_ARG_DECL)
{
eds.length (0);
ACE_Configuration_Section_Key excepts_key;
int status =
this->repo_->config ()->open_section (key,
sub_section,
0,
excepts_key);
if (status != 0)
{
return;
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (excepts_key,
"count",
count);
eds.length (count);
char *stringified = 0;
for (CORBA::ULong i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->fill_exc_desc (excepts_key,
eds[i],
stringified
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
}
void
TAO_HomeDef_i::fill_exc_desc (ACE_Configuration_Section_Key &key,
CORBA::ExceptionDescription &ed,
const char *sub_section
ACE_ENV_ARG_DECL)
{
ACE_TString path;
this->repo_->config ()->get_string_value (key,
sub_section,
path);
// Description information for exceptions refers to the definition, not
// the reference, so we need the extra step to get
// the key of the exception's definition.
ACE_Configuration_Section_Key except_def_key;
this->repo_->config ()->expand_path (this->repo_->root_key (),
path,
except_def_key,
0);
TAO_IFR_Desc_Utils<CORBA::ExceptionDescription,
TAO_ExceptionDef_i>::fill_desc_begin (
ed,
this->repo_,
except_def_key
ACE_ENV_ARG_PARAMETER
);
TAO_ExceptionDef_i impl (this->repo_);
impl.section_key (except_def_key);
ed.type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
void
TAO_HomeDef_i::fill_attr_desc_seq (ACE_Configuration_Section_Key &key,
CORBA::ExtAttrDescriptionSeq &eads,
const char *sub_section
ACE_ENV_ARG_DECL)
{
eads.length (0);
ACE_Configuration_Section_Key attrs_key;
int status =
this->repo_->config ()->open_section (key,
sub_section,
0,
attrs_key);
if (status != 0)
{
return;
}
CORBA::ULong count = 0;
this->repo_->config ()->get_integer_value (attrs_key,
"count",
count);
eads.length (count);
char *stringified = 0;
for (CORBA::ULong i = 0; i < count; ++i)
{
stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->fill_attr_desc (attrs_key,
eads[i],
stringified
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
}
void
TAO_HomeDef_i::fill_attr_desc (ACE_Configuration_Section_Key &key,
CORBA::ExtAttributeDescription &ead,
const char *sub_section
ACE_ENV_ARG_DECL)
{
ACE_Configuration_Section_Key attr_key;
this->repo_->config ()->open_section (key,
sub_section,
0,
attr_key);
TAO_IFR_Desc_Utils<CORBA::ExtAttributeDescription,
TAO_AttributeDef_i>::fill_desc_begin (
ead,
this->repo_,
attr_key
ACE_ENV_ARG_PARAMETER
);
ACE_CHECK;
TAO_AttributeDef_i impl (this->repo_);
impl.section_key (attr_key);
ead.type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
ead.mode = impl.mode_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -