F´ Flight Software - C/C++ Documentation  NASA-v2.1.0
A framework for building embedded system applications to NASA flight quality standards.
LogString.hpp
Go to the documentation of this file.
1 #ifndef FW_LOG_STRING_TYPE_HPP
2 #define FW_LOG_STRING_TYPE_HPP
3 
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(const char* src);
20  LogStringArg(const StringBase& src);
21  LogStringArg(const LogStringArg& src);
22  LogStringArg(void);
23  ~LogStringArg(void);
24  const char* toChar(void) const;
25  NATIVE_UINT_TYPE length(void) const;
26  // This method is set by the autocode to the max length specified in the XML declaration for a particular event.
27  void setMaxSerialize(NATIVE_UINT_TYPE size); // limit amount serialized
28 
29  const LogStringArg& operator=(const LogStringArg& other);
30 
33 #if FW_SERIALIZABLE_TO_STRING
34  void toString(StringBase& text) const;
35 #endif
36 
37  private:
38 
39  NATIVE_UINT_TYPE getCapacity(void) const ;
40  void terminate(NATIVE_UINT_TYPE size);
41 
42  char m_buf[FW_LOG_STRING_MAX_SIZE];
43  NATIVE_UINT_TYPE m_maxSer;
44  };
45 
46 }
47 
48 #endif
StringType.hpp
Declares ISF string base class.
Fw::LogStringArg::~LogStringArg
~LogStringArg(void)
Definition: LogString.cpp:27
Fw::SerializeBufferBase
Definition: Serializable.hpp:43
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Fw::LogStringArg
Definition: LogString.hpp:11
Fw::StringBase
Definition: StringType.hpp:23
Fw::LogStringArg::SERIALIZED_TYPE_ID
@ SERIALIZED_TYPE_ID
Definition: LogString.hpp:15
Fw::FW_TYPEID_LOG_STR
@ FW_TYPEID_LOG_STR
Log string type id.
Definition: SerIds.hpp:50
Fw::LogStringArg::toChar
const char * toChar(void) const
Definition: LogString.cpp:34
Fw::LogStringArg::operator=
const LogStringArg & operator=(const LogStringArg &other)
equal operator for other strings
Definition: LogString.cpp:105
Fw::LogStringArg::SERIALIZED_SIZE
@ SERIALIZED_SIZE
Definition: LogString.hpp:16
Fw::LogStringArg::deserialize
SerializeStatus deserialize(SerializeBufferBase &buffer)
deserialize to contents
Definition: LogString.cpp:64
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Fw::LogStringArg::serialize
SerializeStatus serialize(SerializeBufferBase &buffer) const
serialize contents
Definition: LogString.cpp:38
Fw::LogStringArg::setMaxSerialize
void setMaxSerialize(NATIVE_UINT_TYPE size)
Definition: LogString.cpp:92
FW_LOG_STRING_MAX_SIZE
#define FW_LOG_STRING_MAX_SIZE
Max size of log string parameter type.
Definition: FpConfig.hpp:255
FpConfig.hpp
ISF configuration file.
Fw::LogStringArg::LogStringArg
LogStringArg(void)
Definition: LogString.cpp:22
Fw::LogStringArg::length
NATIVE_UINT_TYPE length(void) const
Definition: LogString.cpp:30
BasicTypes.hpp
Declares ISF basic types.
SerIds.hpp
Definitions for ISF type serial IDs.
FwBuffSizeType
#define FwBuffSizeType
Type representation for storing a buffer or string size.
Definition: FpConfig.hpp:83
Fw
Definition: Buffer.cpp:21