summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/ConsumerAdmin_i.cpp
blob: 49a0415e4918b9001366ef0194d8e03cc9fb9997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "ConsumerAdmin_i.h"
#include <memory>

TAO_CosEC_ConsumerAdmin_i::TAO_CosEC_ConsumerAdmin_i (void)
  : qos_ (),
    rtec_consumeradmin_ (RtecEventChannelAdmin::ConsumerAdmin::_nil ())
{
}

int
TAO_CosEC_ConsumerAdmin_i::init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos,
                                 RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin)
{
  this->qos_ = consumerqos;
  this->rtec_consumeradmin_ =
    RtecEventChannelAdmin::ConsumerAdmin::_duplicate (rtec_consumeradmin);
  return 0;
}

CosEventChannelAdmin::ProxyPushSupplier_ptr
TAO_CosEC_ConsumerAdmin_i::obtain_push_supplier (void)
{
  CosEventChannelAdmin::ProxyPushSupplier_ptr proxysupplier_nil =
    CosEventChannelAdmin::ProxyPushSupplier::_nil ();

  RtecEventChannelAdmin::ProxyPushSupplier_var rtecproxypushsupplier =
    this->rtec_consumeradmin_->obtain_push_supplier ();

  TAO_CosEC_ProxyPushSupplier_i *proxypushsupplier;

  ACE_NEW_RETURN (proxypushsupplier,
                  TAO_CosEC_ProxyPushSupplier_i (this->qos_,
                                                 rtecproxypushsupplier.in ()),
                  proxysupplier_nil);

  std::unique_ptr<TAO_CosEC_ProxyPushSupplier_i> auto_proxysupplier (proxypushsupplier);

  CosEventChannelAdmin::ProxyPushSupplier_ptr proxy_obj = auto_proxysupplier.get ()->_this ();

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

  auto_proxysupplier.release ();
  return proxy_obj;
}

CosEventChannelAdmin::ProxyPullSupplier_ptr
TAO_CosEC_ConsumerAdmin_i::obtain_pull_supplier (void)
{
  // TODO: implement this.
  return CosEventChannelAdmin::ProxyPullSupplier::_nil ();
}