本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr::codec_factory方法的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr::codec_factory方法的具体用法?C++ ORBInitInfo_ptr::codec_factory怎么用?C++ ORBInitInfo_ptr::codec_factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ORBInitInfo_ptr
的用法示例。
在下文中一共展示了ORBInitInfo_ptr::codec_factory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientInterceptor
void
ClientInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info
)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_ptr ci =
PortableInterceptor::ClientRequestInterceptor::_nil ();
try
{
ci = new ClientInterceptor (codec_factory);
}
catch(...)
{
std::cerr << "Exception occurred trying to create ClientInterceptor." << std::endl;
}
PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
ci;
info->add_client_request_interceptor (ci_interceptor.in ());
}
示例2:
void
FOO_IORInterceptor_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
IOP::CodecFactory_var codec_factory =
info->codec_factory ();
// Set up a structure that contains information necessary to
// create a GIOP 1.2 CDR encapsulation Codec.
IOP::Encoding encoding;
encoding.format = IOP::ENCODING_CDR_ENCAPS;
encoding.major_version = 1;
encoding.minor_version = 2;
// Obtain the CDR encapsulation Codec.
IOP::Codec_var codec =
codec_factory->create_codec (encoding);
PortableInterceptor::IORInterceptor_ptr foo;
ACE_NEW_THROW_EX (foo,
FOO_IORInterceptor (codec.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor =
foo;
info->add_ior_interceptor (ior_interceptor.in ());
}
示例3: ClientInterceptor
void
ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_var ci =
new ClientInterceptor (codec_factory);
info->add_client_request_interceptor (ci.in());
}
示例4: ServerInterceptor
void
ServerInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// get reference to the codec_factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ServerRequestInterceptor_var si =
new ServerInterceptor (codec_factory);
info->add_server_request_interceptor (si.in());
// add IOR Interceptor
PortableInterceptor::IORInterceptor_var iori = new ServerIORInterceptor;
info->add_ior_interceptor (iori.in());
}