policys.cpp

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C++ 代码 · 共 1,633 行 · 第 1/3 页

CPP
1,633
字号
private:
  POA_CORBA::Policy *_tao_impl;

};

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/interceptors_ss.cpp:438

TAO_ServerRequestInfo_CORBA_Policy_destroy::TAO_ServerRequestInfo_CORBA_Policy_destroy (
    TAO_ServerRequest &_tao_server_request,
    TAO_Object_Adapter::Servant_Upcall *_tao_servant_upcall,
    POA_CORBA::Policy *tao_impl
    ACE_ENV_ARG_DECL_NOT_USED
  )
  : TAO_ServerRequestInfo (_tao_server_request, _tao_servant_upcall),
    _tao_impl (tao_impl)
{}

Dynamic::ParameterList *
TAO_ServerRequestInfo_CORBA_Policy_destroy::arguments (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // Generate the argument list on demand.
  Dynamic::ParameterList *parameter_list =
    TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK_RETURN (0);

  return parameter_list;
}

Dynamic::ExceptionList *
TAO_ServerRequestInfo_CORBA_Policy_destroy::exceptions (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // Generate the exception list on demand.
  Dynamic::ExceptionList *exception_list =
    TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK_RETURN (0);

  return exception_list;
}

CORBA::Any *
TAO_ServerRequestInfo_CORBA_Policy_destroy::result (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // Generate the result on demand.
  CORBA::Boolean tk_void_any = 1;
  CORBA::Any *result_any =
    TAO_RequestInfo_Util::make_any (tk_void_any ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (0);

  return result_any;
}

char *
TAO_ServerRequestInfo_CORBA_Policy_destroy::target_most_derived_interface (
    ACE_ENV_SINGLE_ARG_DECL_NOT_USED
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return
    CORBA::string_dup (this->_tao_impl->_interface_repository_id ());
}

CORBA::Boolean
TAO_ServerRequestInfo_CORBA_Policy_destroy::target_is_a (
    const char * id
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER);
}

#endif /* TAO_HAS_INTERCEPTORS */

///////////////////////////////////////////////////////////////////////
//            Strategized Proxy Broker Implementation
//

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/strategized_proxy_broker_ss.cpp:40

// Factory function Implementation.
POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker *
POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker (void)
{
  static POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker strategized_proxy_broker;
  return &strategized_proxy_broker;
}

POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::_TAO_Policy_Strategized_Proxy_Broker (void)
{
}

POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::~_TAO_Policy_Strategized_Proxy_Broker (void)
{
}

