本文整理汇总了C++中TAO_InputCDR::start方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_InputCDR::start方法的具体用法?C++ TAO_InputCDR::start怎么用?C++ TAO_InputCDR::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_InputCDR
的用法示例。
在下文中一共展示了TAO_InputCDR::start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
Test::AMI_ControllerHandler::worker_finished_reply_stub (
TAO_InputCDR &_tao_in,
::Messaging::ReplyHandler_ptr _tao_reply_handler,
::CORBA::ULong reply_status)
{
// Retrieve Reply Handler object.
Test::AMI_ControllerHandler_var _tao_reply_handler_object =
Test::AMI_ControllerHandler::_narrow (_tao_reply_handler);
// Exception handling
switch (reply_status)
{
case TAO_AMI_REPLY_OK:
{
// Demarshall all the arguments.
// Invoke the call back method.
_tao_reply_handler_object->worker_finished (
);
break;
}
case TAO_AMI_REPLY_USER_EXCEPTION:
case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
{
const ACE_Message_Block* cdr = _tao_in.start ();
::CORBA::OctetSeq _tao_marshaled_exception (
static_cast <CORBA::ULong> (cdr->length ()),
static_cast <CORBA::ULong> (cdr->length ()),
reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
0
);
::Messaging::ExceptionHolder* exception_holder_ptr = 0;
ACE_NEW (
exception_holder_ptr,
::TAO::ExceptionHolder (
(reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
_tao_in.byte_order (),
_tao_marshaled_exception,
0,
0,
_tao_in.char_translator (),
_tao_in.wchar_translator ())
);
::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
_tao_reply_handler_object->worker_finished_excep (
exception_holder_var
);
break;
}
case TAO_AMI_REPLY_NOT_OK:
// @@ Michael: Not even the spec mentions this case.
// We have to think about this case.
break;
}
}
示例2:
bool
Lorica::EvaluatorBase::evaluate_exception(const char *,
PortableServer::POA_ptr,
const char *ex_type,
TAO_InputCDR &incoming,
TAO_OutputCDR &encap ) const
{
const ACE_Message_Block *buffer = incoming.start();
encap << ex_type;
encap.write_octet_array_mb (buffer);
return true;
}
示例3: switch
void
TAO_AMH_DSI_Response_Handler::gateway_exception_reply (
CORBA::ULong reply_status,
TAO_InputCDR &encap)
{
// for this to be effective, ACE & TAO must be built with
// ACE_ENABLE_SWAP_ON_WRITE defined in ace/config.h
this->_tao_out.reset_byte_order(encap.byte_order());
// This reply path handles only user exceptions.
switch (reply_status)
{
//case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION:
case TAO_AMI_REPLY_USER_EXCEPTION:
this->reply_status_ = GIOP::USER_EXCEPTION;
break;
case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
this->reply_status_ = GIOP::SYSTEM_EXCEPTION;
break;
// we don't handle location forward at this moment.
// need to be addressed later.
//
//case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD:
// this->exception_type_ = TAO_GIOP_LOCATION_FORWARD;
// break;
}
try
{
this->_tao_rh_init_reply ();
// We know nothing about this exception, so we marshal it as a block
// of bytes. The outgoing stream's byte order has already been matched
// to the original source of the reply.
this->_tao_out.write_octet_array_mb (encap.start());
// This will prevent the marshaling of any parameters into this reply.
// this->sent_gateway_exception_ = 1;
this->_tao_rh_send_reply ();
}
catch (const CORBA::Exception &)
{
// TODO:
}
}
示例4: if
CORBA::Boolean
TAO_ChunkInfo::skip_chunks (TAO_InputCDR &strm)
{
if (!this->chunking_)
{
return 1;
}
// This function is called after reading data of the truncated parent and
// skips the remaining chunks until the outmost endtag (-1).
// The tag read here is suppoused to be an endtag.
CORBA::Long tag;
if (!strm.read_long(tag))
{
return 0;
}
// end of the whole valuetype.
if (tag == -1)
{
return 1;
}
else if (tag < 0)
{
// continue skip the chunk.
return this->skip_chunks (strm);
}
else if (tag < TAO_OBV_GIOP_Flags::Value_tag_base)
{
// Read the chunk size and move forward to skip the data.
ACE_Message_Block* current =
const_cast<ACE_Message_Block*>(strm.start ());
current->rd_ptr (tag);
return this->skip_chunks (strm);
}
else
return 0;
}
示例5: mon
Invocation_Status
DII_Invocation::handle_user_exception (TAO_InputCDR &cdr)
{
Reply_Guard mon (this, TAO_INVOKE_FAILURE);
if (TAO_debug_level > 3)
{
TAOLIB_DEBUG ((LM_DEBUG,
"TAO (%P|%t) - DII_Invocation::"
"handle_user_exception\n"));
}
// Match the exception interface repository id with the
// exception in the exception list.
// This is important to decode the exception.
CORBA::String_var buf;
TAO_InputCDR tmp_stream (cdr,
cdr.start ()->length (),
0);
// Pull the exception ID out of the marshaling buffer.
if (tmp_stream.read_string (buf.inout ()) == 0)
{
throw ::CORBA::MARSHAL (TAO::VMCID, CORBA::COMPLETED_YES);
}
for (CORBA::ULong i = 0;
this->excp_list_ != 0 && i < this->excp_list_->count ();
i++)
{
CORBA::TypeCode_var tc = this->excp_list_->item (i);
const char *xid = tc->id ();
if (ACE_OS::strcmp (buf.in (), xid) != 0)
{
continue;
}
CORBA::Any any;
TAO::Unknown_IDL_Type *unk = 0;
ACE_NEW_RETURN (unk,
TAO::Unknown_IDL_Type (
tc.in (),
cdr
),
TAO_INVOKE_FAILURE);
any.replace (unk);
mon.set_status (TAO_INVOKE_USER_EXCEPTION);
throw ::CORBA::UnknownUserException (any);
}
// If we couldn't find the right exception, report it as
// CORBA::UNKNOWN.
// But first, save the user exception in case we
// are being used in a TAO gateway.
this->host_->raw_user_exception (cdr);
mon.set_status (TAO_INVOKE_USER_EXCEPTION);
// @@ It would seem that if the remote exception is a
// UserException we can assume that the request was
// completed.
throw ::CORBA::UNKNOWN (TAO::VMCID, CORBA::COMPLETED_YES);
}