![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
A read-only abstract superclass for StringBase. More...
#include <Fw/Types/ConstStringBase.hpp>
Public Types | |
| using | SizeType = FwSizeType |
Public Types inherited from Fw::Serializable | |
| using | SizeType = FwSizeType |
Public Member Functions | |
| virtual const CHAR * | toChar () const =0 |
| Convert to a C-style char*. More... | |
| virtual SizeType | getCapacity () const =0 |
| Return the size of the buffer. More... | |
| virtual SizeType | length () const |
| Get the length of the string. More... | |
| SizeType | maxLength () const |
| Get the maximum length of a string that the buffer can hold (which is capacity - 1) More... | |
| SizeType | serializedSize () const |
| SizeType | serializedTruncatedSize (FwSizeType maxLength) const |
| bool | operator== (const ConstStringBase &other) const |
| Check for equality with ConstStringBase. More... | |
| bool | operator== (const CHAR *other) const |
| Check for equality with CHAR*. More... | |
| bool | operator!= (const ConstStringBase &other) const |
| Inequality with ConstStringBase. More... | |
| bool | operator!= (const CHAR *other) const |
| Inequality with CHAR*. More... | |
| SerializeStatus | serializeTo (SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override |
| Serialize the contents of this object to a buffer. More... | |
| virtual SerializeStatus | serializeTo (SerialBufferBase &buffer, SizeType maxLen, Endianness mode=Endianness::BIG) const |
| SerializeStatus | deserializeFrom (SerialBufferBase &buffer, Endianness mode=Endianness::BIG) override |
| Deserialize the contents of this object from a buffer. More... | |
| DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer) const, "Use serializeTo(SerializeBufferBase& buffer) instead") | |
| DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer, SizeType maxLen) const, "Use serializeTo(SerializeBufferBase& buffer, SizeType maxLen) instead") | |
Public Member Functions inherited from Fw::Serializable | |
| Serializable & | operator= (const Serializable &src)=default |
| TODO: this operator should be deleted, this must be done after RawTime is modified though. More... | |
| DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer) const, "Use serializeTo(SerialBufferBase& buffer) instead") | |
| DEPRECATED (SerializeStatus deserialize(SerialBufferBase &buffer), "Use deserializeFrom(SerialBufferBase& buffer) instead") | |
Static Public Member Functions | |
| static constexpr SizeType | STATIC_SERIALIZED_SIZE (SizeType maxLength) |
| static constexpr SizeType | BUFFER_SIZE (SizeType maxLength) |
| Get the size of a null-terminated string buffer. More... | |
Protected Member Functions | |
| ConstStringBase () | |
| virtual | ~ConstStringBase () |
Protected Member Functions inherited from Fw::Serializable | |
| Serializable () | |
| Default constructor. More... | |
| virtual | ~Serializable () |
| Virtual destructor. More... | |
A read-only abstract superclass for StringBase.
Definition at line 26 of file ConstStringBase.hpp.
Definition at line 28 of file ConstStringBase.hpp.
|
protected |
Definition at line 20 of file ConstStringBase.cpp.
|
protectedvirtual |
Definition at line 22 of file ConstStringBase.cpp.
Get the size of a null-terminated string buffer.
| maxLength | The maximum string length |
Definition at line 47 of file ConstStringBase.hpp.
|
inline |
Definition at line 75 of file ConstStringBase.hpp.
|
inline |
Definition at line 80 of file ConstStringBase.hpp.
|
overridevirtual |
Deserialize the contents of this object from a buffer.
This method reads serialized data from the provided buffer and reconstructs the object's data from it. The buffer should contain data in the format produced by serializeTo().
| buffer | Reference to the SerialBufferBase from which data will be deserialized |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implements Fw::Serializable.
Reimplemented in Fw::StringBase.
Definition at line 85 of file ConstStringBase.cpp.
|
pure virtual |
Return the size of the buffer.
Implemented in Fw::ExternalString, Fw::ConstExternalString, Fw::FileNameString, Fw::InternalInterfaceString, Fw::CmdStringArg, Fw::LogStringArg, Fw::TextLogString, Fw::ParamString, Fw::TlmString, Fw::ObjectName, Fw::String, Fw::StringTemplate< size >, Os::QueueString, and Os::TaskString.
|
virtual |
Get the length of the string.
Reimplemented in Fw::ConstExternalString.
Definition at line 24 of file ConstStringBase.cpp.
| ConstStringBase::SizeType Fw::ConstStringBase::maxLength | ( | ) | const |
Get the maximum length of a string that the buffer can hold (which is capacity - 1)
Definition at line 34 of file ConstStringBase.cpp.
| bool Fw::ConstStringBase::operator!= | ( | const ConstStringBase & | other | ) | const |
Inequality with ConstStringBase.
Definition at line 67 of file ConstStringBase.cpp.
| bool Fw::ConstStringBase::operator!= | ( | const CHAR * | other | ) | const |
Inequality with CHAR*.
Definition at line 71 of file ConstStringBase.cpp.
| bool Fw::ConstStringBase::operator== | ( | const ConstStringBase & | other | ) | const |
Check for equality with ConstStringBase.
Definition at line 47 of file ConstStringBase.cpp.
| bool Fw::ConstStringBase::operator== | ( | const CHAR * | other | ) | const |
Check for equality with CHAR*.
Definition at line 56 of file ConstStringBase.cpp.
| ConstStringBase::SizeType Fw::ConstStringBase::serializedSize | ( | ) | const |
Get the dynamic serialized size of a string This is the length of the string plus the size of the stored size
Definition at line 39 of file ConstStringBase.cpp.
| ConstStringBase::SizeType Fw::ConstStringBase::serializedTruncatedSize | ( | FwSizeType | maxLength | ) | const |
Get the serialized truncated size of a string This is the minimum of the dynamic serialized size and the max length
| maxLength | The max string length |
Definition at line 43 of file ConstStringBase.cpp.
|
overridevirtual |
Serialize the contents of this object to a buffer.
This method serializes the object's data into the provided buffer. The serialization process converts the object's data into a format that can be stored or transmitted, and then writes it to the buffer.
| buffer | Reference to the SerialBufferBase where data will be serialized |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implements Fw::Serializable.
Definition at line 75 of file ConstStringBase.cpp.
|
virtual |
Definition at line 79 of file ConstStringBase.cpp.
|
inlinestatic |
Get the static serialized size of a string This is the max length of the string plus the size of the stored size
| maxLength | The maximum string length |
Definition at line 41 of file ConstStringBase.hpp.
|
pure virtual |
Convert to a C-style char*.
Implemented in Fw::ExternalString, Fw::ConstExternalString, Fw::FileNameString, Fw::InternalInterfaceString, Fw::CmdStringArg, Fw::LogStringArg, Fw::TextLogString, Fw::ParamString, Fw::TlmString, Fw::ObjectName, Fw::String, Fw::StringTemplate< size >, Os::QueueString, and Os::TaskString.