F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Fw::ConstStringBase Class Referenceabstract

A read-only abstract superclass for StringBase. More...

#include <Fw/Types/ConstStringBase.hpp>

Inheritance diagram for Fw::ConstStringBase:
Fw::Serializable Fw::ConstExternalString Fw::StringBase Fw::CmdStringArg Fw::ExternalString Fw::FileNameString Fw::InternalInterfaceString Fw::LogStringArg Fw::ObjectName Fw::ParamString Fw::String Fw::StringTemplate< size > Fw::TextLogString Fw::TlmString Os::QueueString Os::TaskString

Public Types

using SizeType = FwSizeType
 
- Public Types inherited from Fw::Serializable
using SizeType = FwSizeType
 

Public Member Functions

virtual const CHARtoChar () 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
Serializableoperator= (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...
 

Detailed Description

A read-only abstract superclass for StringBase.

Definition at line 26 of file ConstStringBase.hpp.

Member Typedef Documentation

◆ SizeType

Definition at line 28 of file ConstStringBase.hpp.

Constructor & Destructor Documentation

◆ ConstStringBase()

Fw::ConstStringBase::ConstStringBase ( )
protected

Definition at line 20 of file ConstStringBase.cpp.

◆ ~ConstStringBase()

Fw::ConstStringBase::~ConstStringBase ( )
protectedvirtual

Definition at line 22 of file ConstStringBase.cpp.

Member Function Documentation

◆ BUFFER_SIZE()

static constexpr SizeType Fw::ConstStringBase::BUFFER_SIZE ( SizeType  maxLength)
inlinestatic

Get the size of a null-terminated string buffer.

Parameters
maxLengthThe maximum string length

Definition at line 47 of file ConstStringBase.hpp.

◆ DEPRECATED() [1/2]

Fw::ConstStringBase::DEPRECATED ( SerializeStatus serialize(SerialBufferBase &buffer)  const,
"Use serializeTo(SerializeBufferBase& buffer) instead"   
)
inline

Definition at line 75 of file ConstStringBase.hpp.

◆ DEPRECATED() [2/2]

Fw::ConstStringBase::DEPRECATED ( SerializeStatus serialize(SerialBufferBase &buffer, SizeType maxLen)  const,
"Use serializeTo(SerializeBufferBase& buffer, SizeType maxLen) instead"   
)
inline

Definition at line 80 of file ConstStringBase.hpp.

◆ deserializeFrom()

SerializeStatus Fw::ConstStringBase::deserializeFrom ( SerialBufferBase buffer,
Endianness  mode = Endianness::BIG 
)
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().

Parameters
bufferReference to the SerialBufferBase from which data will be deserialized
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implements Fw::Serializable.

Reimplemented in Fw::StringBase.

Definition at line 85 of file ConstStringBase.cpp.

◆ getCapacity()

◆ length()

ConstStringBase::SizeType Fw::ConstStringBase::length ( ) const
virtual

Get the length of the string.

Reimplemented in Fw::ConstExternalString.

Definition at line 24 of file ConstStringBase.cpp.

◆ maxLength()

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.

◆ operator!=() [1/2]

bool Fw::ConstStringBase::operator!= ( const ConstStringBase other) const

Inequality with ConstStringBase.

Definition at line 67 of file ConstStringBase.cpp.

◆ operator!=() [2/2]

bool Fw::ConstStringBase::operator!= ( const CHAR other) const

Inequality with CHAR*.

Definition at line 71 of file ConstStringBase.cpp.

◆ operator==() [1/2]

bool Fw::ConstStringBase::operator== ( const ConstStringBase other) const

Check for equality with ConstStringBase.

Definition at line 47 of file ConstStringBase.cpp.

◆ operator==() [2/2]

bool Fw::ConstStringBase::operator== ( const CHAR other) const

Check for equality with CHAR*.

Definition at line 56 of file ConstStringBase.cpp.

◆ serializedSize()

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.

◆ serializedTruncatedSize()

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

Parameters
maxLengthThe max string length

Definition at line 43 of file ConstStringBase.cpp.

◆ serializeTo() [1/2]

SerializeStatus Fw::ConstStringBase::serializeTo ( SerialBufferBase buffer,
Endianness  mode = Endianness::BIG 
) const
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.

Parameters
bufferReference to the SerialBufferBase where data will be serialized
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implements Fw::Serializable.

Definition at line 75 of file ConstStringBase.cpp.

◆ serializeTo() [2/2]

SerializeStatus Fw::ConstStringBase::serializeTo ( SerialBufferBase buffer,
SizeType  maxLen,
Fw::Endianness  mode = Endianness::BIG 
) const
virtual

Definition at line 79 of file ConstStringBase.cpp.

◆ STATIC_SERIALIZED_SIZE()

static constexpr SizeType Fw::ConstStringBase::STATIC_SERIALIZED_SIZE ( SizeType  maxLength)
inlinestatic

Get the static serialized size of a string This is the max length of the string plus the size of the stored size

Parameters
maxLengthThe maximum string length

Definition at line 41 of file ConstStringBase.hpp.

◆ toChar()


The documentation for this class was generated from the following files: