summaryrefslogtreecommitdiff
path: root/orbsvcs/orbsvcs/Log/RTEventLogConsumer.cpp
blob: da181905372ad270b6ddda565d8589c7d624a362 (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
54
55
56
57
58
59
60
61
62
// $Id$

#include "orbsvcs/Log/RTEventLog_i.h"
#include "orbsvcs/Log/LogMgr_i.h"
#include "orbsvcs/Log/LogNotification.h"
#include "orbsvcs/Event_Utilities.h"
#include "orbsvcs/Event/EC_Event_Channel.h"
#include "orbsvcs/Event/EC_Default_Factory.h"
#include "orbsvcs/Event/EC_Dispatching.h"
#include "orbsvcs/Event/EC_ConsumerAdmin.h"
#include "orbsvcs/Event/EC_SupplierAdmin.h"
#include "orbsvcs/Event/EC_Timeout_Generator.h"
#include "orbsvcs/Event/EC_ObserverStrategy.h"
#include "orbsvcs/Event/EC_ConsumerControl.h"
#include "orbsvcs/Event/EC_SupplierControl.h"
#include "ace/Dynamic_Service.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_Rtec_LogConsumer::TAO_Rtec_LogConsumer (TAO_RTEventLog_i *log)
  : log_ (log)
{
}

TAO_Rtec_LogConsumer::~TAO_Rtec_LogConsumer (void)
{
}

void
TAO_Rtec_LogConsumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin)
{
  RtecEventComm::PushConsumer_var myself = this->_this ();
  this->supplier_proxy_ = consumer_admin->obtain_push_supplier ();

  ACE_ConsumerQOS_Factory qos;
  qos.start_disjunction_group (1);
  qos.insert_type (ACE_ES_EVENT_ANY,
                   0);
  this->supplier_proxy_->connect_push_consumer (myself.in(), qos.get_ConsumerQOS ());
}

void
TAO_Rtec_LogConsumer::push (const RtecEventComm::EventSet& events)
{
  // create a record list...
  DsLogAdmin::RecordList recList (1);
  recList.length (1);

  recList [0].info <<= events;

  this->log_->write_recordlist (recList);


}

void
TAO_Rtec_LogConsumer::disconnect_push_consumer (void)
{
  this->supplier_proxy_->disconnect_push_supplier ();
}

TAO_END_VERSIONED_NAMESPACE_DECL