ThreadSynchWorker.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_THREADSYNCHWORKER_H
00009 #define OPENDDS_DCPS_THREADSYNCHWORKER_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "dds/DCPS/RcObject.h"
00013 #include "dds/DCPS/RcHandle_T.h"
00014 #include "ace/Synch_Traits.h"
00015 #include <cstddef>
00016 
00017 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00018 
00019 namespace OpenDDS {
00020 namespace DCPS {
00021 
00022 class OpenDDS_Dcps_Export ThreadSynchWorker
00023   : public RcObject {
00024 public:
00025 
00026   virtual ~ThreadSynchWorker();
00027 
00028   enum WorkOutcome {
00029     WORK_OUTCOME_MORE_TO_DO,
00030     WORK_OUTCOME_NO_MORE_TO_DO,
00031     WORK_OUTCOME_CLOGGED_RESOURCE,
00032     WORK_OUTCOME_BROKEN_RESOURCE
00033   };
00034 
00035   virtual WorkOutcome perform_work() = 0;
00036 
00037   /// Indicate that queued data is available to be sent.
00038   virtual void schedule_output();
00039 
00040   /// DataLink reference value for diagnostics.
00041   std::size_t id() const;
00042 
00043   virtual ACE_HANDLE get_handle()=0;
00044 
00045 protected:
00046 
00047   ThreadSynchWorker( std::size_t id = 0);
00048 
00049 private:
00050   std::size_t id_;
00051 };
00052 
00053 typedef RcHandle<ThreadSynchWorker> ThreadSynchWorker_rch;
00054 
00055 } // namespace DCPS
00056 } // namespace OpenDDS
00057 
00058 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00059 
00060 #if defined (__ACE_INLINE__)
00061 #include "ThreadSynchWorker.inl"
00062 #endif /* __ACE_INLINE__ */
00063 
00064 #endif  /* OPENDDS_DCPS_THREADSYNCHWORKER_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1