00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OPENDDS_DCPS_THREADSYNCHWORKER_H
00009 #define OPENDDS_DCPS_THREADSYNCHWORKER_H
00010
00011 #include "dds/DCPS/dcps_export.h"
00012
00013 #include "ace/Event_Handler.h"
00014
00015 namespace OpenDDS {
00016 namespace DCPS {
00017
00018 class OpenDDS_Dcps_Export ThreadSynchWorker {
00019 public:
00020
00021 virtual ~ThreadSynchWorker();
00022
00023 enum WorkOutcome {
00024 WORK_OUTCOME_MORE_TO_DO,
00025 WORK_OUTCOME_NO_MORE_TO_DO,
00026 WORK_OUTCOME_CLOGGED_RESOURCE,
00027 WORK_OUTCOME_BROKEN_RESOURCE
00028 };
00029
00030 virtual WorkOutcome perform_work() = 0;
00031
00032
00033 virtual void schedule_output();
00034
00035
00036 std::size_t id() const;
00037
00038 protected:
00039
00040 ThreadSynchWorker( std::size_t id = 0);
00041
00042 private:
00043 std::size_t id_;
00044 };
00045
00046 }
00047 }
00048
00049 #if defined (__ACE_INLINE__)
00050 #include "ThreadSynchWorker.inl"
00051 #endif
00052
00053 #endif