📄 container_i.cpp
字号:
this->section_key_,
new_key,
id,
name,
version,
is_custom,
is_abstract,
base_value,
is_truncatable,
abstract_base_values,
supported_interfaces
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
TAO_IFR_Generic_Utils<CORBA::InitializerSeq>::set_initializers (
initializers,
this->repo_->config (),
new_key
);
// Create the object reference.
CORBA::Object_var obj =
TAO_IFR_Service_Utils::create_objref (CORBA::dk_Value,
path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueDef::_nil ());
return CORBA::ValueDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
CORBA::ValueBoxDef_ptr
TAO_Container_i::create_value_box (const char *id,
const char *name,
const char *version,
CORBA::IDLType_ptr original_type_def
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD_RETURN (CORBA::ValueBoxDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
return this->create_value_box_i (id,
name,
version,
original_type_def
ACE_ENV_ARG_PARAMETER);
}
CORBA::ValueBoxDef_ptr
TAO_Container_i::create_value_box_i (const char *id,
const char *name,
const char *version,
CORBA::IDLType_ptr original_type_def
ACE_ENV_ARG_DECL )
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_Container_i::tmp_name_holder_ = name;
ACE_Configuration_Section_Key new_key;
ACE_TString path =
TAO_IFR_Service_Utils::create_common (this->def_kind (),
CORBA::dk_ValueBox,
this->section_key_,
new_key,
this->repo_,
id,
name,
&TAO_Container_i::same_as_tmp_name,
version,
"defns"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
// Get the path to our original type and store it.
char *boxed_path =
TAO_IFR_Service_Utils::reference_to_path (original_type_def);
this->repo_->config ()->set_string_value (new_key,
"boxed_type",
boxed_path);
// Create the object reference.
CORBA::Object_var obj =
TAO_IFR_Service_Utils::create_objref (CORBA::dk_ValueBox,
path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ValueBoxDef::_nil ());
return CORBA::ValueBoxDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
CORBA::ExceptionDef_ptr
TAO_Container_i::create_exception (const char *id,
const char *name,
const char *version,
const CORBA::StructMemberSeq &members
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD_RETURN (CORBA::ExceptionDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
return this->create_exception_i (id,
name,
version,
members
ACE_ENV_ARG_PARAMETER);
}
CORBA::ExceptionDef_ptr
TAO_Container_i::create_exception_i (const char *id,
const char *name,
const char *version,
const CORBA::StructMemberSeq &members
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_Container_i::tmp_name_holder_ = name;
ACE_Configuration_Section_Key new_key;
ACE_TString path =
TAO_IFR_Service_Utils::create_common (this->def_kind (),
CORBA::dk_Exception,
this->section_key_,
new_key,
this->repo_,
id,
name,
&TAO_Container_i::same_as_tmp_name,
version,
"defns"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
ACE_Configuration_Section_Key refs_key;
this->repo_->config ()->open_section (new_key,
"refs",
1,
refs_key);
CORBA::ULong count = members.length ();
this->repo_->config ()->set_integer_value (refs_key,
"count",
count);
char *member_path = 0;
// Create a section for each member. We just store the
// member name and the path to its database entry.
for (CORBA::ULong i = 0; i < count; ++i)
{
ACE_Configuration_Section_Key member_key;
char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->open_section (refs_key,
stringified,
1,
member_key);
this->repo_->config ()->set_string_value (member_key,
"name",
members[i].name.in ());
member_path =
TAO_IFR_Service_Utils::reference_to_path (members[i].type_def.in ());
this->repo_->config ()->set_string_value (member_key,
"path",
member_path);
}
// Create the object reference.
CORBA::Object_var obj =
TAO_IFR_Service_Utils::create_objref (CORBA::dk_Exception,
path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::ExceptionDef::_nil ());
return CORBA::ExceptionDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
CORBA::NativeDef_ptr
TAO_Container_i::create_native (const char *id,
const char *name,
const char *version
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD_RETURN (CORBA::NativeDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
return this->create_native_i (id,
name,
version
ACE_ENV_ARG_PARAMETER);
}
CORBA::NativeDef_ptr
TAO_Container_i::create_native_i (const char *id,
const char *name,
const char *version
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_Container_i::tmp_name_holder_ = name;
ACE_Configuration_Section_Key new_key;
ACE_TString path =
TAO_IFR_Service_Utils::create_common (this->def_kind (),
CORBA::dk_Native,
this->section_key_,
new_key,
this->repo_,
id,
name,
&TAO_Container_i::same_as_tmp_name,
version,
"defns"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
// Create the object reference.
CORBA::Object_var obj =
TAO_IFR_Service_Utils::create_objref (CORBA::dk_Native,
path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::NativeDef::_nil ());
return CORBA::NativeDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
CORBA::AbstractInterfaceDef_ptr
TAO_Container_i::create_abstract_interface (
const char *id,
const char *name,
const char *version,
const CORBA::AbstractInterfaceDefSeq &base_interfaces
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD_RETURN (CORBA::AbstractInterfaceDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
return this->create_abstract_interface_i (id,
name,
version,
base_interfaces
ACE_ENV_ARG_PARAMETER);
}
CORBA::AbstractInterfaceDef_ptr
TAO_Container_i::create_abstract_interface_i (
const char *id,
const char *name,
const char *version,
const CORBA::AbstractInterfaceDefSeq &base_interfaces
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_Container_i::tmp_name_holder_ = name;
ACE_Configuration_Section_Key new_key;
ACE_TString path =
TAO_IFR_Service_Utils::create_common (this->def_kind (),
CORBA::dk_AbstractInterface,
this->section_key_,
new_key,
this->repo_,
id,
name,
&TAO_Container_i::same_as_tmp_name,
version,
"defns"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
CORBA::ULong length = base_interfaces.length ();
if (length > 0)
{
// Open a section for the base interfaces.
ACE_Configuration_Section_Key inherited_key;
this->repo_->config ()->open_section (new_key,
"inherited",
1,
inherited_key);
char *inherited_path = 0;
// Store the path to each base interface.
for (CORBA::ULong i = 0; i < length; ++i)
{
inherited_path =
TAO_IFR_Service_Utils::reference_to_path (base_interfaces[i]);
char *stringified = TAO_IFR_Service_Utils::int_to_string (i);
this->repo_->config ()->set_string_value (inherited_key,
stringified,
inherited_path);
}
}
// Create the object reference.
CORBA::Object_var obj =
TAO_IFR_Service_Utils::create_objref (CORBA::dk_AbstractInterface,
path.c_str (),
this->repo_
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::AbstractInterfaceDef::_nil ());
return CORBA::AbstractInterfaceDef::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
}
CORBA::LocalInterfaceDef_ptr
TAO_Container_i::create_local_interface (
const char *id,
const char *name,
const char *version,
const CORBA::InterfaceDefSeq &base_interfaces
ACE_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_IFR_WRITE_GUARD_RETURN (CORBA::LocalInterfaceDef::_nil ());
this->update_key (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::LocalInterfaceDef::_nil ());
return this->create_lo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -