![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Implementation of malloc based allocator. More...
Namespaces | |
| DpCfg | |
| MemoryAllocation | |
| StringUtils | |
Typedefs | |
| using | ComPacketType = ComCfg::Apid::T |
| using | SerializeBufferBase = LinearBufferBase |
| forward declaration More... | |
Variables | |
| const Time | ZERO_TIME = Time() |
Implementation of malloc based allocator.
File: Logger.cpp Description: Framework logging implementation Author: mstarch
This file adds in support to the core 'Fw' package, to separate it from Os and other loggers, and allow the architect of the system to select which core framework logging should be used.
C-string helper utilities. Note: wherever possible, use Fw::StringBase and derived classes instead of raw C-strings.
| using Fw::ComPacketType = typedef ComCfg::Apid::T |
Definition at line 20 of file ComPacket.hpp.
| using Fw::SerializeBufferBase = typedef LinearBufferBase |
forward declaration
Definition at line 30 of file Serializable.hpp.
| anonymous enum |
| Enumerator | |
|---|---|
| FW_TYPEID_U8 | U8 serialized type id. |
| FW_TYPEID_18 | I8 serialized type id. |
| FW_TYPEID_U16 | U16 serialized type id. |
| FW_TYPEID_I16 | I16 serialized type id. |
| FW_TYPEID_U32 | U32 serialized type id. |
| FW_TYPEID_I32 | I32 serialized type id. |
| FW_TYPEID_U64 | U64 serialized type id. |
| FW_TYPEID_I64 | I64 serialized type id. |
| FW_TYPEID_F32 | F32 serialized type id. |
| FW_TYPEID_F64 | F64 serialized type id. |
| FW_TYPEID_BOOL | boolean serialized type id |
| FW_TYPEID_PTR | pointer serialized type id |
| FW_TYPEID_BUFF | buffer serialized type id |
| FW_TYPEID_POLY | PolyType serialized type id. |
| FW_TYPEID_CMD_BUFF | Command Buffer type id. |
| FW_TYPEID_CMD_STR | Command string type id. |
| FW_TYPEID_TLM_BUFF | Telemetry Buffer type id. |
| FW_TYPEID_TLM_STR | Telemetry string type id. |
| FW_TYPEID_LOG_BUFF | Log Buffer type id. |
| FW_TYPEID_LOG_STR | Log string type id. |
| FW_TYPEID_PRM_BUFF | Parameter Buffer type id. |
| FW_TYPEID_PRM_STR | Parameter string type id. |
| FW_TYPEID_FILE_BUFF | File piece Buffer type id. |
| FW_TYPEID_EIGHTY_CHAR_STRING | 80 char string Buffer type id |
| FW_TYPEID_INTERNAL_INTERFACE_STRING | interface string Buffer type id |
| FW_TYPEID_FIXED_LENGTH_STRING | 256 char string Buffer type id |
| FW_TYPEID_OBJECT_NAME | ObjectName string Buffer type id. |
| FW_TYPEID_FILE_NAME_STRING | FileName string Buffer type id. |
Definition at line 21 of file SerIds.hpp.
|
strong |
| Enumerator | |
|---|---|
| BIG | Big endian serialization. |
| LITTLE | Little endian serialization. |
Definition at line 39 of file Serializable.hpp.
|
strong |
status of string format calls
Definition at line 18 of file format.hpp.
| enum Fw::SerializeStatus |
forward declaration for string
| Enumerator | |
|---|---|
| FW_SERIALIZE_OK | Serialization/Deserialization operation was successful. |
| FW_SERIALIZE_FORMAT_ERROR | Data was the wrong format (e.g. wrong packet type) |
| FW_SERIALIZE_NO_ROOM_LEFT | No room left in the buffer to serialize data. |
| FW_DESERIALIZE_BUFFER_EMPTY | Deserialization buffer was empty when trying to read more data. |
| FW_DESERIALIZE_FORMAT_ERROR | Deserialization data had incorrect values (unexpected data types) |
| FW_DESERIALIZE_SIZE_MISMATCH | Data was left in the buffer, but not enough to deserialize. |
| FW_DESERIALIZE_TYPE_MISMATCH | Deserialized type ID didn't match. |
| FW_DESERIALIZE_IMMUTABLE | Attempted to deserialize into an immutable buffer. |
| FW_SERIALIZE_DISCARDED_EXISTING | Serialization succeeded, but deleted old data. |
Definition at line 14 of file Serializable.hpp.
| void Fw::arrayPlacementDestruct | ( | T * | arrayPointer, |
| FwSizeType | arraySize | ||
| ) |
placement delete for arrays
This is the partner of tha above function that performs the destructor operation on every element of type T in the array. This assumes that all elements have been constructed.
| T | the type of the array elements |
| arrayPointer | pointer to an array of type T |
| arraySize | the number of elements in the array |
Definition at line 62 of file LanguageHelpers.hpp.
| T* Fw::arrayPlacementNew | ( | Fw::ByteArray | array, |
| FwSizeType | arraySize | ||
| ) |
placement new for arrays
C++ as a language does not guaranteed that placement new for a C++ array of length N will fit within a memory region of size N *sizeof(T). Moreover, there are some compilers whose implementation of placement new for arrays do not guarantee this property.
This function provides a helper for placement new for arrays that guarantees that the array will fit within the provided memory region. It checks that the provided memory region is large enough to hold the array (N * sizeof(T) and that the alignment of the provided memory region is sufficient for the type T. It also checks that the provided memory region is non-null.
| T | the type of the array elements |
| array | the byte array to use for placement new (pair of bytes pointer and size) |
| arraySize | the number of elements in the array |
Definition at line 36 of file LanguageHelpers.hpp.
| void Fw::defaultPrintAssert | ( | const CHAR * | msg | ) |
Definition at line 16 of file Assert.cpp.
| void Fw::defaultReportAssert | ( | FILE_NAME_ARG | file, |
| FwSizeType | lineNo, | ||
| FwSizeType | numArgs, | ||
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwAssertArgType | arg4, | ||
| FwAssertArgType | arg5, | ||
| FwAssertArgType | arg6, | ||
| CHAR * | destBuffer, | ||
| FwSizeType | buffSize | ||
| ) |
Definition at line 22 of file Assert.cpp.
| I8 Fw::defaultSwAssert | ( | FILE_NAME_ARG | file, |
| FwSizeType | lineNo, | ||
| FwSizeType | numArgs, | ||
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwAssertArgType | arg4, | ||
| FwAssertArgType | arg5, | ||
| FwAssertArgType | arg6 | ||
| ) |
Definition at line 112 of file Assert.cpp.
| Fw::FormatStatus Fw::stringFormat | ( | char * | destination, |
| const FwSizeType | maximumSize, | ||
| const char * | formatString, | ||
| ... | |||
| ) |
format a c-string
Format a string using printf family formatting semantics. Destination will be filled with the formatted string up to maximumSize - 1. This function will always terminate the string with a \0.
This function can return several error codes: OVERFLOWED: the complete string did not fit in the buffer with an appended null-terminator INVALID_FORMAT_STRING: the format string was null OTHER_ERROR: another error occurred in an underlying function call Otherwise SUCCESS is returned. destination may be modified even in the case of an error.
| destination | destination to fill with the formatted string |
| maximumSize | size of the buffer represented by destination |
| formatString | format string to fill |
| ... | variable arguments inputs |
Definition at line 10 of file snprintf_format.cpp.
| Fw::FormatStatus Fw::stringFormat | ( | char * | destination, |
| const FwSizeType | maximumSize, | ||
| const char * | formatString, | ||
| va_list | args | ||
| ) |
format a c-string
Format a string using printf family formatting semantics. Destination will be filled with the formatted string up to maximumSize - 1. This function will always terminate the string with a \0.
This function can return several error codes: OVERFLOWED: the complete string did not fit in the buffer with an appended null-terminator INVALID_FORMAT_STRING: the format string was null OTHER_ERROR: another error occurred in an underlying function call Otherwise SUCCESS is returned. destination may be modified even in the case of an error.
This version take a variable argument list
| destination | destination to fill with the formatted string |
| maximumSize | size of the buffer represented by destination |
| formatString | format string to fill |
| args | variable arguments list |
Definition at line 18 of file snprintf_format.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwSizeType | lineNo | ||
| ) |
Assert with no arguments.
Definition at line 135 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with one argument.
Definition at line 139 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with two arguments.
Definition at line 143 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with three arguments.
Definition at line 147 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwAssertArgType | arg4, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with four arguments.
Definition at line 151 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwAssertArgType | arg4, | ||
| FwAssertArgType | arg5, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with five arguments.
Definition at line 160 of file Assert.cpp.
| I8 Fw::SwAssert | ( | FILE_NAME_ARG | file, |
| FwAssertArgType | arg1, | ||
| FwAssertArgType | arg2, | ||
| FwAssertArgType | arg3, | ||
| FwAssertArgType | arg4, | ||
| FwAssertArgType | arg5, | ||
| FwAssertArgType | arg6, | ||
| FwSizeType | lineNo | ||
| ) |
Assert with six arguments.
Definition at line 170 of file Assert.cpp.