MADARA
3.4.1
NativeIntegerVectorStaged.h
Go to the documentation of this file.
1
2
#ifndef _MADARA_NATIVE_INTEGER_VECTOR_STAGED_H_
3
#define _MADARA_NATIVE_INTEGER_VECTOR_STAGED_H_
4
5
#include <vector>
6
#include <string>
7
#include "madara/LockType.h"
8
#include "
madara/knowledge/KnowledgeBase.h
"
9
#include "
madara/knowledge/ThreadSafeContext.h
"
10
#include "
madara/knowledge/KnowledgeUpdateSettings.h
"
11
#include "
BaseContainer.h
"
12
21
namespace
madara
22
{
23
namespace
knowledge
24
{
25
namespace
containers
26
{
31
class
MADARA_EXPORT
NativeIntegerVectorStaged
:
public
BaseContainer
32
{
33
public
:
35
typedef
knowledge::KnowledgeRecord::Integer
type
;
36
41
NativeIntegerVectorStaged
(
42
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
43
51
NativeIntegerVectorStaged
(
const
std::string
& name,
KnowledgeBase
&
knowledge
,
52
int
size = -1,
53
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
54
62
NativeIntegerVectorStaged
(
const
std::string
& name,
Variables
&
knowledge
,
63
int
size = -1,
64
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
65
69
NativeIntegerVectorStaged
(
const
NativeIntegerVectorStaged
& rhs);
70
74
virtual
~
NativeIntegerVectorStaged
();
75
80
void
modify(
void
);
81
86
void
operator=(
const
NativeIntegerVectorStaged
& rhs);
87
92
void
operator=(
const
std::vector<type>& rhs);
93
99
void
push_back(
type
value);
100
105
void
resize(
size_t
size);
106
112
void
exchange(
NativeIntegerVectorStaged
& other);
113
118
void
transfer_to(
NativeIntegerVectorStaged
& other);
119
124
void
copy_to(
KnowledgeVector
& target)
const
;
125
130
size_t
size(
void
)
const
;
131
139
void
set_name(
const
std::string
& var_name,
KnowledgeBase
&
knowledge
,
140
int
size = -1,
bool
sync =
true
);
141
149
void
set_name(
const
std::string
& var_name,
Variables
&
knowledge
,
150
int
size = -1,
bool
sync =
true
);
151
159
void
set_name(
const
std::string
& var_name,
ThreadSafeContext
&
knowledge
,
160
int
size = -1,
bool
sync =
true
);
161
168
type
operator[](
size_t
index)
const
;
169
176
void
set(
size_t
index,
type
value);
177
183
void
set(
const
std::vector<type>& value);
184
192
void
set_quality(
size_t
index, uint32_t quality,
193
const
KnowledgeReferenceSettings
& settings =
KnowledgeReferenceSettings
(
194
false
));
195
202
knowledge::KnowledgeRecord
to_record(
size_t
index)
const
;
203
208
knowledge::KnowledgeRecord
to_record(
void
)
const
;
209
219
std::string
get_debug_info(
void
);
220
226
virtual
BaseContainer
* clone(
void
)
const
;
227
232
bool
is_true(
void
)
const
;
233
238
bool
is_false(
void
)
const
;
239
243
void
read(
void
);
244
248
void
write(
void
);
249
250
private
:
255
virtual
bool
is_true_(
void
)
const
;
256
261
virtual
bool
is_false_(
void
)
const
;
262
271
virtual
void
modify_(
void
);
272
282
virtual
std::string
get_debug_info_(
void
);
283
287
ThreadSafeContext
*
context_
;
288
292
VariableReference
vector_
;
293
297
KnowledgeRecord
value_
;
298
302
bool
has_changed_
;
303
};
304
306
typedef
NativeIntegerVectorStaged
NativeIntegerArrayStaged
;
307
}
308
}
309
}
310
311
#include "
NativeIntegerVectorStaged.inl
"
312
313
#endif
// _MADARA_NATIVE_INTEGER_VECTOR_STAGED_H_
BaseContainer.h
KnowledgeBase.h
KnowledgeUpdateSettings.h
NativeIntegerVectorStaged.inl
ThreadSafeContext.h
madara::knowledge::KnowledgeBase
This class provides a distributed knowledge base to users.
Definition:
KnowledgeBase.h:45
madara::knowledge::KnowledgeRecord
This class encapsulates an entry in a KnowledgeBase.
Definition:
KnowledgeRecord.h:88
madara::knowledge::KnowledgeRecord::Integer
int64_t Integer
Definition:
KnowledgeRecord.h:131
madara::knowledge::KnowledgeReferenceSettings
Settings for applying knowledge updates.
Definition:
KnowledgeReferenceSettings.h:23
madara::knowledge::KnowledgeUpdateSettings
Settings for applying knowledge updates.
Definition:
KnowledgeUpdateSettings.h:24
madara::knowledge::ThreadSafeContext
This class stores variables and their values for use by any entity needing state information in a thr...
Definition:
ThreadSafeContext.h:76
madara::knowledge::VariableReference
Optimized reference to a variable within the knowledge base.
Definition:
VariableReference.h:33
madara::knowledge::Variables
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition:
Variables.h:53
madara::knowledge::containers::BaseContainer
This class is an abstract base class for all containers.
Definition:
BaseContainer.h:34
madara::knowledge::containers::NativeIntegerVectorStaged
This class stores a vector of doubles inside of KaRL.
Definition:
NativeIntegerVectorStaged.h:32
madara::knowledge::containers::NativeIntegerVectorStaged::has_changed_
bool has_changed_
Tracks if value_ has changed since last read.
Definition:
NativeIntegerVectorStaged.h:302
madara::knowledge::containers::NativeIntegerVectorStaged::value_
KnowledgeRecord value_
The staged value of the vector.
Definition:
NativeIntegerVectorStaged.h:297
madara::knowledge::containers::NativeIntegerVectorStaged::type
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
Definition:
NativeIntegerVectorStaged.h:35
madara::knowledge::containers::NativeIntegerVectorStaged::context_
ThreadSafeContext * context_
Variable context that we are modifying.
Definition:
NativeIntegerVectorStaged.h:287
madara::knowledge::containers::NativeIntegerVectorStaged::vector_
VariableReference vector_
Reference to the size field of the vector space.
Definition:
NativeIntegerVectorStaged.h:292
madara::knowledge::containers
Provides container classes for fast knowledge base access and mutation.
Definition:
Barrier.h:27
madara::knowledge::containers::NativeIntegerArrayStaged
NativeIntegerVectorStaged NativeIntegerArrayStaged
provide the Array alias for the NativeIntegerVectorStaged class
Definition:
NativeIntegerVectorStaged.h:306
madara::knowledge::tags::string
constexpr string_t string
Definition:
KnowledgeRecord.h:56
madara::knowledge
Provides functions and classes for the distributed knowledge base.
Definition:
AggregateFilter.h:33
madara::knowledge::KnowledgeVector
::std::vector< KnowledgeRecord > KnowledgeVector
Definition:
KnowledgeRecord.h:1820
madara
Copyright(c) 2020 Galois.
Definition:
AggregateFilter.h:31
include
madara
knowledge
containers
NativeIntegerVectorStaged.h
Generated on Sat Jan 20 2024 00:40:27 for MADARA by
1.9.1