本文整理汇总了C++中corba::String_var::_retn方法的典型用法代码示例。如果您正苦于以下问题:C++ String_var::_retn方法的具体用法?C++ String_var::_retn怎么用?C++ String_var::_retn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::String_var
的用法示例。
在下文中一共展示了String_var::_retn方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//
// name
//
char * DataAcquisitionController_i::name (void)
{
CORBA::String_var str =
CORBA::string_dup (DAC::EXECUTION_CONTEXT::instance ()->name ().c_str ());
return str._retn ();
}
示例2:
void
StringOutTest (CORBA::String_out so)
{
CORBA::String_var sv;
sv = "StringOutTest";
so = sv._retn ();
}
示例3: BAD_PARAM
void
TAO::SL3::CredentialsCurator:: register_acquirer_factory (
const char * acquisition_method,
TAO::SL3::CredentialsAcquirerFactory * factory)
{
if (acquisition_method == 0 || factory == 0)
throw CORBA::BAD_PARAM ();
CORBA::String_var method = CORBA::string_dup (acquisition_method);
ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
const int result =
this->acquirer_factories_.bind (method.in (), factory);
if (result == 1) // Entry already exists in table.
throw CORBA::BAD_INV_ORDER ();
else if (result == -1) // Failure.
throw CORBA::INTERNAL ();
// CredentialsCurator now owns the acquisition method id.
(void) method._retn ();
// Otherwise success!
}
示例4: switch
char *
A_i::method_s (::Test::A::FailOn where,
const char *,
::CORBA::String_out arg2,
char *&arg3)
{
CORBA::String_var res;
switch (where)
{
case ::Test::A::ARG1:
// must be never reached.
break;
case ::Test::A::ARG2:
arg2 = CORBA::string_dup (::Test::FailStr);
break;
case ::Test::A::ARG3:
CORBA::string_free (arg3);
arg3 = CORBA::string_dup (::Test::FailStr);
break;
case ::Test::A::RETN:
res = CORBA::string_dup (::Test::FailStr);
break;
}
return res._retn ();
}
示例5:
char *
Delegated_Bottom_Impl::bottom_quote (void)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Delegating the call: <bottom_quote>\n")));
CORBA::String_var msg =
this->delegate_->bottom_quote ();
return msg._retn ();
}
示例6:
char *
Task::locate (const char *)
{
CORBA::Object_var fwdObj = orb_->string_to_object(anotherIOR);
CORBA::String_var fwdString = orb_->object_to_string(fwdObj.in ());
ACE_DEBUG ((LM_DEBUG,
"IN LOCATOR! Forwarding client to: %C\n",
fwdString.in ()));
return fwdString._retn();
}
示例7:
char *
Inner_i::answer (const char * question)
{
ACE_UNUSED_ARG (question); // doesn't matter
CORBA::String_var answer =
CORBA::string_dup ("I didn't know dogs could talk!");
int delay = 5/this->divisor_; // throw exception if divisor = 0
ACE_OS::sleep(delay); // make the caller wait a bit
return answer._retn();
}
示例8: BadInput
char *
foo_i::foo_op (const char * inarg)
{
CORBA::String_var retval = CORBA::string_dup ("bad");
if (ACE_OS::strcmp (inarg, "foo_op") == 0)
{
retval = CORBA::string_dup ("good");
}
else
{
throw BadInput ("expected \"foo_op\"\n");
}
return retval._retn ();
}
示例9: TRANSIENT
char *
INS_Locator::locate (const char* object_key)
{
ACE_ASSERT (object_key != 0);
try
{
CORBA::String_var located =
this->imr_locator_.activate_server_by_object (object_key);
return located._retn();
}
catch (CORBA::Exception &)
{
throw CORBA::TRANSIENT (CORBA::SystemException::_tao_minor_code
(TAO_IMPLREPO_MINOR_CODE, 0),
CORBA::COMPLETED_NO);
}
}
示例10: NO_MEMORY
char *
Echo_i::echo_string (const char *mesg)
{
// The pointer mesg was NULL, return.
if (mesg == 0)
return 0;
CORBA::String_var str = CORBA::string_dup (mesg);
// if <CORBA::string_dup> returns a 0 pointer, an exception is
// raised.
if (str.in () == 0)
throw CORBA::NO_MEMORY ();
// Got thru! now, make a deep copy of the mesg string and send it
// back to the client.
return str._retn ();
// The _retn is used as it allows the conversion of
// CORBA::String_var to char* without causing any compiler errors.
}
示例11:
//
// result_file
//
char * PingComponent::result_file (void)
{
CORBA::String_var str = CORBA::string_dup (this->result_file_.c_str ());
return str._retn ();
}
示例12: INV_OBJREF
void
TAO::PG_Object_Group_Storable::read (TAO::Storable_Base & stream)
{
stream.rewind ();
ACE_CString group_name;
stream >> group_name;
PG_Object_Group::set_name(group_name.c_str());
stream >> this->distribute_;
stream >> this->role_;
///// primary_location_ /////
read_cdr (stream, this->primary_location_);
///// reference_ /////
ACE_CString reference_ior;
stream >> reference_ior;
this->reference_ = this->orb_->string_to_object (reference_ior.c_str ());
///// tagged_component_ /////
read_cdr (stream, this->tagged_component_);
///// type_id_ /////
// special note: A memory leak appears when the type_id_ is read into directly.
// reading into a temporary string and handing that to the type_id_ does not leak.
CORBA::String_var tmp;
read_cdr(stream, tmp);
this->type_id_ = tmp._retn();
///// properties_ /////
PortableGroup::Criteria properties;
read_cdr (stream, properties);
PG_Object_Group::set_properties_dynamically (properties);
///// members_ /////
int num_members;
stream >> num_members;
if (num_members == 0)
this->empty_ = 1;
else
this->empty_ = 0;
this->clear_members_map ();
for (int i = 0; i < num_members; ++i)
{
///// location used as members_ key /////
PortableGroup::Location the_location;
read_cdr (stream, the_location);
///// member /////
ACE_CString member_ior;
stream >> member_ior;
CORBA::Object_var member =
this->orb_->string_to_object (member_ior.c_str ());
if (CORBA::is_nil (member.in ()))
{
if (TAO_debug_level > 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) PG_Object_Group_Storable::")
ACE_TEXT ("string_to_object failed\n")));
}
throw CORBA::INV_OBJREF ();
}
///// location /////
PortableGroup::Location location;
read_cdr (stream, location);
///// factory /////
ACE_CString factory_ior;
stream >> factory_ior;
CORBA::Object_var obj =
this->orb_->string_to_object (factory_ior.c_str ());
PortableGroup::GenericFactory_var factory =
PortableGroup::GenericFactory::_narrow (obj.in());
///// factory_id (typedef of CORBA::Any) /////
PortableGroup::GenericFactory::FactoryCreationId factory_id;
read_cdr (stream, factory_id);
///// is_primary /////
int is_primary;
stream >> is_primary;
MemberInfo * info = 0;
ACE_NEW_THROW_EX (info, MemberInfo(member.in (),
the_location,
factory.in (),
factory_id),
CORBA::NO_MEMORY());
info->is_primary_ = is_primary;
if (this->members_.bind (the_location, info) != 0)
//.........这里部分代码省略.........
示例13: str
char *get_string ()
{
CORBA::String_var str ("hello");
return str._retn ();
}