MADARA
3.2.3
Main Page
Namespaces
Classes
Files
File List
File Members
VariableReference.h
Go to the documentation of this file.
1
#ifndef _MADARA_VARIABLE_REFERENCE_H_
2
#define _MADARA_VARIABLE_REFERENCE_H_
3
4
13
#include <string>
14
#include <cstring>
15
#include "madara/MadaraExport.h"
16
#include "
madara/expression/ExpressionTree.h
"
17
#include "
madara/utility/ScopedArray.h
"
18
19
namespace
madara
20
{
21
namespace
knowledge
22
{
23
class
ThreadSafeContext;
24
class
KnolwedgeBaseImpl;
25
class
Variables;
26
27
namespace
rcw
28
{
29
class
BaseTracker;
30
}
31
36
class
MADARA_EXPORT
VariableReference
37
{
38
public
:
39
friend
class
ThreadSafeContext
;
40
friend
class
KnowledgeBaseImpl
;
41
friend
class
Variables
;
42
friend
class
rcw::BaseTracker
;
43
44
using
pair_ptr
= KnowledgeMap::value_type *;
45
49
VariableReference
() =
default
;
50
54
VariableReference
(
pair_ptr
entry);
55
60
bool
is_valid (
void
)
const
;
61
66
bool
operator==
(
const
VariableReference
& rhs)
const
;
67
72
bool
operator!=
(
const
VariableReference
& rhs)
const
;
73
80
const
char
* get_name (
void
)
const
;
81
89
KnowledgeRecord
*get_record_unsafe (
void
)
const
;
90
94
void
assign (
pair_ptr
entry);
95
96
private
:
97
pair_ptr
entry_ =
nullptr
;
98
};
99
101
typedef
std::vector <VariableReference>
VariableReferences
;
102
103
struct
VariableReferenceMapCompare
104
{
105
bool
operator()
(
const
char
*l,
const
char
*r)
const
{
106
return
std::strcmp(l, r) < 0;
107
}
108
};
109
111
typedef
std::map <
const
char
*,
VariableReference
,
112
VariableReferenceMapCompare
>
VariableReferenceMap
;
113
}
114
}
115
116
#include "
VariableReference.inl
"
117
118
#endif // _MADARA_VARIABLE_REFERENCE_H_
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:59
madara::knowledge::VariableReferenceMapCompare
Definition:
VariableReference.h:103
madara::knowledge::VariableReferenceMapCompare::operator()
bool operator()(const char *l, const char *r) const
Definition:
VariableReference.h:105
madara::knowledge::KnowledgeBaseImpl
This class provides a distributed knowledge base implementation.
Definition:
KnowledgeBaseImpl.h:38
madara::knowledge::rcw::BaseTracker
Base type for Trackers.
Definition:
BaseTracker.h:63
madara::knowledge::ThreadSafeContext
This class stores variables and their values for use by any entity needing state information in a thr...
Definition:
ThreadSafeContext.h:75
madara::knowledge::VariableReference
Optimized reference to a variable within the knowledge base.
Definition:
VariableReference.h:36
ExpressionTree.h
madara::knowledge::rcw::operator==
auto operator==(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()==rhs.get())
Definition:
Tracked.h:244
madara::knowledge::VariableReferenceMap
std::map< const char *, VariableReference, VariableReferenceMapCompare > VariableReferenceMap
a map of variable references
Definition:
VariableReference.h:112
madara::knowledge::VariableReferences
std::vector< VariableReference > VariableReferences
a vector of variable references
Definition:
VariableReference.h:101
madara::knowledge::rcw::operator!=
auto operator!=(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()!=rhs.get())
Definition:
Tracked.h:245
madara::knowledge::VariableReference::pair_ptr
KnowledgeMap::value_type * pair_ptr
Definition:
VariableReference.h:44
madara::knowledge
Provides functions and classes for the distributed knowledge base.
Definition:
AggregateFilter.h:32
ScopedArray.h
VariableReference.inl
madara
Copyright (c) 2015 Carnegie Mellon University.
Definition:
AggregateFilter.h:30
madara::knowledge::Variables
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition:
ExternFunctionVariables.h:52
include
madara
knowledge
VariableReference.h
Generated on Thu Jul 12 2018 17:38:26 for MADARA by
1.8.11