F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
g
h
i
m
r
s
t
v
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
f
h
i
l
m
n
o
p
s
t
v
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
c
t
u
w
Enumerations
b
c
d
e
f
g
h
i
m
o
p
q
s
t
w
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Related Functions
a
b
c
f
g
h
l
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
Functions
f
i
m
s
u
Variables
_
c
f
i
l
p
t
Typedefs
Enumerations
Enumerator
a
c
d
f
i
m
p
r
s
t
w
Macros
a
c
d
f
g
h
i
k
l
m
n
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
StructSerializable.cpp
Go to the documentation of this file.
1
#include <
Fw/Types/StructSerializable.hpp
>
2
#include <
Fw/Types/Assert.hpp
>
3
4
namespace
Fw
{
5
6
template
<
class
T>
StructSerializable<T>::StructSerializable
() {
7
}
8
9
template
<
class
T>
StructSerializable<T>::StructSerializable
(
const
T& val) {
10
this->m_val = val;
11
}
12
13
template
<
class
T>
StructSerializable<T>::StructSerializable
(
const
T* val) {
14
FW_ASSERT
(val);
15
this->m_val = *val;
16
}
17
18
template
<
class
T>
const
T&
StructSerializable<T>::operator=
(
const
T& val) {
19
this->m_val = val;
20
return
val;
21
}
22
23
template
<
class
T>
StructSerializable<T>::~StructSerializable
() {
24
}
25
26
template
<
class
T>
void
StructSerializable<T>::set
(
const
T& val) {
27
this->m_val = val;
28
}
29
30
template
<
class
T>
const
T&
StructSerializable<T>::get
(
void
) {
31
return
this->m_val;
32
}
33
34
template
<
class
T>
Fw::SerializeStatus
StructSerializable<T>::serialize
(
Fw::SerializeBufferBase
& buffer)
const
{
35
if
(
sizeof
(T) > buffer.
getBuffLeft
()) {
36
return
FW_DESERIALIZE_SIZE_MISMATCH
;
37
}
38
return
buffer.
serialize
(
static_cast<
U8
*
>
(&this->m_val),
sizeof
(T));
39
}
40
41
template
<
class
T>
Fw::SerializeStatus
StructSerializable<T>::deserialize
(
Fw::SerializeBufferBase
& buffer) {
42
return
buffer.
deserialize
(
static_cast<
U8
*
>
(&this->m_val),
sizeof
(T));
43
}
44
45
}
46
Fw::StructSerializable::serialize
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
serialize contents
Definition:
StructSerializable.cpp:34
Fw::StructSerializable::set
void set(const T &val)
Definition:
StructSerializable.cpp:26
StructSerializable.hpp
Fw::SerializeBufferBase
Definition:
Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition:
Serializable.hpp:14
Fw::FW_DESERIALIZE_SIZE_MISMATCH
@ FW_DESERIALIZE_SIZE_MISMATCH
Data was left in in the buffer, but not enough to deserialize.
Definition:
Serializable.hpp:20
Fw::StructSerializable::~StructSerializable
virtual ~StructSerializable()
Definition:
StructSerializable.cpp:23
Fw::SerializeBufferBase::serialize
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
Definition:
Serializable.cpp:67
U8
uint8_t U8
8-bit unsigned integer
Definition:
BasicTypes.hpp:76
Fw::StructSerializable::deserialize
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
deserialize to contents
Definition:
StructSerializable.cpp:41
Fw::StructSerializable::StructSerializable
StructSerializable()
Definition:
StructSerializable.cpp:6
Assert.hpp
Fw::SerializeBufferBase::getBuffLeft
NATIVE_UINT_TYPE getBuffLeft() const
returns how much deserialization buffer is left
Definition:
Serializable.cpp:619
Fw::StructSerializable::operator=
const T & operator=(const T &val)
Definition:
StructSerializable.cpp:18
FW_ASSERT
#define FW_ASSERT(...)
Definition:
Assert.hpp:9
Fw::SerializeBufferBase::deserialize
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
Definition:
Serializable.cpp:292
Fw
Definition:
BufferGetPortAc.cpp:6
Fw::StructSerializable::get
const T & get(void)
Definition:
StructSerializable.cpp:30
Fw
Types
StructSerializable.cpp
Generated by
1.8.19