本文整理汇总了C++中ACE_Arg_Shifter::consume_arg方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Arg_Shifter::consume_arg方法的具体用法?C++ ACE_Arg_Shifter::consume_arg怎么用?C++ ACE_Arg_Shifter::consume_arg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Arg_Shifter
的用法示例。
在下文中一共展示了ACE_Arg_Shifter::consume_arg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int
Job_i::init (ACE_Arg_Shifter& arg_shifter)
{
// Read the name of the Job
job_name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
// Read the name of the POA
POA_name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
return 0;
}
示例2: if
void
TAO_Notify_Tests_Application_Command::init (ACE_Arg_Shifter& arg_shifter)
{
if (arg_shifter.is_anything_left ())
{
/// -Init | Run | Shutdown
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Init")) == 0)
{
this->command_ = INIT;
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Run")) == 0)
{
this->command_ = RUN;
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-WaitForEvents")) == 0)
{
this->command_ = WAIT_FOR_EVENTS;
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Shutdown")) == 0)
{
this->command_ = SHUTDOWN;
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-DumpStats")) == 0)
{
this->command_ = DUMP_STATE;
arg_shifter.consume_arg ();
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Samples")) == 0)
{
this->dump_samples_ = 1;
arg_shifter.consume_arg ();
}
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-SignalPeer")) == 0)
{
this->command_ = SIGNAL_PEER;
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-WaitToStart")) == 0)
{
this->command_ = WAIT_TO_START;
arg_shifter.consume_arg ();
}
}
}
示例3: if
void
TAO_Notify_Tests_Options_Parser::execute (CosNotification::EventTypeSeq& added, CosNotification::EventTypeSeq& removed, ACE_Arg_Shifter& arg_shifter)
{
const ACE_TCHAR* current_arg = 0;
while (arg_shifter.is_anything_left ())
{
current_arg = arg_shifter.get_current ();
arg_shifter.consume_arg ();
if (current_arg[0] == '+')
{
// create 1 more space.
int seq_ln = added.length ();
added.length (seq_ln + 1);
added[seq_ln].domain_name = CORBA::string_dup ("*");
added[seq_ln].type_name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR(++current_arg)); // Skip the '+' sign.
}
else if (current_arg[0] == '-')
{
// create 1 more space.
int seq_ln = removed.length ();
removed.length (seq_ln + 1);
removed[seq_ln].domain_name = CORBA::string_dup ("*");
removed[seq_ln].type_name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR(++current_arg)); // Skip the '-' sign.
}
}
}
示例4:
int
Client_Options::boolean_option (ACE_Arg_Shifter &arg_shifter,
const ACE_TCHAR *option_name,
int &option_value)
{
if (ACE_OS::strcmp (arg_shifter.get_current (), option_name) != 0)
return 0;
arg_shifter.consume_arg ();
option_value = 1;
return 1;
}
示例5: if
void
TAO_Notify_Tests_EventChannel_Command::init (ACE_Arg_Shifter& arg_shifter)
{
if (arg_shifter.is_anything_left ())
{
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Create")) == 0) // -Create ec_name factory_name [COLLOCATED]
{
this->command_ = CREATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
this->factory_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("COLLOCATED")) == 0)
{
this->collocated_ = 1;
}
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("COLOCATED")) == 0) // grandfather in misspelled
{
this->collocated_ = 1;
ACE_DEBUG ((LM_WARNING, "TAO_Notify_Tests_EventChannel_Command::init --"
" warning: deprecated misspelled COLOCATED option used.\n"));
}
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Destroy")) == 0) // -Destroy ec_name
{
this->command_ = DESTROY;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Set_QoS")) == 0) // -Set_QoS ec_name [Qos Options]
{
this->command_ = SET_QOS;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
TAO_Notify_Tests_Options_Parser qos_parser;
qos_parser.execute (this->qos_, arg_shifter);
}
}
}
示例6: if
int
TAO_Notify_Tests_Periodic_Consumer::init_state (ACE_Arg_Shifter& arg_shifter)
{
// First, let the base class look for options.
if (TAO_Notify_Tests_StructuredPushConsumer::init_state (arg_shifter) == -1)
return -1;
const ACE_TCHAR *current_arg = 0;
while (arg_shifter.is_anything_left ())
{
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-MaxCount"))))
{
this->max_count_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
if (max_count_ == 0)
{
if (this->client_)
this->client_->done (this);
}
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Check_Priority")) == 0)
{
this->check_priority_ = 1;
arg_shifter.consume_arg ();
}
else
{
break;
}
} /* while */
return 0;
}
示例7:
int
DT_Creator::dt_task_init (ACE_Arg_Shifter& arg_shifter)
{
static int dt_index = 0;
time_t start_time = 0;
int load = 0;
int iter = 0;
int importance = 0;
char *job_name = 0;
int dist = 0;
const ACE_TCHAR* current_arg = 0;
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Importance")) == 0)
{
arg_shifter.consume_arg ();
current_arg = arg_shifter.get_current ();
importance = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Start_Time"))))
{
start_time = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Iter"))))
{
iter = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Load"))))
{
load = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-JobName"))))
{
job_name = (char *)current_arg;
dist = 1;
arg_shifter.consume_arg ();
}
dt_list_ [dt_index++] = this->create_thr_task (importance,
start_time,
load,
iter,
dist,
job_name);
return 0;
}
示例8: if
void
TAO_Notify_Tests_Periodic_Consumer_Command::init (ACE_Arg_Shifter& arg_shifter)
{
if (arg_shifter.is_anything_left ())
{
/// -Create consumer_name admin_name -POA [POA_name] consumer_specific_options
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Create")) == 0)
{
this->command_ = CREATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
int is_relay = 0;
int is_direct = 0;
ACE_CString relay_destination;
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Relay")) == 0)
{
is_relay = 1;
arg_shifter.consume_arg ();
relay_destination = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Direct")) == 0)
{
is_direct = 1;
arg_shifter.consume_arg ();
}
TAO_Notify_Tests_Periodic_Consumer* consumer = 0;
// create the consumer
if (is_relay == 1)
consumer = new TAO_Notify_Tests_Relay_Consumer (relay_destination);
else if (is_direct == 1)
consumer = new TAO_Notify_Tests_Direct_Consumer ();
else
consumer = new TAO_Notify_Tests_Periodic_Consumer ();
consumer->set_name (this->name_);
TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
LOOKUP_MANAGER->resolve (act_mgr);
{
act_mgr->_register (consumer, this->name_.c_str ());
}
consumer->init_state (arg_shifter);
} /* -Create */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Subscription")) == 0) // -Subscription admin_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
{
this->command_ = SUBSCRIPTION;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
TAO_Notify_Tests_Options_Parser options_parser;
options_parser.execute (this->added_, this->removed_, arg_shifter);
} /* Subscription */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Disconnect")) == 0) //
{
this->command_ = DISCONNECT;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* disconnect */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Deactivate")) == 0) //
{
this->command_ = DEACTIVATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* deactivate */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Status")) == 0) //
{
this->command_ = DUMP_STATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* -Dump */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Set_QoS")) == 0) // -Set_QoS ec_name [Qos Options]
{
this->command_ = SET_QOS;
//.........这里部分代码省略.........
示例9: if
void
TAO_Notify_Tests_Filter_Command::init (ACE_Arg_Shifter& arg_shifter)
{
if (arg_shifter.is_anything_left ())
{
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-CreateFactory")) == 0) // -Create factory_name ec
{
this->command_ = CREATE_FACTORY;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); // FF name
arg_shifter.consume_arg ();
this->factory_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); //EC
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-CreateFilter")) == 0) // -CreateFilter filter_name filterfactory_name
{
this->command_ = CREATE_FILTER;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); // Filter name
arg_shifter.consume_arg ();
this->factory_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); //FF
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Add_Constraint")) == 0) // -Add_Constraint filter_name constraint_expr
{
this->command_ = ADD_CONSTRAINT;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); // Filter name
arg_shifter.consume_arg ();
this->constraint_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); //Constraint
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Add_Filter")) == 0) // -Add_Filter filter_name FilterAdmin_Name
{
this->command_ = ADD_FILTER;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); // Filter name
arg_shifter.consume_arg ();
this->factory_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); //FilterAdmin
arg_shifter.consume_arg ();
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Destroy")) == 0) // -Destroy filter_name
{
this->command_ = DESTROY;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()); // filter
arg_shifter.consume_arg ();
}
}
}
示例10: as
int
DllORB::init (int argc, ACE_TCHAR *argv[])
{
int threadCnt = 1;
try
{
ACE_Arg_Shifter as (argc, argv);
const ACE_TCHAR *currentArg = 0;
while (as.is_anything_left ())
{
if ((currentArg = as.get_the_parameter (ACE_TEXT ("-NumThreads"))))
{
int num = ACE_OS::atoi (currentArg);
if (num >= 1)
threadCnt = num;
as.consume_arg ();
}
else
as.ignore_arg ();
}
if (failPrePostInit_ < 3)
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("Pre-ORB initialization ...\n")));
// -----------------------------------------------------------------
// Pre-ORB initialization steps necessary for proper DLL ORB
// support.
// -----------------------------------------------------------------
// Make sure TAO's singleton manager is initialized, and set to not
// register itself with the ACE_Object_Manager since it is under the
// control of the Service Configurator. If we register with the
// ACE_Object_Manager, then the ACE_Object_Manager will still hold
// (dangling) references to instances of objects created by this
// module and destroyed by this object when it is dynamically
// unloaded.
int register_with_object_manager = 0;
TAO_Singleton_Manager * p_tsm = TAO_Singleton_Manager::instance ();
int result = p_tsm->init (register_with_object_manager);
if (result == -1)
{
if (failPrePostInit_ == 0)
{
ACE_DEBUG ((LM_ERROR,
ACE_TEXT ("Pre-ORB initialization failed.\n")));
return -1;
}
else if (failPrePostInit_ < 2)
{
ACE_DEBUG ((LM_WARNING,
ACE_TEXT ("Pre-ORB initialization failed (ignored due to FailPrePostInit setting).\n")));
}
else
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("Pre-ORB initialization failed (ignored due to FailPrePostInit setting).\n")));
}
}
else
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("Pre-ORB initialization done.\n")));
}
}
// Initialize the ORB
ACE_Argv_Type_Converter argcon (argc, argv);
mv_orb_ = CORBA::ORB_init (argcon.get_argc (), argcon.get_TCHAR_argv ());
if (CORBA::is_nil (mv_orb_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil ORB\n")));
return -1;
}
CORBA::Object_var v_poa =
mv_orb_->resolve_initial_references ("RootPOA");
mv_rootPOA_ = PortableServer::POA::_narrow (v_poa.in ());
if (CORBA::is_nil (mv_rootPOA_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil RootPOA\n")));
return -1;
}
mv_poaManager_ = mv_rootPOA_->the_POAManager ();
if (CORBA::is_nil (mv_poaManager_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil POAManager\n")));
return -1;
}
mv_poaManager_->activate ();
}
catch (...)
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("ERROR: exception\n")));
return -1;
}
//.........这里部分代码省略.........
示例11: as
int
DllOrb::init (int argc, ACE_TCHAR *argv[])
{
int threadCnt = 1;
try
{
ACE_Arg_Shifter as (argc, argv);
const ACE_TCHAR *currentArg = 0;
while (as.is_anything_left ())
{
if (0 != (currentArg = as.get_the_parameter (ACE_TEXT ("-NumThreads"))))
{
int num = ACE_OS::atoi (currentArg);
if (num >= 1)
threadCnt = num;
as.consume_arg ();
}
else
as.ignore_arg ();
}
// Initialize the ORB
mv_orb_ = CORBA::ORB_init (argc, argv);
if (CORBA::is_nil (mv_orb_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil ORB\n")));
return -1;
}
CORBA::Object_var v_poa =
mv_orb_->resolve_initial_references ("RootPOA");
mv_rootPOA_ = PortableServer::POA::_narrow (v_poa.in ());
if (CORBA::is_nil (mv_rootPOA_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil RootPOA\n")));
return -1;
}
mv_poaManager_ = mv_rootPOA_->the_POAManager ();
if (CORBA::is_nil (mv_poaManager_.in ()))
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("nil POAManager\n")));
return -1;
}
mv_poaManager_->activate ();
}
catch (...)
{
ACE_DEBUG ((LM_ERROR, ACE_TEXT ("ERROR: exception\n")));
return -1;
}
ACE_auto_ptr_reset (ma_barrier_, new ACE_Thread_Barrier (threadCnt + 1));
this->activate(
THR_NEW_LWP|THR_JOINABLE|THR_INHERIT_SCHED,
threadCnt
);
ACE_DEBUG ((LM_INFO, ACE_TEXT ("init mp_barrier->wait() ...\n")));
ma_barrier_->wait();
ACE_DEBUG ((LM_INFO, ACE_TEXT ("init mp_barrier->wait() done\n")));
return 0;
}
示例12: ACE_TMAIN
int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
{
bool ok = false;
DomainParticipantFactory_var dpf;
DomainParticipant_var dp_sub, dp_pub;
try {
dpf = TheParticipantFactoryWithArgs(argc, argv);
dp_sub = dpf->create_participant(9, PARTICIPANT_QOS_DEFAULT,
0, DEFAULT_STATUS_MASK);
if (!dp_sub) {
ACE_DEBUG((LM_ERROR, "ERROR: %P could not create Sub Domain Participant\n"));
} else {
{
// New scope.
ACE_Arg_Shifter shifter (argc, argv);
while (shifter.is_anything_left ()) {
const ACE_TCHAR* x = shifter.get_the_parameter (ACE_TEXT("-value_base"));
if (x != NULL) {
TestConfig::set (ACE_OS::atoi (x));
}
shifter.consume_arg ();
}
}
DomainParticipantQos dp_qos;
dpf->get_default_participant_qos(dp_qos);
set_qos(dp_qos.user_data.value, TestConfig::PARTICIPANT_USER_DATA());
dp_pub = dpf->create_participant(9, dp_qos, 0, DEFAULT_STATUS_MASK);
if (!dp_pub) {
ACE_DEBUG((LM_ERROR, "ERROR: %P could not create Domain Participant 2\n"));
} else {
ok = run_test(dp_sub, dp_pub);
if (!ok) {
ACE_DEBUG((LM_ERROR, "ERROR: %P from run_test\n"));
return -1;
}
}
}
} catch (const std::exception& e) {
ACE_DEBUG((LM_ERROR, "ERROR: %P Exception thrown: %C\n", e.what()));
return -2;
} catch (const CORBA::Exception& e) {
e._tao_print_exception("ERROR: %P Exception thrown:");
return -2;
} catch (const OpenDDS::DCPS::Transport::Exception&) {
ACE_DEBUG((LM_ERROR, "ERROR: %P Transport exception thrown\n"));
return -2;
} catch (...) {
ACE_DEBUG((LM_ERROR, "ERROR: %P unknown exception thrown\n"));
return -2;
}
ACE_DEBUG((LM_INFO, "%P Cleaning up test\n"));
cleanup(dpf, dp_sub);
ACE_OS::sleep(2);
cleanup(dpf, dp_pub);
TheServiceParticipant->shutdown();
ACE_Thread_Manager::instance()->wait();
return ok ? EXIT_SUCCESS : EXIT_FAILURE;
}
示例13: if
int
Periodic_Task::init_task (ACE_Arg_Shifter& arg_shifter)
{
const ACE_TCHAR *current_arg = 0;
while (arg_shifter.is_anything_left ())
{
if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-JobName"))))
{
name_ = ACE_TEXT_ALWAYS_CHAR(current_arg);
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Priority"))))
{
task_priority_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Period"))))
{
period_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ExecTime"))))
{
exec_time_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Phase"))))
{
phase_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Iter"))))
{
iter_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
// create the stat object.
ACE_NEW_RETURN (task_stats_, Task_Stats (iter_), -1);
if (task_stats_->init () == -1)
return -1;
}
else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Load"))))
{
load_ = ACE_OS::atoi (current_arg);
arg_shifter.consume_arg ();
return 0;
}
else
{
ACE_DEBUG ((LM_DEBUG, "parse Task unknown option %s\n",
arg_shifter.get_current ()));
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG, "name %s, priority %d, period %duS, exec_time %duS, phase %duS, iter %d, load %d\n",
name_.c_str(), task_priority_, period_, exec_time_, phase_, iter_, load_));
break;
}
}
return 0;
}
示例14: if
void
TAO_Notify_Tests_Periodic_Supplier_Command::init (ACE_Arg_Shifter& arg_shifter)
{
if (arg_shifter.is_anything_left ())
{
/// -Create supplier_name admin_name -POA [POA_name] supplier_specific_options
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Create")) == 0)
{
this->command_ = CREATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
int is_direct = 0;
ACE_CString direct_target;
if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Direct")) == 0)
{
is_direct = 1;
arg_shifter.consume_arg ();
direct_target = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
}
TAO_Notify_Tests_Periodic_Supplier* supplier = 0;
// create the supplier
if (is_direct == 1)
supplier = new TAO_Notify_Tests_Direct_Supplier (direct_target);
else
supplier = new TAO_Notify_Tests_Periodic_Supplier ();
supplier->set_name (this->name_);
TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
LOOKUP_MANAGER->resolve (act_mgr);
{
act_mgr->_register (supplier, this->name_.c_str ());
}
supplier->init_state (arg_shifter);
} /* -Create */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Offer")) == 0) // -Offer supplier_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
{
this->command_ = OFFER;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
TAO_Notify_Tests_Options_Parser options_parser;
options_parser.execute (this->added_, this->removed_, arg_shifter);
}
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Disconnect")) == 0) //
{
this->command_ = DISCONNECT;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* disconnect */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Deactivate")) == 0) //
{
this->command_ = DEACTIVATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* deactivate */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Status")) == 0) //
{
this->command_ = DUMP_STATE;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
} /* -Dump */
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Set_QoS")) == 0) // -Set_QoS ec_name [Qos Options]
{
this->command_ = SET_QOS;
arg_shifter.consume_arg ();
this->name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
arg_shifter.consume_arg ();
TAO_Notify_Tests_Options_Parser qos_parser;
qos_parser.execute (this->qos_, arg_shifter);
}
} /* if */
//.........这里部分代码省略.........
示例15: shifter
int
Activator_Options::parse_args (int &argc, ACE_TCHAR *argv[])
{
ACE_Arg_Shifter shifter (argc, argv);
while (shifter.is_anything_left ())
{
if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-c")) == 0)
{
shifter.consume_arg ();
if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
{
ORBSVCS_ERROR ((LM_ERROR, "Error: -c option needs a command\n"));
this->print_usage ();
return -1;
}
if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("install")) == 0)
{
this->service_command_ = SC_INSTALL;
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("remove")) == 0)
{
this->service_command_ = SC_REMOVE;
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("install_no_imr")) == 0)
{
this->service_command_ = SC_INSTALL_NO_LOCATOR;
}
else
{
ORBSVCS_ERROR((LM_ERROR, "Error: Unknown service command : %s\n", shifter.get_current()));
this->print_usage ();
return -1;
}
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-d")) == 0)
{
shifter.consume_arg ();
if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
{
ORBSVCS_ERROR ((LM_ERROR, "Error: -d option needs a debuglevel\n"));
this->print_usage ();
return -1;
}
this->debug_ = ACE_OS::atoi (shifter.get_current ());
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-e")) == 0)
{
shifter.consume_arg ();
if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
{
ORBSVCS_ERROR ((LM_ERROR, "Error: -e option needs "
"an environment buffer length\n"));
this->print_usage ();
return -1;
}
this->env_buf_len_ = ACE_OS::atoi (shifter.get_current ());
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-m")) == 0)
{
shifter.consume_arg ();
if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
{
ORBSVCS_ERROR ((LM_ERROR, "Error: -m option needs "
"a maximum number of environment vars\n"));
this->print_usage ();
return -1;
}
this->max_env_vars_ = ACE_OS::atoi (shifter.get_current ());
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-o")) == 0)
{
shifter.consume_arg ();
if (!shifter.is_anything_left () || shifter.get_current ()[0] == '-')
{
ORBSVCS_ERROR ((LM_ERROR, "Error: -o option needs a filename\n"));
this->print_usage ();
return -1;
}
this->ior_output_file_ = shifter.get_current ();
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-s")) == 0)
//.........这里部分代码省略.........