OpenDDS  Snapshot(2023/04/28-20:55)
ThreadSynchWorker.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_THREADSYNCHWORKER_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_THREADSYNCHWORKER_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 #include "dds/DCPS/RcObject.h"
13 #include "dds/DCPS/RcHandle_T.h"
14 #include "ace/Synch_Traits.h"
15 #include <cstddef>
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
23  : public virtual RcObject {
24 public:
25 
26  virtual ~ThreadSynchWorker();
27 
28  enum WorkOutcome {
32  WORK_OUTCOME_BROKEN_RESOURCE
33  };
34 
35  virtual WorkOutcome perform_work() = 0;
36 
37  /// Indicate that queued data is available to be sent.
38  virtual void schedule_output();
39 
40  /// DataLink reference value for diagnostics.
41  std::size_t id() const;
42 
43  virtual ACE_HANDLE get_handle()=0;
44 
45 protected:
46 
47  ThreadSynchWorker( std::size_t id = 0);
48 
49 private:
50  std::size_t id_;
51 };
52 
54 
55 } // namespace DCPS
56 } // namespace OpenDDS
57 
59 
60 #if defined (__ACE_INLINE__)
61 #include "ThreadSynchWorker.inl"
62 #endif /* __ACE_INLINE__ */
63 
64 #endif /* OPENDDS_DCPS_THREADSYNCHWORKER_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
RcHandle< ThreadSynchWorker > ThreadSynchWorker_rch
ACE_HANDLE get_handle(void)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28