diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 02:45:11 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 02:45:11 +0000 |
commit | 3b9469d11341ec4b81a9b8707635b6ed76340877 (patch) | |
tree | 62fdb1a532d98ad8d2da70958983a0ae1ef06ad3 /TAO/orbsvcs/orbsvcs/Event_Utilities.cpp | |
parent | cea26aeb6e1bc30c754707f0936d199e08bea071 (diff) | |
download | ATCD-3b9469d11341ec4b81a9b8707635b6ed76340877.tar.gz |
ChangeLogTag:Wed Dec 10 20:13:57 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Event_Utilities.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event_Utilities.cpp | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp new file mode 100644 index 00000000000..256f4d65b73 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp @@ -0,0 +1,131 @@ +// +// $Id$ +// +#include "orbsvcs/Event_Utilities.h" + +#if !defined (__ACE_INLINE__) +#include "orbsvcs/Event_Utilities.i" +#endif /* __ACE_INLINE__ */ + +ACE_ConsumerQOS_Factory::ACE_ConsumerQOS_Factory (void) : + qos_ (), + designator_set_ (0) +{ +} + +ACE_ConsumerQOS_Factory::~ACE_ConsumerQOS_Factory (void) +{ +} + +int +ACE_ConsumerQOS_Factory::start_conjunction_group (void) +{ + int l = qos_.dependencies.length (); + qos_.dependencies.length (l + 1); + qos_.dependencies[l].event_.type_ = ACE_ES_CONJUNCTION_DESIGNATOR; + // TODO: qos_.dependencies[l].event_.data_.lval (0); + designator_set_ = 1; + return 0; +} + +int +ACE_ConsumerQOS_Factory::start_disjunction_group (void) +{ + int l = qos_.dependencies.length (); + qos_.dependencies.length (l + 1); + qos_.dependencies[l].event_.type_ = ACE_ES_DISJUNCTION_DESIGNATOR; + // TODO: qos_.dependencies[l].event_.data_.lval (0); + designator_set_ = 1; + return 0; +} + +int +ACE_ConsumerQOS_Factory::insert (const RtecEventChannelAdmin::Dependency &subscribe) +{ + RtecScheduler::RT_Info dummy; + // Make sure that a designator is first. + if (designator_set_ == 0) + { + int l = qos_.dependencies.length (); + qos_.dependencies.length (l + 1); + qos_.dependencies[l].event_.type_ = ACE_ES_GLOBAL_DESIGNATOR; + // TODO: IDL union qos_.dependencies[l].event_.data_.lval (0); + designator_set_ = 1; + } + + int l = qos_.dependencies.length (); + qos_.dependencies.length (l + 1); + qos_.dependencies[l] = subscribe; + // TODO: IDL union qos_.dependencies[l].event_.data_.lval (0); + return 0; +} + +void event_debug (const char* p, + const RtecEventComm::Event& event) +{ + int l = ACE_OS::strlen (p); + ACE_DEBUG ((LM_DEBUG, + "%*.*s - event.source: %d\n" + "%*.*s event.type: %d\n" + "%*.*s event.time: %f\n", + l, l, p, event.source_, + l, l, p, event.type_, + l, l, p, event.creation_time_)); +} + +void +ACE_ConsumerQOS_Factory::debug (const RtecEventChannelAdmin::ConsumerQOS& qos) +{ + ACE_DEBUG ((LM_DEBUG, "ConsumerQOS { \n")); + + for (u_int i = 0; i < qos.dependencies.length (); ++i) + { + char buf[128]; + ACE_OS::sprintf (buf, " dep[%d]", i); + event_debug (buf, qos.dependencies[i].event_); + ACE_DEBUG ((LM_DEBUG, "%s rt_info: %d\n", + buf, qos.dependencies[i].rt_info)); + } + ACE_DEBUG ((LM_DEBUG, "}\n")); +} + +// ************************************************************ + +ACE_SupplierQOS_Factory::ACE_SupplierQOS_Factory (void) : + qos_ () +{ +} + +int +ACE_SupplierQOS_Factory::insert (RtecEventComm::EventSourceID sid, + RtecEventComm::EventType type, + RtecScheduler::handle_t rt_info, + u_int ncalls) +{ + int l = qos_.publications_.length (); + qos_.publications_.length (l + 1); + qos_.publications_[l].event_.source_ = sid; + qos_.publications_[l].event_.type_ = type; + // TODO: IDL union qos_.publications_[l].event_.data_.lval (0); + qos_.publications_[l].dependency_info_.rt_info = rt_info; + qos_.publications_[l].dependency_info_.number_of_calls = ncalls; + return 0; +} + +void ACE_SupplierQOS_Factory::debug (const RtecEventChannelAdmin::SupplierQOS& qos) +{ + ACE_DEBUG ((LM_DEBUG, "ConsumerQOS { \n")); + for (u_int i = 0; i < qos.publications_.length (); ++i) + { + char buf[128]; + ACE_OS::sprintf (buf, " publications[%d]", i); + event_debug (buf, qos.publications_[i].event_); + ACE_DEBUG ((LM_DEBUG, + "%s dependency_info.rt_info: %d\n" + "%s dependency_info.number_of_calls: %d\n", + buf, qos.publications_[i].dependency_info_.rt_info, + buf, qos.publications_[i].dependency_info_.number_of_calls)); + } + ACE_DEBUG ((LM_DEBUG, "}\n")); + +} |