当前位置: 首页>>代码示例>>C++>>正文


C++ rteceventcomm::EventSet类代码示例

本文整理汇总了C++中rteceventcomm::EventSet的典型用法代码示例。如果您正苦于以下问题:C++ EventSet类的具体用法?C++ EventSet怎么用?C++ EventSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: event

void
Supplier::perform_push (void)
{
  try
    {
      // The event type and source must match our publications
      ++event_count_;
      ACE_DEBUG ((LM_DEBUG, "Sending event %d\n", event_count_));
      RtecEventComm::EventSet event (1);
      event.length (1);
      event[0].header.type   = ACE_ES_EVENT_UNDEFINED;
      event[0].header.source = event_count_;
      // Avoid loops throught the event channel federations
      event[0].header.ttl    = 1;

      if (this->valuetype_)
        {
          OBV_Hello::ValueTypeData * test_data = 0;
          ACE_NEW (test_data, OBV_Hello::ValueTypeData ());
          test_data->data ("ACE/TAO/CIAO");
          insert_into_any (event[0].data.any_value, test_data);
        }
      else
        {
          event[0].data.any_value <<= CORBA::string_dup( "ACE/TAO/CIAO");
        }

      this->proxy_->push (event);
    }
  catch (const CORBA::Exception&)
    {
    }
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:33,代码来源:Supplier.cpp

示例2: events

void
TAO_CosEC_ProxyPushConsumer_i::push (const CORBA::Any &data)
{
    RtecEventComm::Event buffer[1];
    // Create an event set that does not own the buffer....
    RtecEventComm::EventSet events (1, 1, buffer, 0);
    events.length (1);

    RtecEventComm::Event &e = events[0];
    RtecEventComm::Event eqos =
        qos_.publications[0].event;

    // @@ what if i initialize the entire <EventSet> with corresponding
    // publications entries.

    // NOTE: we initialize the <EventHeader> field using the 1st
    // <publications> from the <SupplierQOS>.so we assume that
    // publications[0] is initialized.
    e.header.source = eqos.header.source;
    e.header.ttl = eqos.header.ttl;
    e.header.type = eqos.header.type;

    ACE_hrtime_t t = ACE_OS::gethrtime ();

    ORBSVCS_Time::hrtime_to_TimeT (e.header.creation_time,
                                   t);
#if !defined(TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS)
    e.header.ec_recv_time = ORBSVCS_Time::zero ();
    e.header.ec_send_time = ORBSVCS_Time::zero ();
#endif /* TAO_LACKS_EVENT_CHANNEL_TIMESTAMPS */

    e.data.any_value = data;

    this->proxypushconsumer_->push (events);
}
开发者ID:svn2github,项目名称:ACE-Middleware,代码行数:35,代码来源:ProxyPushConsumer_i.cpp

示例3: handle_timeout

int PushSupplier_impl::handle_timeout (const ACE_Time_Value &current_time,
                                       const void *act)
{
    ACE_UNUSED_ARG(act);
    ACE_UNUSED_ARG(current_time);

    try {
        RtecEventComm::EventSet event (1);
        event.length (1);
        event[0].header.type   = ACE_ES_EVENT_UNDEFINED;
        event[0].header.source = 1;
        event[0].header.ttl    = 1;

        ACE_Time_Value time_val = ACE_OS::gettimeofday ();

        event[0].header.ec_send_time = time_val.sec () * 10000000 + time_val.usec ()* 10;
        event[0].data.any_value <<= seq_no_;

        consumer_->push(event);
        ACE_DEBUG((LM_DEBUG, "sending data %d\n", seq_no_));
        ++seq_no_;
    }
    catch (const CORBA::Exception& ex)
    {
        ex._tao_print_exception ("A CORBA Exception occurred.");
    }
    return 0;
}
开发者ID:svn2github,项目名称:ACE-Middleware,代码行数:28,代码来源:PushSupplier.cpp

示例4: matched

int
TAO_EC_Type_Filter::filter_set (const RtecEventComm::EventSet& event,
                                TAO_EC_QOS_Info& qos_info)
{
  CORBA::ULong maximum = event.length ();
  if (event.maximum () == 0)
    return 0;

  RtecEventComm::EventSet matched (maximum);
  CORBA::ULong next_slot = 0;
  for (CORBA::ULong i = 0; i != maximum; ++i)
    {
      if (!this->can_match (event[i].header))
        continue;
      matched.length (next_slot + 1);
      matched[next_slot] = event[i];
      next_slot++;
    }
  if (matched.length () == 0)
    return 0;

  this->push (matched, qos_info);

  return 1;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:25,代码来源:EC_Type_Filter.cpp

示例5: events

void
Loopback_Supplier::push (const RtecEventComm::EventSet &source)
{
  // ACE_DEBUG ((LM_DEBUG, "Loopback_Supplier pushing\n"));
  RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
  {
    ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
    if (CORBA::is_nil (this->proxy_consumer_.in ()))
      return;
    proxy = this->proxy_consumer_;

#if 0
    this->counter_ += source.length ();
    if ((this->counter_ + 1) % 1000 == 0)
      {
        ACE_DEBUG ((LM_DEBUG,
                    "(%P|%t) - Loopback (%d) sending %d messages\n",
                    this->response_type_, this->counter_ + 1));
      }
#endif /* 0 */
  }

  // ACE_DEBUG ((LM_DEBUG, "Loopback_Supplier::push (%P|%t)\n"));
  RtecEventComm::EventSet events (source);
  for (CORBA::ULong i = 0; i != events.length (); ++i)
    {
      events[i].header.ttl    = 1;
      events[i].header.type   = this->response_type_;
      events[i].header.source = this->experiment_id_;
    }

  proxy->push (events);
}
开发者ID:asdlei00,项目名称:ACE,代码行数:33,代码来源:Loopback_Supplier.cpp

示例6: event

void
EC_Counting_Supplier::push (const RtecEventComm::EventSet&)
{
  if (CORBA::is_nil (this->consumer_proxy_.in ()))
    return;

  RtecEventComm::EventSet event (1);
  event.length (1);
  event[0].header.source = this->event_source_;
  event[0].header.type = this->event_type_;
  event[0].header.ttl = 1;

  this->consumer_proxy_->push (event);
  this->event_count++;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:15,代码来源:Counting_Supplier.cpp

示例7:

void
EC_Supplier::send_event (const RtecEventComm::EventSet& event)
{
  ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);

  if (this->push_count_ == 0)
    this->throughput_start_ = ACE_OS::gethrtime ();

  this->push_count_ += event.length ();

  if (TAO_debug_level > 0
      && this->push_count_ % 100 == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "EC_Consumer (%P|%t): %d events received\n",
                  this->push_count_));
    }

  ACE_hrtime_t start = ACE_OS::gethrtime ();

  this->consumer_proxy_->push (event);

  ACE_hrtime_t end = ACE_OS::gethrtime ();
  this->throughput_.sample (end - this->throughput_start_,
                            end - start);
}
开发者ID:asdlei00,项目名称:ACE,代码行数:26,代码来源:Supplier.cpp

