Ejemplo n.º 1
0
void
TAO_CosEC_ProxyPushSupplier_i::connect_push_consumer (CosEventComm::PushConsumer_ptr push_consumer)
{
  if (this->connected ())
    throw CosEventChannelAdmin::AlreadyConnected ();

  if (push_consumer == CosEventComm::PushConsumer::_nil())
    throw CORBA::BAD_PARAM ();

  TAO_CosEC_PushConsumerWrapper *wrapper;
  ACE_NEW_THROW_EX (wrapper,
                    TAO_CosEC_PushConsumerWrapper (push_consumer),
                    CORBA::NO_MEMORY ());

  auto_ptr <TAO_CosEC_PushConsumerWrapper> auto_wrapper (wrapper);

  // @@ This code is not exception safe.
  RtecEventComm::PushConsumer_ptr  rtecpushconsumer =
    auto_wrapper.get ()->_this ();

  // give the ownership to the POA.
  auto_wrapper.get ()->_remove_ref ();

  this->pps_->connect_push_consumer (rtecpushconsumer,
                                     this->qos_);

  this->wrapper_ = auto_wrapper.release ();
}
void
TAO_CosEC_ProxyPushConsumer_i::connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier)
{
    if (this->connected ())
        throw CosEventChannelAdmin::AlreadyConnected ();

    TAO_CosEC_PushSupplierWrapper *wrapper;

    ACE_NEW_THROW_EX (wrapper,
                      TAO_CosEC_PushSupplierWrapper (push_supplier),
                      CORBA::NO_MEMORY ());

    auto_ptr <TAO_CosEC_PushSupplierWrapper>
    auto_wrapper (wrapper);

    RtecEventComm::PushSupplier_ptr rtecpushsupplier
        = auto_wrapper.get ()->_this ();

    // give the ownership to the POA.
    auto_wrapper.get ()->_remove_ref ();

    this->proxypushconsumer_->connect_push_supplier
    (rtecpushsupplier,
     this->qos_);

    this->wrapper_ = auto_wrapper.release ();
}