📄 server.cpp
字号:
test_i (this->orb_.in (),
poa.in (),
TAO_INVALID_PRIORITY,
TAO_INVALID_PRIORITY),
CORBA::NO_MEMORY ());
ACE_CHECK;
PortableServer::ServantBase_var safe_servant (servant);
test_var test =
servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
write_iors_to_file (test.in (),
this->orb_.in (),
"child"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_default_pool_poa (CORBA::Short server_priority,
CORBA::Short client_priority,
server::test_function function,
const char *test_name
ACE_ENV_ARG_DECL)
{
CORBA::PolicyList empty_policies;
(this->*function) (empty_policies,
server_priority,
client_priority,
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_bands_poa (CORBA::PolicyList &policies,
CORBA::Short server_priority,
CORBA::Short client_priority,
server::test_function function,
const char *test_name
ACE_ENV_ARG_DECL)
{
RTCORBA::PriorityBands bands;
bands.length (3);
bands[0].low = default_thread_priority;
bands[0].high = default_thread_priority;
bands[1].low = ::server_priority - 1;
bands[1].high = ::server_priority + 1;
bands[2].low = ::client_priority - 1;
bands[2].high = ::client_priority + 1;
policies.length (policies.length () + 1);
policies[policies.length () - 1] =
this->rt_orb_->create_priority_banded_connection_policy (bands
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
(this->*function) (policies,
server_priority,
client_priority,
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_no_lanes_poa (CORBA::Short server_priority,
CORBA::Short client_priority,
server::test_function function,
const char *test_name
ACE_ENV_ARG_DECL)
{
RTCORBA::ThreadpoolId threadpool_id =
this->rt_orb_->create_threadpool (stacksize,
static_threads,
dynamic_threads,
default_thread_priority,
allow_request_buffering,
max_buffered_requests,
max_request_buffer_size
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::Policy_var threadpool_policy =
this->rt_orb_->create_threadpool_policy (threadpool_id
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::PolicyList policies;
policies.length (1);
policies[0] =
threadpool_policy;
(this->*function) (policies,
server_priority,
client_priority,
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_lanes_poa (CORBA::Short server_priority,
CORBA::Short client_priority,
server::test_function function,
const char *test_name
ACE_ENV_ARG_DECL)
{
RTCORBA::ThreadpoolLanes lanes;
lanes.length (3);
lanes[0].lane_priority = ::client_priority;
lanes[0].static_threads = static_threads;
lanes[0].dynamic_threads = dynamic_threads;
lanes[1].lane_priority = ::server_priority;
lanes[1].static_threads = static_threads;
lanes[1].dynamic_threads = dynamic_threads;
lanes[2].lane_priority = default_thread_priority;
lanes[2].static_threads = static_threads;
lanes[2].dynamic_threads = dynamic_threads;
RTCORBA::ThreadpoolId threadpool_id =
this->rt_orb_->create_threadpool_with_lanes (stacksize,
lanes,
allow_borrowing,
allow_request_buffering,
max_buffered_requests,
max_request_buffer_size
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::Policy_var threadpool_policy =
this->rt_orb_->create_threadpool_policy (threadpool_id
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::PolicyList policies;
policies.length (1);
policies[0] =
threadpool_policy;
(this->*function) (policies,
server_priority,
client_priority,
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_no_bands_client_propagated_poa (CORBA::PolicyList &policies,
CORBA::Short server_priority,
CORBA::Short client_priority,
const char *test_name
ACE_ENV_ARG_DECL)
{
policies.length (policies.length () + 1);
policies[policies.length () - 1] =
this->rt_orb_->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
default_thread_priority
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
PortableServer::POA_var poa =
this->root_poa_->create_POA (test_name,
this->poa_manager_.in (),
policies
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
RTPortableServer::POA_var rt_poa =
RTPortableServer::POA::_narrow (poa.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
test_i *servant = 0;
ACE_NEW_THROW_EX (servant,
test_i (this->orb_.in (),
poa.in (),
server_priority,
client_priority),
CORBA::NO_MEMORY ());
ACE_CHECK;
PortableServer::ServantBase_var safe_servant (servant);
PortableServer::ObjectId_var id =
rt_poa->activate_object (servant
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
CORBA::Object_var object =
poa->id_to_reference (id.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
write_iors_to_file (object.in (),
this->orb_.in (),
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_bands_client_propagated_poa (CORBA::PolicyList &policies,
CORBA::Short server_priority,
CORBA::Short client_priority,
const char *test_name
ACE_ENV_ARG_DECL)
{
this->test_bands_poa (policies,
server_priority,
client_priority,
&server::test_no_bands_client_propagated_poa,
test_name
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_default_pool_no_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_default_pool_poa (::client_priority + 1,
::client_priority + 1,
&server::test_no_bands_client_propagated_poa,
"default_pool_no_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_no_lanes_no_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_no_lanes_poa (::client_priority - 1,
::client_priority - 1,
&server::test_no_bands_client_propagated_poa,
"no_lanes_no_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_lanes_no_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_lanes_poa (::client_priority,
::client_priority,
&server::test_no_bands_client_propagated_poa,
"lanes_no_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_default_pool_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_default_pool_poa (::client_priority + 1,
::client_priority + 1,
&server::test_bands_client_propagated_poa,
"default_pool_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_no_lanes_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_no_lanes_poa (::client_priority - 1,
::client_priority - 1,
&server::test_bands_client_propagated_poa,
"no_lanes_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_lanes_bands_client_propagated_poa (ACE_ENV_SINGLE_ARG_DECL)
{
this->test_lanes_poa (::client_priority,
::client_priority + 1,
&server::test_bands_client_propagated_poa,
"lanes_bands_client_propagated"
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
void
server::test_no_bands_server_declared_poa (CORBA::PolicyList &policies,
CORBA::Short server_priority,
CORBA::Short client_priority,
const char *test_name
ACE_ENV_ARG_DECL)
{
policies.length (policies.length () + 1);
policies[policies.length () - 1] =
this->rt_orb_->create_priority_model_policy (RTCORBA::SERVER_DECLARED,
default_thread_priority
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
PortableServer::POA_var poa =
this->root_poa_->create_POA (test_name,
this->poa_manager_.in (),
policies
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
RTPortableServer::POA_var rt_poa =
RTPortableServer::POA::_narrow (poa.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
test_i *servant = 0;
ACE_NEW_THROW_EX (servant,
test_i (this->orb_.in (),
poa.in (),
server_priority,
client_priority),
CORBA::NO_MEMORY ());
ACE_CHECK;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -