mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
* Refactored type organization * Creating better configuration/types header hierarchy * Replace FpConfig type aliases with FPP generated aliases * Add the aliases to the FPP model * Config + Type Aliases builds * Renamed Fw/Types.h,hpp to Fw/FPrimeBasicTypes.h,hpp * Updating to FPP-a7 * Adding newline * sp * Fixing minor nit from review * Spurious ; --------- Co-authored-by: Andrei Tumbar <andrei.tumbar@jpl.nasa.gov>
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// ======================================================================
|
|
// @file QueueString.hpp
|
|
// @author F Prime
|
|
// @brief A string sized for an OS queue name
|
|
// ======================================================================
|
|
|
|
#ifndef OS_QUEUE_STRING_HPP
|
|
#define OS_QUEUE_STRING_HPP
|
|
|
|
#include <Fw/FPrimeBasicTypes.hpp>
|
|
|
|
#include "Fw/Types/StringBase.hpp"
|
|
|
|
namespace Os {
|
|
|
|
class QueueString final : public Fw::StringBase {
|
|
public:
|
|
enum { STRING_SIZE = FW_QUEUE_NAME_BUFFER_SIZE, SERIALIZED_SIZE = STATIC_SERIALIZED_SIZE(STRING_SIZE) };
|
|
|
|
QueueString() : StringBase() { *this = ""; }
|
|
|
|
QueueString(const QueueString& src) : StringBase() { *this = src; }
|
|
|
|
QueueString(const StringBase& src) : StringBase() { *this = src; }
|
|
|
|
explicit QueueString(const char* src) : StringBase() { *this = src; }
|
|
|
|
~QueueString() {}
|
|
|
|
QueueString& operator=(const QueueString& src) {
|
|
(void)StringBase::operator=(src);
|
|
return *this;
|
|
}
|
|
|
|
QueueString& operator=(const StringBase& src) {
|
|
(void)StringBase::operator=(src);
|
|
return *this;
|
|
}
|
|
|
|
QueueString& operator=(const char* src) {
|
|
(void)StringBase::operator=(src);
|
|
return *this;
|
|
}
|
|
|
|
const char* toChar() const { return this->m_buf; }
|
|
|
|
StringBase::SizeType getCapacity() const { return sizeof this->m_buf; }
|
|
|
|
private:
|
|
char m_buf[BUFFER_SIZE(STRING_SIZE)];
|
|
};
|
|
} // namespace Os
|
|
|
|
#endif
|