示例8: switch

void
EC_Consumer::push (const RtecEventComm::EventSet &events)
{
  for (CORBA::ULong i = 0; i < events.length (); ++i)
    {
      switch (events[i].header.type)
        {
        case A_EVENT_TYPE:
          ++this->a_events_;
          ACE_DEBUG ((LM_DEBUG, " Received event A\n"));
          break;

        case B_EVENT_TYPE:
          ++this->b_events_;
          ACE_DEBUG ((LM_DEBUG, " Received event B\n"));
          break;

        case C_EVENT_TYPE:
          ++this->c_events_;
          ACE_DEBUG ((LM_DEBUG, " Received event C\n"));
          break;

        default:
          ACE_DEBUG ((LM_DEBUG, " Received event of UNKNOWN event type\n"));
        }
    }

  if (this->a_events_ >= 100
      && this->b_events_ >= 100
      && this->c_events_ >= 100)
    this->disconnect ();
}
开发者ID:CCJY,项目名称:ATCD,代码行数:32,代码来源:consumer.cpp

示例9:

void
Consumer::push (const RtecEventComm::EventSet& events)
{
  if (events.length () == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "Consumer (%P|%t) no events\n"));
      return;
    }

  this->event_count_ += events.length ();
  if (this->event_count_ % 10000 == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "Consumer (%P|%t): %d events received\n",
                  this->event_count_));
    }
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:18,代码来源:Consumer.cpp

示例10: event

