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
InternalInterfaceString.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // @file InternalInterfaceString.hpp
3 // @author F Prime
4 // @brief A string sized for an internal port argument
5 // ======================================================================
6 
7 #ifndef FW_INTERNAL_INTERFACE_STRING_HPP
8 #define FW_INTERNAL_INTERFACE_STRING_HPP
9 
10 #include <FpConfig.hpp>
11 
12 #include "Fw/Cfg/SerIds.hpp"
13 #include "Fw/Types/StringBase.hpp"
15 
16 namespace Fw {
17 
18 class InternalInterfaceString final : public StringBase {
19  public:
20  enum {
24  };
25 
26  InternalInterfaceString() : StringBase() { *this = ""; }
27 
28  explicit InternalInterfaceString(const InternalInterfaceString& src) : StringBase() { *this = src; }
29 
30  explicit InternalInterfaceString(const StringBase& src) : StringBase() { *this = src; }
31 
32  explicit InternalInterfaceString(const char* src) : StringBase() { *this = src; }
33 
35 
37  (void)StringBase::operator=(src);
38  return *this;
39  }
40 
42  (void)StringBase::operator=(src);
43  return *this;
44  }
45 
46  InternalInterfaceString& operator=(const char* src) {
47  (void)StringBase::operator=(src);
48  return *this;
49  }
50 
51  const char* toChar() const { return this->m_buf; }
52 
53  StringBase::SizeType getCapacity() const { return sizeof this->m_buf; }
54 
55  private:
56  char m_buf[BUFFER_SIZE(STRING_SIZE)];
57 };
58 } // namespace Fw
59 
60 #endif
#define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
Max size of interface string parameter type.
Definition: FpConfig.h:349
C++-compatible configuration header for fprime configuration.
Definitions for ISF type serial IDs.
Declares F Prime string base class.
InternalInterfaceString & operator=(const StringBase &src)
StringBase::SizeType getCapacity() const
return size of buffer
InternalInterfaceString & operator=(const InternalInterfaceString &src)
InternalInterfaceString(const StringBase &src)
InternalInterfaceString & operator=(const char *src)
InternalInterfaceString(const InternalInterfaceString &src)
NATIVE_UINT_TYPE SizeType
Definition: StringBase.hpp:26
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength)
Definition: StringBase.hpp:35
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
Definition: StringBase.hpp:41
@ FW_TYPEID_INTERNAL_INTERFACE_STRING
interface string Buffer type id
Definition: SerIds.hpp:58