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
QueueString.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // @file QueueString.hpp
3 // @author F Prime
4 // @brief A string sized for an OS queue name
5 // ======================================================================
6 
7 #ifndef OS_QUEUE_STRING_HPP
8 #define OS_QUEUE_STRING_HPP
9 
10 #include <FpConfig.hpp>
11 
12 #include "Fw/Types/StringBase.hpp"
13 
14 namespace Os {
15 
16 class QueueString final : public Fw::StringBase {
17  public:
19 
20  QueueString() : StringBase() { *this = ""; }
21 
22  explicit QueueString(const QueueString& src) : StringBase() { *this = src; }
23 
24  explicit QueueString(const StringBase& src) : StringBase() { *this = src; }
25 
26  explicit QueueString(const char* src) : StringBase() { *this = src; }
27 
29 
31  (void)StringBase::operator=(src);
32  return *this;
33  }
34 
36  (void)StringBase::operator=(src);
37  return *this;
38  }
39 
40  QueueString& operator=(const char* src) {
41  (void)StringBase::operator=(src);
42  return *this;
43  }
44 
45  const char* toChar() const { return this->m_buf; }
46 
47  StringBase::SizeType getCapacity() const { return sizeof this->m_buf; }
48 
49  private:
50  char m_buf[BUFFER_SIZE(STRING_SIZE)];
51 };
52 } // namespace Os
53 
54 #endif
#define FW_QUEUE_NAME_BUFFER_SIZE
Max size of message queue name.
Definition: FpConfig.h:272
C++-compatible configuration header for fprime configuration.
Declares F Prime string base class.
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
QueueString(const StringBase &src)
Definition: QueueString.hpp:24
QueueString & operator=(const QueueString &src)
Definition: QueueString.hpp:30
QueueString(const char *src)
Definition: QueueString.hpp:26
QueueString(const QueueString &src)
Definition: QueueString.hpp:22
QueueString & operator=(const StringBase &src)
Definition: QueueString.hpp:35
QueueString & operator=(const char *src)
Definition: QueueString.hpp:40
StringBase::SizeType getCapacity() const
return size of buffer
Definition: QueueString.hpp:47
const char * toChar() const
Definition: QueueString.hpp:45