MADARA  3.2.3
RCWThread.h
Go to the documentation of this file.
1 
2 
3 #ifndef INCL_MADARA_THREADS_RCWTHREAD_H
4 #define INCL_MADARA_THREADS_RCWTHREAD_H
5 
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include <list>
17 #include <type_traits>
18 #include <initializer_list>
21 #include "madara/utility/StdInt.h"
22 #include "madara/MadaraExport.h"
29 
30 namespace madara
31 {
32  namespace threads
33  {
40  class MADARA_EXPORT RCWThread : public BaseThread
41  {
42  public:
46  virtual ~RCWThread ()
47  {
48  }
49 
54  friend class WorkerThread;
55  friend class Threader;
56 
61  {
62  }
63 
67  virtual void compute (const knowledge::rcw::Transaction &) = 0;
68 
77  {
78  }
79 
80  private:
85  virtual void init (knowledge::KnowledgeBase &kb) override final;
86 
91  virtual void run (void) override final;
92 
100  virtual void cleanup (void) override final;
101 
102  std::unique_ptr<knowledge::rcw::Transaction> tx_;
103  };
104  }
105 }
106 
107 #endif // INCL_MADARA_THREADS_RCWTHREAD_H
virtual void finalize(knowledge::rcw::Transaction &)
Cleans up any thread residue (usually instances created in setup).
Definition: RCWThread.h:76
Manages a Read-Compute-Write cycle for registered variables.
Definition: Transaction.h:43
virtual ~RCWThread()
Destructor.
Definition: RCWThread.h:46
Provides a quality-of-service-enabled threading library.
Definition: BaseThread.h:27
Abstract base class for implementing RCW threads.
Definition: RCWThread.h:40
Abstract base class for implementing threads.
Definition: BaseThread.h:38
A thread that executes BaseThread logic.
Definition: WorkerThread.h:33
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
std::unique_ptr< knowledge::rcw::Transaction > tx_
Definition: RCWThread.h:102
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
Copyright (c) 2015 Carnegie Mellon University.
virtual void setup(knowledge::rcw::Transaction &)
Setup the thread for later read-compute-write loops.
Definition: RCWThread.h:60