F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
SerializableFile.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title SerializableFile.hpp
3
// \author dinkel
4
// \brief hpp file for SerializableFile
5
//
6
// \copyright
7
// Copyright 2009-2016, by the California Institute of Technology.
8
// ALL RIGHTS RESERVED. United States Government Sponsorship
9
// acknowledged.
10
//
11
// ======================================================================
12
13
#ifndef Fw_SerializableFile_HPP
14
#define Fw_SerializableFile_HPP
15
16
#include <
Fw/Types/Serializable.hpp
>
17
#include <
Fw/Types/MemAllocator.hpp
>
18
#include <
Fw/Types/SerialBuffer.hpp
>
19
20
namespace
Fw
{
21
23
class
SerializableFile
{
24
25
public
:
26
enum
Status
{
27
OP_OK
,
28
FILE_OPEN_ERROR
,
29
FILE_WRITE_ERROR
,
30
FILE_READ_ERROR
,
31
DESERIALIZATION_ERROR
32
};
33
34
// NOTE!: This should not be used with an allocator that can return a smaller buffer than requested
35
SerializableFile
(
MemAllocator
* allocator,
NATIVE_UINT_TYPE
maxSerializedSize);
36
~SerializableFile
();
37
38
Status
load
(
const
char
* fileName,
Serializable
& serializable);
39
Status
save
(
const
char
* fileName,
Serializable
& serializable);
40
41
PRIVATE:
42
void
reset();
43
MemAllocator
* m_allocator;
44
bool
m_recoverable;
// don't care; for allocator
45
NATIVE_UINT_TYPE
m_actualSize;
// for checking
46
SerialBuffer
m_buffer;
47
};
48
}
49
50
#endif
NATIVE_UINT_TYPE
PlatformUIntType NATIVE_UINT_TYPE
Definition:
BasicTypes.h:56
MemAllocator.hpp
Defines a base class for a memory allocator for classes.
SerialBuffer.hpp
Serializable.hpp
Fw::MemAllocator
Definition:
MemAllocator.hpp:46
Fw::SerialBuffer
A variable-length serializable buffer.
Definition:
SerialBuffer.hpp:24
Fw::SerializableFile
The type of a packet header.
Definition:
SerializableFile.hpp:23
Fw::SerializableFile::SerializableFile
SerializableFile(MemAllocator *allocator, NATIVE_UINT_TYPE maxSerializedSize)
Definition:
SerializableFile.cpp:19
Fw::SerializableFile::save
Status save(const char *fileName, Serializable &serializable)
Definition:
SerializableFile.cpp:63
Fw::SerializableFile::Status
Status
Definition:
SerializableFile.hpp:26
Fw::SerializableFile::OP_OK
@ OP_OK
Definition:
SerializableFile.hpp:27
Fw::SerializableFile::DESERIALIZATION_ERROR
@ DESERIALIZATION_ERROR
Definition:
SerializableFile.hpp:31
Fw::SerializableFile::FILE_OPEN_ERROR
@ FILE_OPEN_ERROR
Definition:
SerializableFile.hpp:28
Fw::SerializableFile::FILE_WRITE_ERROR
@ FILE_WRITE_ERROR
Definition:
SerializableFile.hpp:29
Fw::SerializableFile::FILE_READ_ERROR
@ FILE_READ_ERROR
Definition:
SerializableFile.hpp:30
Fw::SerializableFile::load
Status load(const char *fileName, Serializable &serializable)
Definition:
SerializableFile.cpp:34
Fw::SerializableFile::~SerializableFile
~SerializableFile()
Definition:
SerializableFile.cpp:30
Fw::Serializable
forward declaration
Definition:
Serializable.hpp:25
Fw
Definition:
FppConstantsAc.hpp:121
Fw
SerializableFile
SerializableFile.hpp
Generated by
1.9.1