| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // ====================================================================== | ||
| 2 | // @file TaskString.hpp | ||
| 3 | // @author F Prime | ||
| 4 | // @brief A string sized for an OS task name | ||
| 5 | // ====================================================================== | ||
| 6 | |||
| 7 | #ifndef OS_TASK_STRING_HPP | ||
| 8 | #define OS_TASK_STRING_HPP | ||
| 9 | |||
| 10 | #include <Fw/FPrimeBasicTypes.hpp> | ||
| 11 | |||
| 12 | #include "Fw/Types/StringBase.hpp" | ||
| 13 | |||
| 14 | namespace Os { | ||
| 15 | |||
| 16 | class TaskString final : public Fw::StringBase { | ||
| 17 | public: | ||
| 18 | enum { STRING_SIZE = FW_TASK_NAME_BUFFER_SIZE, SERIALIZED_SIZE = STATIC_SERIALIZED_SIZE(STRING_SIZE) }; | ||
| 19 | |||
| 20 |
1/1✓ Branch 11 taken 3703 times.
|
3703 | TaskString() : StringBase() { *this = ""; } |
| 21 | |||
| 22 |
1/1✓ Branch 11 taken 1892 times.
|
1892 | TaskString(const TaskString& src) : StringBase() { *this = src; } |
| 23 | |||
| 24 |
1/1✓ Branch 11 taken 1872 times.
|
1872 | TaskString(const ConstStringBase& src) : StringBase() { *this = src; } |
| 25 | |||
| 26 |
1/1✓ Branch 11 taken 43 times.
|
43 | explicit TaskString(const char* src) : StringBase() { *this = src; } |
| 27 | |||
| 28 | 15020 | ~TaskString() {} | |
| 29 | |||
| 30 | 3764 | TaskString& operator=(const TaskString& src) { | |
| 31 | 3764 | (void)StringBase::operator=(src); | |
| 32 | 3764 | return *this; | |
| 33 | } | ||
| 34 | |||
| 35 | 1872 | TaskString& operator=(const ConstStringBase& src) { | |
| 36 | 1872 | (void)StringBase::operator=(src); | |
| 37 | 1872 | return *this; | |
| 38 | } | ||
| 39 | |||
| 40 | 3746 | TaskString& operator=(const char* src) { | |
| 41 | 3746 | (void)StringBase::operator=(src); | |
| 42 | 3746 | return *this; | |
| 43 | } | ||
| 44 | |||
| 45 | 14676 | const char* toChar() const { return this->m_buf; } | |
| 46 | |||
| 47 | 9382 | 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 | ||
| 55 |