本文整理汇总了C++中ACE_Unbounded_Queue_Iterator::first方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Unbounded_Queue_Iterator::first方法的具体用法?C++ ACE_Unbounded_Queue_Iterator::first怎么用?C++ ACE_Unbounded_Queue_Iterator::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Unbounded_Queue_Iterator
的用法示例。
在下文中一共展示了ACE_Unbounded_Queue_Iterator::first方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter
CORBA::NVList::~NVList (void)
{
// initialize an iterator and delete each NamedValue
ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr> iter (this->values_);
for (iter.first (); !iter.done (); iter.advance ())
{
CORBA::NamedValue_ptr *nv = 0;
(void) iter.next (nv);
delete *nv;
}
this->max_ = 0;
// Remove the CDR stream if it is present.
delete this->incoming_;
}
示例2: i
void
CORBA::NVList::_tao_decode (TAO_InputCDR &incoming, int flag)
{
if (TAO_debug_level > 3)
{
TAOLIB_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) : NVList::_tao_decode\n")));
}
// Then unmarshal each "in" and "inout" parameter.
ACE_Unbounded_Queue_Iterator<CORBA::NamedValue_ptr> i (this->values_);
for (i.first (); !i.done (); i.advance ())
{
CORBA::NamedValue_ptr *item = 0;
(void) i.next (item);
CORBA::NamedValue_ptr nv = *item;
// check if it is an in or inout parameter
// @@ this is where we assume that the NVList is coming from
// a Server-side request, we could probably handle both
// cases with a flag, but there is no clear need for that.
if (ACE_BIT_DISABLED (nv->flags (), flag))
{
continue;
}
if (TAO_debug_level > 3)
{
TAOLIB_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) : NVList::_tao_decode - %C\n"),
nv->name ()? nv->name () : "(no name given)" ));
}
CORBA::Any_ptr any = nv->value ();
any->impl ()->_tao_decode (incoming
);
}
}
示例3: if
//.........这里部分代码省略.........
navigation_.roll = (navigation_.roll >= 180) ? -180 : navigation_.roll + 1;
navigation_.pitch = (navigation_.pitch >= 90) ? -90 : navigation_.pitch + 1;
navigation_.utilization = (*sched_data)->utilitzation;
navigation_.overhead = (*sched_data)->overhead;
navigation_.arrival_time = (*sched_data)->arrival_time;
navigation_.deadline_time = (*sched_data)->deadline_time;
navigation_.completion_time = (*sched_data)->completion_time;
navigation_.computation_time = (*sched_data)->computation_time;
navigation_.update_data = 0;
// because the scheduler data does not supply these values
navigation_.utilization = (double) (20.0 + ACE_OS::rand() % 10);
navigation_.overhead = (double) (ACE_OS::rand() % 10);
data <<= navigation_;
}
else if ((ACE_OS::strcmp((*sched_data)->operation_name, "high_10") == 0) ||
(ACE_OS::strcmp((*sched_data)->operation_name, "low_10") == 0) ||
(ACE_OS::strcmp((*sched_data)->operation_name, "high_5") == 0) ||
(ACE_OS::strcmp((*sched_data)->operation_name, "low_5") == 0))
{
if ((ACE_OS::strcmp((*sched_data)->operation_name, "high_10") == 0) ||
(ACE_OS::strcmp((*sched_data)->operation_name, "high_5") == 0))
{
weapons_.criticality = 1;
}
else
{
weapons_.criticality = 0;
}
weapons_.number_of_weapons = 2;
weapons_.weapon1_identifier = CORBA::string_alloc (30);
ACE_OS::strcpy (weapons_.weapon1_identifier.inout (),"Photon Torpedoes");
weapons_.weapon1_status =(ACE_OS::rand() % 4) == 0 ? 0 : 1 ;
weapons_.weapon2_identifier = CORBA::string_alloc (30);
ACE_OS::strcpy (weapons_.weapon2_identifier.inout (),"Quantum Torpedoes");
weapons_.weapon2_status = (ACE_OS::rand() % 4) == 0 ? 0 : 1;
weapons_.weapon3_identifier = CORBA::string_alloc (1);
ACE_OS::strcpy (weapons_.weapon3_identifier.inout (), "");
weapons_.weapon3_status = 0;
weapons_.weapon4_identifier = CORBA::string_alloc (1);
ACE_OS::strcpy (weapons_.weapon4_identifier.inout (), "");
weapons_.weapon4_status = 0;
weapons_.weapon5_identifier = CORBA::string_alloc (1);
ACE_OS::strcpy (weapons_.weapon5_identifier.inout (), "");
weapons_.weapon5_status = 0;
weapons_.utilization = (*sched_data)->utilitzation;
weapons_.overhead = (*sched_data)->overhead;
weapons_.arrival_time = (*sched_data)->arrival_time;
weapons_.deadline_time = (*sched_data)->deadline_time;
weapons_.completion_time = (*sched_data)->completion_time;
weapons_.computation_time = (*sched_data)->computation_time;
weapons_.update_data = 0;
// because the scheduler data does not supply these values
weapons_.utilization = (double) (20.0 + ACE_OS::rand() % 10);
weapons_.overhead = (double) (ACE_OS::rand() % 10);
data <<= weapons_;
}
else {
ACE_ERROR ((LM_ERROR,
"Event_Supplier::insert_event_data:"
"unrecognized operation name [%s]",
(*sched_data)->operation_name));
}
if (last_completion > (*sched_data)->completion_time)
last_completion = 0;
if ((*sched_data)->completion_time >= last_completion)
{
ACE_Time_Value pause (0,
(*sched_data)->completion_time -
last_completion);
ACE_OS::sleep (pause);
last_completion = (*sched_data)->completion_time;
}
}
else
ACE_ERROR ((LM_ERROR,
"Event_Supplier::insert_event_data:"
"Could Not access scheduling data"));
schedule_iter.advance ();
if (schedule_iter.done ())
schedule_iter.first ();
}
catch (const CORBA::Exception&)
{
ACE_ERROR ((LM_ERROR,
"(%t)Error in Event_Supplier::insert_event_data.\n"));
}
}