F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
19 
20 namespace Fw {
21 
24 
25  public:
26  enum Status {
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);
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
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:56
Defines a base class for a memory allocator for classes.
A variable-length serializable buffer.
The type of a packet header.
SerializableFile(MemAllocator *allocator, NATIVE_UINT_TYPE maxSerializedSize)
Status save(const char *fileName, Serializable &serializable)
Status load(const char *fileName, Serializable &serializable)
forward declaration