MADARA  3.4.1
ContextGuard.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_CONTEXT_GUARD_H_
3 #define _MADARA_CONTEXT_GUARD_H_
4 
6 
15 namespace madara
16 {
17 namespace knowledge
18 {
23 class MADARA_EXPORT ContextGuard
24 {
25 public:
31  template<typename... Args>
32  ContextGuard(const KnowledgeBase& knowledge, Args&&... args);
33 
39  template<typename... Args>
40  ContextGuard(const ThreadSafeContext& context, Args&&... args);
41 
42 private:
43  std::lock_guard<const ThreadSafeContext> guard_;
44 };
45 }
46 }
47 
48 #include "ContextGuard.inl"
49 
50 #endif // _MADARA_CONTEXT_GUARD_H_
A thread-safe guard for a context or knowledge base.
Definition: ContextGuard.h:24
std::lock_guard< const ThreadSafeContext > guard_
Definition: ContextGuard.h:43
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
This class stores variables and their values for use by any entity needing state information in a thr...
Provides functions and classes for the distributed knowledge base.
Copyright(c) 2020 Galois.