MADARA
3.4.1
NativeDoubleVectorStaged.h
Go to the documentation of this file.
1
2
#ifndef _MADARA_NATIVE_DOUBLE_VECTOR_STAGED_H_
3
#define _MADARA_NATIVE_DOUBLE_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
{
38
class
MADARA_EXPORT
NativeDoubleVectorStaged
:
public
BaseContainer
39
{
40
public
:
42
typedef
double
type
;
43
48
NativeDoubleVectorStaged
(
49
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
50
58
NativeDoubleVectorStaged
(
const
std::string
& name,
KnowledgeBase
&
knowledge
,
59
int
size = -1,
60
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
61
69
NativeDoubleVectorStaged
(
const
std::string
& name,
Variables
&
knowledge
,
70
int
size = -1,
71
const
KnowledgeUpdateSettings
& settings =
KnowledgeUpdateSettings
());
72
76
NativeDoubleVectorStaged
(
const
NativeDoubleVectorStaged
& rhs);
77
81
virtual
~
NativeDoubleVectorStaged
();
82
87
void
modify(
void
);
88
93
void
operator=(
const
NativeDoubleVectorStaged
& rhs);
94
99
void
operator=(
const
std::vector<type>& rhs);
100
106
void
push_back(
type
value);
107
112
void
resize(
size_t
size);
113
119
void
exchange(
NativeDoubleVectorStaged
& other);
120
125
void
transfer_to(
NativeDoubleVectorStaged
& other);
126
131
void
copy_to(
KnowledgeVector
& target)
const
;
132
137
size_t
size(
void
)
const
;
138
146
void
set_name(
const
std::string
& var_name,
KnowledgeBase
&
knowledge
,
147
int
size = -1,
bool
sync =
true
);
148
156
void
set_name(
const
std::string
& var_name,
Variables
&
knowledge
,
157
int
size = -1,
bool
sync =
true
);
158
166
void
set_name(
const
std::string
& var_name,
ThreadSafeContext
&
knowledge
,
167
int
size = -1,
bool
sync =
true
);
168
175
type
operator[](
size_t
index)
const
;
176
183
void
set(
size_t
index,
type
value);
184
190
void
set(
const
std::vector<type>& value);
191
199
void
set_quality(
size_t
index, uint32_t quality,
200
const
KnowledgeReferenceSettings
& settings =
KnowledgeReferenceSettings
(
201
false
));
202
209
knowledge::KnowledgeRecord
to_record(
size_t
index)
const
;
210
215
knowledge::KnowledgeRecord
to_record(
void
)
const
;
216
226
std::string
get_debug_info(
void
);
227
233
virtual
BaseContainer
* clone(
void
)
const
;
234
239
bool
is_true(
void
)
const
;
240
245
bool
is_false(
void
)
const
;
246
250
void
read(
void
);
251
255
void
write(
void
);
256
257
private
:
262
virtual
bool
is_true_(
void
)
const
;
263
268
virtual
bool
is_false_(
void
)
const
;
269
278
virtual
void
modify_(
void
);
279
289
virtual
std::string
get_debug_info_(
void
);
290
294
ThreadSafeContext
*
context_
;
295
299
VariableReference
vector_
;
300
304
KnowledgeRecord
value_
;
305
309
bool
has_changed_
;
310
};
311
313
typedef
NativeDoubleVectorStaged
NativeDoubleArrayStaged
;
314
}
315
}
316
}
317
318
#include "
NativeDoubleVectorStaged.inl
"
319
320
#endif
// _MADARA_NATIVE_DOUBLE_VECTOR_STAGED_H_
BaseContainer.h
KnowledgeBase.h
KnowledgeUpdateSettings.h
NativeDoubleVectorStaged.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::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::NativeDoubleVectorStaged
This class stores a vector of doubles inside of KaRL.
Definition:
NativeDoubleVectorStaged.h:39
madara::knowledge::containers::NativeDoubleVectorStaged::has_changed_
bool has_changed_
Tracks if value_ has changed since last read.
Definition:
NativeDoubleVectorStaged.h:309
madara::knowledge::containers::NativeDoubleVectorStaged::type
double type
trait that describes the value type
Definition:
NativeDoubleVectorStaged.h:42
madara::knowledge::containers::NativeDoubleVectorStaged::context_
ThreadSafeContext * context_
Variable context that we are modifying.
Definition:
NativeDoubleVectorStaged.h:294
madara::knowledge::containers::NativeDoubleVectorStaged::vector_
VariableReference vector_
Reference to the size field of the vector space.
Definition:
NativeDoubleVectorStaged.h:299
madara::knowledge::containers::NativeDoubleVectorStaged::value_
KnowledgeRecord value_
The staged value of the vector.
Definition:
NativeDoubleVectorStaged.h:304
madara::knowledge::containers
Provides container classes for fast knowledge base access and mutation.
Definition:
Barrier.h:27
madara::knowledge::containers::NativeDoubleArrayStaged
NativeDoubleVectorStaged NativeDoubleArrayStaged
provide the Array alias for the NativeDoubleVectorStaged class
Definition:
NativeDoubleVectorStaged.h:313
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
NativeDoubleVectorStaged.h
Generated on Sat Jan 20 2024 00:40:27 for MADARA by
1.9.1