TAO::Collocation_Strategy
POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::get_strategy (
    CORBA::Object_ptr obj
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  TAO::Collocation_Strategy strategy =
    TAO_ORB_Core::collocation_strategy (obj ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (TAO::TAO_CS_REMOTE_STRATEGY);

  return strategy;
}

void
POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch (
    CORBA::Object_ptr obj,
    CORBA::Object_out forward_obj,
    TAO::Argument ** args,
    int num_args,
    const char * op,
    size_t op_len,
    TAO::Collocation_Strategy strategy
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((CORBA::Exception))
{
  TAO_Object_Adapter::Servant_Upcall servant_upcall (
      obj->_stubobj ()->servant_orb_var ()->orb_core ()
    );

  if (strategy == TAO::TAO_CS_THRU_POA_STRATEGY)
   {
    servant_upcall.prepare_for_upcall (
    obj->_stubobj ()->object_key (),
      op,
      forward_obj
      ACE_ENV_ARG_PARAMETER
      );
    ACE_CHECK;

    servant_upcall.pre_invoke_collocated_request (
    ACE_ENV_SINGLE_ARG_PARAMETER);
    ACE_CHECK;
  }

TAO_Collocated_Skeleton collocated_skel;

if (servant_upcall.servant ()->_find (op,
      collocated_skel,
      strategy,
      op_len) == -1)
  ACE_THROW (CORBA::BAD_OPERATION ());

ACE_TRY
  {
    collocated_skel (
      servant_upcall.servant (),
      args,
      num_args
      ACE_ENV_ARG_PARAMETER);
    ACE_TRY_CHECK;
  }
#if (TAO_HAS_MINIMUM_CORBA == 0)
ACE_CATCH (PortableServer::ForwardRequest, forward_request)
  {
    forward_obj =
      CORBA::Object::_duplicate (forward_request.forward_reference.in ());
    return;
  }
#else
ACE_CATCHANY
  {
    ACE_UNUSED_ARG (forward_obj);
    ACE_RE_THROW;
  }
#endif /* TAO_HAS_MINIMUM_CORBA */
ACE_ENDTRY;
ACE_CHECK;
}

//
//        End Strategized Proxy Broker Implementation
///////////////////////////////////////////////////////////////////////

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ss.cpp:600

TAO::Collocation_Proxy_Broker *
CORBA__TAO_Policy_Proxy_Broker_Factory_function (CORBA::Object_ptr)
{
  return
    ::POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker();
}

int
CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer (size_t)
{
  CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer =
    CORBA__TAO_Policy_Proxy_Broker_Factory_function;

  return 0;
}

static int
CORBA__TAO_Policy_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
  CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer (
      ACE_reinterpret_cast (
          size_t,
          CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer
        )
    );


///////////////////////////////////////////////////////////////////////
//                 ThruPOA Proxy  Implementation
//

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/thru_poa_proxy_impl_ss.cpp:37

POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::_TAO_Policy_ThruPOA_Proxy_Impl (void)
{}

// ThruPOA Implementation of the IDL interface methods

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52

void
POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::_get_policy_type (
    TAO_Abstract_ServantBase *servant,
    TAO::Argument ** args,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ((TAO::Arg_Traits<CORBA::PolicyType>::ret_val *) args[0])->arg () =
    ACE_reinterpret_cast (
        POA_CORBA::Policy_ptr,
        servant->_downcast (
            "IDL:omg.org/CORBA/Policy:1.0"
          )
      )->policy_type (
          ACE_ENV_SINGLE_ARG_PARAMETER
        );
  ACE_CHECK;
}

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52

void
POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::copy (
    TAO_Abstract_ServantBase *servant,
    TAO::Argument ** args,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ((TAO::Arg_Traits<CORBA::Policy>::ret_val *) args[0])->arg () =
    ACE_reinterpret_cast (
        POA_CORBA::Policy_ptr,
        servant->_downcast (
            "IDL:omg.org/CORBA/Policy:1.0"
          )
      )->copy (
          ACE_ENV_SINGLE_ARG_PARAMETER
        );
  ACE_CHECK;
}

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/thru_poa_proxy_impl_ss.cpp:52

void
POA_CORBA::_TAO_Policy_ThruPOA_Proxy_Impl::destroy (
    TAO_Abstract_ServantBase *servant,
    TAO::Argument **,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ACE_reinterpret_cast (
      POA_CORBA::Policy_ptr,
      servant->_downcast (
          "IDL:omg.org/CORBA/Policy:1.0"
        )
    )->destroy (
        ACE_ENV_SINGLE_ARG_PARAMETER
      );
  ACE_CHECK;
}

//
//           End ThruPOA Proxy Implementation
///////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////
//                 Direct Proxy  Implementation
//

POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_TAO_Policy_Direct_Proxy_Impl (void)
{}

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/direct_proxy_impl_ss.cpp:42

void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type (
    TAO_Abstract_ServantBase  *servant,
    TAO::Argument ** args,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ((TAO::Arg_Traits<CORBA::PolicyType>::ret_val *) args[0])->arg () =
    ACE_reinterpret_cast (
        POA_CORBA::Policy_ptr,
        servant->_downcast (
            "IDL:omg.org/CORBA/Policy:1.0"
          )
      )->policy_type (
          ACE_ENV_SINGLE_ARG_PARAMETER
        );
  ACE_CHECK;
}// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/direct_proxy_impl_ss.cpp:42

void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy (
    TAO_Abstract_ServantBase  *servant,
    TAO::Argument ** args,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ((TAO::Arg_Traits<CORBA::Policy>::ret_val *) args[0])->arg () =
    ACE_reinterpret_cast (
        POA_CORBA::Policy_ptr,
        servant->_downcast (
            "IDL:omg.org/CORBA/Policy:1.0"
          )
      )->copy (
          ACE_ENV_SINGLE_ARG_PARAMETER
        );
  ACE_CHECK;
}// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/direct_proxy_impl_ss.cpp:42

void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy (
    TAO_Abstract_ServantBase  *servant,
    TAO::Argument **,
    int
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  ACE_reinterpret_cast (
      POA_CORBA::Policy_ptr,
      servant->_downcast (
          "IDL:omg.org/CORBA/Policy:1.0"
        )
    )->destroy (
        ACE_ENV_SINGLE_ARG_PARAMETER
      );
  ACE_CHECK;
}

//
//           End Direct Proxy Implementation
///////////////////////////////////////////////////////////////////////

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ss.cpp:97

POA_CORBA::Policy::Policy (void)
{
  this->optable_ = &tao_CORBA_Policy_optable;
}

POA_CORBA::Policy::Policy (const Policy& rhs)
  : TAO_Abstract_ServantBase (rhs),
    TAO_ServantBase (rhs)
{
}

POA_CORBA::Policy::~Policy (void)
{
}

// TAO_IDL - Generated from
// C:\work\ACE+TAO\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ss.cpp:98

void POA_CORBA::Policy::_get_policy_type_skel (
    TAO_ServerRequest &_tao_server_request,
    void *_tao_servant,
    void *_tao_servant_upcall
    ACE_ENV_ARG_DECL
  )
{
  POA_CORBA::Policy *_tao_impl =
    ACE_static_cast (
        POA_CORBA::Policy *,
        _tao_servant
      );
  CORBA::PolicyType _tao_retval = 0;

#if (TAO_HAS_INTERCEPTORS == 1)
  TAO_Object_Adapter::Servant_Upcall *_tao_upcall =
    ACE_static_cast (TAO_Object_Adapter::Servant_Upcall *, _tao_servant_upcall);

  TAO_ServerRequestInterceptor_Adapter _tao_vfr (
      _tao_server_request.orb_core ()->server_request_interceptors (),
      _tao_server_request.interceptor_count ()
    );

  TAO_ServerRequestInfo_CORBA_Policy_policy_type_get _tao_ri (
      _tao_server_request,
      _tao_upcall,
      _tao_impl
      ACE_ENV_ARG_PARAMETER
    );

  ACE_TRY
    {
      {
        TAO_PICurrent_Guard _tao_pi_guard (_tao_ri.server_request (),
                                           1  /* Copy TSC to RSC */);

        _tao_vfr.receive_request (&_tao_ri ACE_ENV_ARG_PARAMETER);
        ACE_TRY_CHECK;

        if (!_tao_vfr.location_forwarded ())
          {

#endif /* TAO_HAS_INTERCEPTORS */
            _tao_retval =
            _tao_impl->policy_type (

                ACE_ENV_SINGLE_ARG_PARAMETER
              );
            TAO_INTERCEPTOR_CHECK;

#if (TAO_HAS_INTERCEPTORS == 1)

          }
      }

      if (!_tao_vfr.location_forwarded ())
        {
          CORBA::PolicyType _tao_retval_info = _tao_retval;
          _tao_ri.result (_tao_retval_info);
          _tao_ri.reply_status (PortableInterceptor::SUCCESSFUL);
          _tao_vfr.send_reply (&_tao_ri ACE_ENV_ARG_PARAMETER);
          ACE_TRY_CHECK;
        }
    }
  ACE_CATCHANY
    {
      _tao_ri.exception (&ACE_ANY_EXCEPTION);
      _tao_vfr.send_exception (
          &_tao_ri
          ACE_ENV_ARG_PARAMETER
        );
      ACE_TRY_CHECK;

      PortableInterceptor::ReplyStatus _tao_status =
        _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER);
      ACE_TRY_CHECK;

      if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION
          || _tao_status == PortableInterceptor::USER_EXCEPTION)
        {
          ACE_RE_THROW;
        }
    }

# if defined (ACE_HAS_EXCEPTIONS) \
     && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
  ACE_CATCHALL
    {
      CORBA::UNKNOWN ex;

      _tao_ri.exception (&ex);
      _tao_vfr.send_exception (
          &_tao_ri
          ACE_ENV_ARG_PARAMETER
        );
      ACE_TRY_CHECK;

      PortableInterceptor::ReplyStatus _tao_status =
        _tao_ri.reply_status (ACE_ENV_SINGLE_ARG_PARAMETER);
      ACE_TRY_CHECK;

      if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION)
        ACE_TRY_THROW (ex);
    }
# endif  /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */

  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

  _tao_server_request.init_reply ();

  TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();

  if (!(
      (_tao_out << _tao_retval)
      ))
      {

        TAO_OutputCDR::throw_skel_exception (errno ACE_ENV_ARG_PARAMETER);
        ACE_CHECK;
      }


  // In case _tao_servant_upcall is not used in this function
  ACE_UNUSED_ARG (_tao_servant_upcall);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?