F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LogString.hpp
Go to the documentation of this file.
1 #ifndef FW_LOG_STRING_TYPE_HPP
2 #define FW_LOG_STRING_TYPE_HPP
3 
4 #include <Fw/Types/BasicTypes.hpp>
5 #include <Fw/Types/StringType.hpp>
6 #include <FpConfig.hpp>
7 #include <Fw/Cfg/SerIds.hpp>
8 
9 namespace Fw {
10 
11  class LogStringArg : public Fw::StringBase {
12  public:
13 
14  enum {
16  SERIALIZED_SIZE = FW_LOG_STRING_MAX_SIZE + sizeof(FwBuffSizeType) // size of buffer + storage of two size words
17  };
18 
19  LogStringArg();
20  LogStringArg(const LogStringArg& src);
21  LogStringArg(const StringBase& src);
22  LogStringArg(const char* src);
23  LogStringArg& operator=(const LogStringArg& other);
24  LogStringArg& operator=(const StringBase& other);
25  LogStringArg& operator=(const char* other);
26  ~LogStringArg();
27 
28  const char* toChar() const override;
29  NATIVE_UINT_TYPE getCapacity() const override;
30 
31  SerializeStatus serialize(SerializeBufferBase& buffer) const override;
32  SerializeStatus serialize(SerializeBufferBase& buffer, NATIVE_UINT_TYPE maxLen) const override;
34 
35  private:
36 
37  char m_buf[FW_LOG_STRING_MAX_SIZE];
38  };
39 
40 }
41 
42 #endif
Fw::LogStringArg::toChar
const char * toChar() const override
Definition: LogString.cpp:49
Fw::LogStringArg::SERIALIZED_TYPE_ID
@ SERIALIZED_TYPE_ID
Definition: LogString.hpp:15
Fw::LogStringArg::deserialize
SerializeStatus deserialize(SerializeBufferBase &buffer) override
deserialization function
Definition: LogString.cpp:76
FW_LOG_STRING_MAX_SIZE
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.hpp:243
Fw::LogStringArg::operator=
LogStringArg & operator=(const LogStringArg &other)
assignment operator
Definition: LogString.cpp:23
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Fw::LogStringArg::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: LogString.hpp:16
Fw::LogStringArg
Definition: LogString.hpp:11
Fw::StringBase
Definition: StringType.hpp:23
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:28
Fw::LogStringArg::getCapacity
NATIVE_UINT_TYPE getCapacity() const override
return size of buffer
Definition: LogString.cpp:53
Fw::FW_TYPEID_LOG_STR
@ FW_TYPEID_LOG_STR
Log string type id.
Definition: SerIds.hpp:50
FwBuffSizeType
#define FwBuffSizeType
Type representation for storing a buffer or string size.
Definition: FpConfig.hpp:79
Fw::LogStringArg::~LogStringArg
~LogStringArg()
Definition: LogString.cpp:46
Fw::LogStringArg::serialize
SerializeStatus serialize(SerializeBufferBase &buffer) const override
serialization function
Definition: LogString.cpp:57
Fw::LogStringArg::LogStringArg
LogStringArg()
Definition: LogString.cpp:18
Fw
Definition: SerIds.hpp:20