void
Supplier::perform_push (void)
{
  try
    {
      // The event type and source must match our publications
      RtecEventComm::EventSet event (1);
      event.length (1);
      event[0].header.type   = ACE_ES_EVENT_UNDEFINED;
      event[0].header.source = 1;
      // Avoid loops throught the event channel federations
      event[0].header.ttl    = 1;

      this->proxy_->push (event);
    }
  catch (const CORBA::Exception&)
    {
    }
}
开发者ID:CCJY,项目名称:ATCD,代码行数:19,代码来源:Supplier.cpp

示例11:

void
EC_Consumer::push (const RtecEventComm::EventSet& events)
{
  this->driver_->consumer_push (this->cookie_, events);

  if (events.length () == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "EC_Consumer (%P|%t) no events\n"));
      return;
    }

  ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
  if (this->push_count_ == 0)
    this->throughput_start_ = ACE_OS::gethrtime ();

  this->push_count_ += events.length ();

  if (TAO_debug_level > 0
      && this->push_count_ % 100 == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "EC_Consumer (%P|%t): %d events received\n",
                  this->push_count_));
    }

  for (u_int i = 0; i < events.length (); ++i)
    {
      const RtecEventComm::Event& e = events[i];

      ACE_hrtime_t creation;
      ORBSVCS_Time::TimeT_to_hrtime (creation,
                                     e.header.creation_time);

      const ACE_hrtime_t now = ACE_OS::gethrtime ();
      this->throughput_.sample (now - this->throughput_start_,
                                now - creation);

      if (e.header.type == this->shutdown_event_type_)
        this->driver_->consumer_shutdown (this->cookie_);
    }
}
开发者ID:CCJY,项目名称:ATCD,代码行数:42,代码来源:Consumer.cpp

示例12: event

void
Supplier::timeout_occured (void)
{
  RtecEventComm::EventSet event (1);
  if (id_ == 1)
    {
      event.length (1);
      event[0].header.type   = ACE_ES_EVENT_UNDEFINED;
      event[0].header.source = id_;
      event[0].header.ttl    = 1;
    }
  else
    {
      event.length (1);
      event[0].header.type   = ACE_ES_EVENT_UNDEFINED + 1;
      event[0].header.source = id_;
      event[0].header.ttl    = 1;
    }

  consumer_proxy_->push (event);
}
开发者ID:asdlei00,项目名称:ACE,代码行数:21,代码来源:Supplier.cpp

示例13:

int
TAO_EC_Bitmask_Filter::filter_nocopy (RtecEventComm::EventSet& event,
                                   TAO_EC_QOS_Info& qos_info)
{
  if (event.length () != 1)
    return 0;

  if ((event[0].header.type & this->type_mask_) == 0
      || (event[0].header.source & this->source_mask_) == 0)
    return 0;

  return this->child_->filter_nocopy (event, qos_info);
}
开发者ID:CCJY,项目名称:ATCD,代码行数:13,代码来源:EC_Bitmask_Filter.cpp

示例14:

void
Timeout_Consumer::push (const RtecEventComm::EventSet& events)
{
  if (events.length () == 0)
    {
      ACE_DEBUG ((LM_DEBUG,
                  "TimeoutConsumer (%t) no events\n"));
      return;
    }

  ACE_DEBUG ((LM_DEBUG, "(%t) Timeout Event received\n"));
  supplier_impl_->timeout_occured ();
}
开发者ID:asdlei00,项目名称:ACE,代码行数:13,代码来源:Supplier.cpp

示例15: events

int
Heartbeat_Application::handle_timeout (const ACE_Time_Value&,
                                       const void*)
{
  try
    {
      if (this->n_timeouts_++ < HEARTBEATS_TO_SEND)
        {
          RtecEventComm::EventSet events (1);
          events.length (1);
          // Events travelling through gateways must have a ttl count of at
          // least 1!
          events[0].header.ttl = 1;
          events[0].header.type = HEARTBEAT;
          events[0].header.source = SOURCE_ID;

          // Store our hostname and process id in the data portion of
          // the event.
          events[0].data.payload.replace (MAXHOSTNAMELEN+11,
                                          MAXHOSTNAMELEN+11,
                                          (u_char *)this->hostname_and_pid_,
                                          0);

          this->consumer_->push (events);
        }
      else
        // We already sent the required number of heartbeats.  Time to
        // shutdown this app.
        {
          this->shutdown ();
        }
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "Suppressed the following exception in ""Heartbeat_Application::handle_timeout:\n");
    }
  return 0;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:39,代码来源:application.cpp


注:本文中的rteceventcomm::EventSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。