本文整理汇总了C++中TAO_ServerRequest::init_reply方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_ServerRequest::init_reply方法的具体用法?C++ TAO_ServerRequest::init_reply怎么用?C++ TAO_ServerRequest::init_reply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_ServerRequest
的用法示例。
在下文中一共展示了TAO_ServerRequest::init_reply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TAO_AMH_Skeletons::_interface_amh_skel (TAO_ServerRequest & server_request,
TAO::Portable_Server::Servant_Upcall* /* servant_upcall */,
TAO_ServantBase *servant)
{
TAO_IFR_Client_Adapter *_tao_adapter =
ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
TAO_ORB_Core::ifr_client_adapter_name ());
if (!_tao_adapter)
{
throw ::CORBA::INTF_REPOS (::CORBA::OMGVMCID | 1, ::CORBA::COMPLETED_NO);
}
::CORBA::InterfaceDef_ptr _tao_retval = servant->_get_interface ();
server_request.init_reply ();
TAO_OutputCDR &_tao_out = *server_request.outgoing ();
::CORBA::Boolean const _tao_result =
_tao_adapter->interfacedef_cdr_insert (_tao_out, _tao_retval);
_tao_adapter->dispose (_tao_retval);
if (!_tao_result)
{
throw ::CORBA::MARSHAL ();
}
}
示例2: _interface_skel
void POA_Echo::_interface_skel (
TAO_ServerRequest & server_request,
void * /* servant_upcall */,
void * servant)
{
TAO_IFR_Client_Adapter *_tao_adapter =
ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
TAO_ORB_Core::ifr_client_adapter_name ()
);
if (_tao_adapter == 0)
{
throw ::CORBA::INTF_REPOS (::CORBA::OMGVMCID | 1, ::CORBA::COMPLETED_NO);
}
POA_Echo * const impl =
static_cast<POA_Echo *> (servant);
::CORBA::InterfaceDef_ptr _tao_retval = impl->_get_interface ();
server_request.init_reply ();
TAO_OutputCDR &_tao_out = *server_request.outgoing ();
::CORBA::Boolean const _tao_result =
_tao_adapter->interfacedef_cdr_insert (_tao_out, _tao_retval);
_tao_adapter->dispose (_tao_retval);
if (_tao_result == false)
{
throw ::CORBA::MARSHAL ();
}
}
示例3: if
void
DSI_Simple_Server::_dispatch (TAO_ServerRequest &request, TAO::Portable_Server::Servant_Upcall *)
{
// No need to do any of this if the client isn't waiting.
if (request.response_expected ())
{
if (!CORBA::is_nil (request.forward_location ()))
{
request.init_reply ();
request.tao_send_reply ();
// No need to invoke in this case.
return;
}
else if (request.sync_with_server ())
{
// The last line before the call to this function
// was an ACE_CHECK_RETURN, so if we're here, we
// know there is no exception so far, and that's all
// a SYNC_WITH_SERVER client request cares about.
request.send_no_exception_reply ();
}
}
// Create DSI request object.
CORBA::ServerRequest *dsi_request = 0;
ACE_NEW (dsi_request,
CORBA::ServerRequest (request));
try
{
TAO_AMH_DSI_Response_Handler_ptr rh_ptr;
ACE_NEW (rh_ptr, TAO_AMH_DSI_Response_Handler(request));
TAO_AMH_DSI_Response_Handler_var rh(rh_ptr);
rh->init (request, 0);
// Delegate to user.
this->invoke (dsi_request, rh.in());
}
catch (const CORBA::Exception& ex)
{
// Only if the client is waiting.
if (request.response_expected () && !request.sync_with_server ())
{
request.tao_send_reply_exception (ex);
}
}
CORBA::release (dsi_request);
}
示例4: if
void
TAO_DynamicImplementation::_dispatch (
TAO_ServerRequest &request,
TAO::Portable_Server::Servant_Upcall * /* context */)
{
// No need to do any of this if the client isn't waiting.
if (request.response_expected ())
{
if (request.is_forwarded ())
{
request.init_reply ();
request.tao_send_reply ();
// No need to invoke in this case.
return;
}
else if (request.sync_with_server ())
{
// The last line before the call to this function
// was an ACE_CHECK_RETURN, so if we're here, we
// know there is no exception so far, and that's all
// a SYNC_WITH_SERVER client request cares about.
request.send_no_exception_reply ();
}
}
// Create DSI request object.
CORBA::ServerRequest *dsi_request = 0;
ACE_NEW (dsi_request,
CORBA::ServerRequest (request));
try
{
// Delegate to user.
this->invoke (dsi_request);
// Only if the client is waiting.
if (request.response_expected () && !request.sync_with_server ())
{
dsi_request->dsi_marshal ();
}
}
catch (::CORBA::Exception& ex)
{
// Only if the client is waiting.
if (request.response_expected () && !request.sync_with_server ())
{
if (request.collocated ()
&& request.operation_details ()->cac () != 0)
{
// If we have a cac it will handle the exception and no
// need to do any further processing
request.operation_details ()->cac ()->handle_corba_exception (
request, &ex);
return;
}
else
request.tao_send_reply_exception (ex);
}
}
::CORBA::release (dsi_request);
}