AMS Advanced Air Mobility Sensors UG
Loading...
Searching...
No Matches
NLibCommon Namespace Reference

Namespaces

namespace  internal
 

Classes

class  CSerializable
 Base class for serializable objects. More...
 

Functions

template<typename Type >
constexpr uint32_t SizeOfAllVariables (Type arg)
 Returns size of the argument.
 
template<typename FirstType , typename... Types>
constexpr uint32_t SizeOfAllVariables (FirstType firstVar, Types... vars)
 Returns cumulative size of all argumet types.
 
template<typename... Types>
bool Serialize (std::vector< uint8_t > &orBytes, const Types &... args)
 Serialize a sequence on variables All arguments must be of arithmetic type or an enum, and not boolean.
 
template<typename... Types>
bool Deserialize (const std::vector< uint8_t > &korBytes, Types &... args)
 Parse a sequence of bytes and assign values to arguments. All arguments must be of arithmetic type or an enum, and not boolean.
 

Function Documentation

◆ Deserialize()

template<typename... Types>
bool NLibCommon::Deserialize ( const std::vector< uint8_t > &  korBytes,
Types &...  args 
)

Parse a sequence of bytes and assign values to arguments. All arguments must be of arithmetic type or an enum, and not boolean.

Template Parameters
...TypesArgument types.
Parameters
korBytesByte vector to parse.
...argsArguments to assign values to.
Returns
True on success, false on failure.

◆ Serialize()

template<typename... Types>
bool NLibCommon::Serialize ( std::vector< uint8_t > &  orBytes,
const Types &...  args 
)

Serialize a sequence on variables All arguments must be of arithmetic type or an enum, and not boolean.

Template Parameters
...TypesArgument types.
Parameters
orBytesOutput byte vector.
...argsSequence of arguments to be serialized.
Returns
True on success, false on failure.

◆ SizeOfAllVariables() [1/2]

template<typename FirstType , typename... Types>
constexpr uint32_t NLibCommon::SizeOfAllVariables ( FirstType  firstVar,
Types...  vars 
)
constexpr

Returns cumulative size of all argumet types.

Template Parameters
FirstTypeType of the first argument.
...TypesArgument types.
Parameters
firstVarThe first argument.
...varsThe rest arguments.
Returns
Cumulative size of all arguments.

◆ SizeOfAllVariables() [2/2]

template<typename Type >
constexpr uint32_t NLibCommon::SizeOfAllVariables ( Type  arg)
constexpr

Returns size of the argument.

Template Parameters
TypeType of the argument.
Parameters
argArgument.
Returns
Size of the argument.