ISAAC  0.2.11
Flight software for the ISAAC project, adding functionality to the Astrobee robot, operating inside the International Space Station.
All Classes Functions Variables Pages
happly::TypedListProperty< T > Class Template Reference

A property which is a list of value (eg, 3 doubles). Note that lists are always variable length per-element. More...

#include <happly.h>

Inheritance diagram for happly::TypedListProperty< T >:
Collaboration diagram for happly::TypedListProperty< T >:

Public Member Functions

 TypedListProperty (const std::string &name_, int listCountBytes_)
 Create a new Property with the given name. More...
 
 TypedListProperty (const std::string &name_, const std::vector< std::vector< T >> &data_)
 Create a new property and initialize with data. More...
 
virtual void reserve (size_t capacity) override
 Reserve memory. More...
 
virtual void parseNext (const std::vector< std::string > &tokens, size_t &currEntry) override
 (ASCII reading) Parse out the next value of this property from a list of tokens. More...
 
virtual void readNext (std::istream &stream) override
 (binary reading) Copy the next value of this property from a stream of bits. More...
 
virtual void readNextBigEndian (std::istream &stream) override
 (binary reading) Copy the next value of this property from a stream of bits. More...
 
virtual void writeHeader (std::ostream &outStream) override
 (reading) Write a header entry for this property. Note that we already use "uchar" for the list count type. More...
 
virtual void writeDataASCII (std::ostream &outStream, size_t iElement) override
 (ASCII writing) write this property for some element to a stream in plaintext More...
 
virtual void writeDataBinary (std::ostream &outStream, size_t iElement) override
 (binary writing) copy the bits of this property for some element to a stream More...
 
virtual void writeDataBinaryBigEndian (std::ostream &outStream, size_t iElement) override
 (binary writing) copy the bits of this property for some element to a stream More...
 
virtual size_t size () override
 Number of element entries for this property. More...
 
virtual std::string propertyTypeName () override
 A string naming the type of the property. More...
 
- Public Member Functions inherited from happly::Property
 Property (const std::string &name_)
 Create a new Property with the given name. More...
 

Public Attributes

std::vector< T > flattenedData
 The (flattened) data for the property, as formed by concatenating all of the individual element lists together.
 
std::vector< size_t > flattenedIndexStart
 Indices in to flattenedData. The i'th element gives the index in to flattenedData where the element's data begins. A final entry is included which is the length of flattenedData. Size is N_elem + 1.
 
int listCountBytes = -1
 The number of bytes used to store the count for lists of data.
 
- Public Attributes inherited from happly::Property
std::string name
 

Detailed Description

template<class T>
class happly::TypedListProperty< T >

A property which is a list of value (eg, 3 doubles). Note that lists are always variable length per-element.

Constructor & Destructor Documentation

◆ TypedListProperty() [1/2]

template<class T >
happly::TypedListProperty< T >::TypedListProperty ( const std::string &  name_,
int  listCountBytes_ 
)
inline

Create a new Property with the given name.

Parameters
name_

◆ TypedListProperty() [2/2]

template<class T >
happly::TypedListProperty< T >::TypedListProperty ( const std::string &  name_,
const std::vector< std::vector< T >> &  data_ 
)
inline

Create a new property and initialize with data.

Parameters
name_
data_

Member Function Documentation

◆ parseNext()

template<class T >
virtual void happly::TypedListProperty< T >::parseNext ( const std::vector< std::string > &  tokens,
size_t &  currEntry 
)
inlineoverridevirtual

(ASCII reading) Parse out the next value of this property from a list of tokens.

Parameters
tokensThe list of property tokens for the element.
currEntryIndex in to tokens, updated after this property is read.

Implements happly::Property.

◆ propertyTypeName()

template<class T >
virtual std::string happly::TypedListProperty< T >::propertyTypeName ( )
inlineoverridevirtual

A string naming the type of the property.

Returns

Implements happly::Property.

◆ readNext()

template<class T >
virtual void happly::TypedListProperty< T >::readNext ( std::istream &  stream)
inlineoverridevirtual

(binary reading) Copy the next value of this property from a stream of bits.

Parameters
streamStream to read from.

Implements happly::Property.

◆ readNextBigEndian()

template<class T >
virtual void happly::TypedListProperty< T >::readNextBigEndian ( std::istream &  stream)
inlineoverridevirtual

(binary reading) Copy the next value of this property from a stream of bits.

Parameters
streamStream to read from.

Implements happly::Property.

◆ reserve()

template<class T >
virtual void happly::TypedListProperty< T >::reserve ( size_t  capacity)
inlineoverridevirtual

Reserve memory.

Parameters
capacityExpected number of elements.

Implements happly::Property.

◆ size()

template<class T >
virtual size_t happly::TypedListProperty< T >::size ( )
inlineoverridevirtual

Number of element entries for this property.

Returns

Implements happly::Property.

◆ writeDataASCII()

template<class T >
virtual void happly::TypedListProperty< T >::writeDataASCII ( std::ostream &  outStream,
size_t  iElement 
)
inlineoverridevirtual

(ASCII writing) write this property for some element to a stream in plaintext

Parameters
outStreamStream to write to.
iElementindex of the element to write.

Implements happly::Property.

◆ writeDataBinary()

template<class T >
virtual void happly::TypedListProperty< T >::writeDataBinary ( std::ostream &  outStream,
size_t  iElement 
)
inlineoverridevirtual

(binary writing) copy the bits of this property for some element to a stream

Parameters
outStreamStream to write to.
iElementindex of the element to write.

Implements happly::Property.

◆ writeDataBinaryBigEndian()

template<class T >
virtual void happly::TypedListProperty< T >::writeDataBinaryBigEndian ( std::ostream &  outStream,
size_t  iElement 
)
inlineoverridevirtual

(binary writing) copy the bits of this property for some element to a stream

Parameters
outStreamStream to write to.
iElementindex of the element to write.

Implements happly::Property.

◆ writeHeader()

template<class T >
virtual void happly::TypedListProperty< T >::writeHeader ( std::ostream &  outStream)
inlineoverridevirtual

(reading) Write a header entry for this property. Note that we already use "uchar" for the list count type.

Parameters
outStreamStream to write to.

Implements happly::Property.


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