mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
* Revise String.hpp Remove explicit keyword * Revise FppTest Update FPP version Re-enable commented-out ports * Revise ActiveTest * Revise FppTest for components * Revise FppTest tests for components * Revise FppTest for components * Revise FppTest * Revise FppTest * Revise FppTest * Fix warnings on fprime dev machine * Update fpp version * Remove external keyword from constructors
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// ======================================================================
|
|
// @file TaskString.hpp
|
|
// @author F Prime
|
|
// @brief A string sized for an OS task name
|
|
// ======================================================================
|
|
|
|
#ifndef OS_TASK_STRING_HPP
|
|
#define OS_TASK_STRING_HPP
|
|
|
|
#include <FpConfig.hpp>
|
|
|
|
#include "Fw/Types/StringBase.hpp"
|
|
|
|
namespace Os {
|
|
|
|
class TaskString final : public Fw::StringBase {
|
|
public:
|
|
enum { STRING_SIZE = FW_TASK_NAME_BUFFER_SIZE, SERIALIZED_SIZE = STATIC_SERIALIZED_SIZE(STRING_SIZE) };
|
|
|
|
TaskString() : StringBase() { *this = ""; }
|
|
|
|
TaskString(const TaskString& src) : StringBase() { *this = src; }
|
|
|
|
TaskString(const StringBase& src) : StringBase() { *this = src; }
|
|
|
|
explicit TaskString(const char* src) : StringBase() { *this = src; }
|
|
|
|
~TaskString() {}
|
|
|
|
TaskString& operator=(const TaskString& src) {
|
|
(void)StringBase::operator=(src);
|
|
return *this;
|
|
}
|
|
|
|
TaskString& operator=(const StringBase& src) {
|
|
(void)StringBase::operator=(src);
|
|
return *this;
|
|
}
|
|
|
|
TaskString& 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
|