diff options
Diffstat (limited to 'modules/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp')
-rw-r--r-- | modules/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/modules/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp b/modules/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp new file mode 100644 index 00000000000..4c87e597459 --- /dev/null +++ b/modules/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp @@ -0,0 +1,81 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Publication_exec_i.h" + +namespace CIAO_Messenger_Impl +{ + //================================================================== + // Facet Executor Implementation Class: Publication_exec_i + //================================================================== + + Publication_exec_i::Publication_exec_i ( + const char* text, CORBA::UShort period) + : text_( text ), + period_( period) + { + } + + Publication_exec_i::~Publication_exec_i (void) + { + } + + // Operations from ::Publication + + char* + Publication_exec_i::text () + { + ACE_Guard<TAO_SYNCH_MUTEX> guard(this->lock_); + + return CORBA::string_dup( this->text_.c_str() ); + } + + void + Publication_exec_i::text ( + const char* text) + { + ACE_Guard<TAO_SYNCH_MUTEX> guard(this->lock_); + + this->text_ = text; + ACE_DEBUG((LM_INFO, ACE_TEXT("publication text changed to %C\n"), text )); + } + + CORBA::UShort + Publication_exec_i::period () + { + ACE_Guard<TAO_SYNCH_MUTEX> guard(this->lock_); + + return this->period_; + } + + void + Publication_exec_i::period (CORBA::UShort period) + { + ACE_Guard<TAO_SYNCH_MUTEX> guard( this->lock_ ); + + if ( period > 0 ) { + this->period_ = period; + ACE_DEBUG((LM_INFO, ACE_TEXT("publication period changed to %d seconds\n"), period )); + } else { + ACE_DEBUG((LM_INFO, ACE_TEXT("ignoring a negative period of %d\n"), period )); + } + } +} + |