F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Fw::ArraySetOrMapImpl< KE, VN > Class Template Referencefinal

#include <Fw/DataStructures/ArraySetOrMapImpl.hpp>

Classes

class  ConstIterator
 Const iterator. More...
 

Public Types

using Entry = SetOrMapImplEntry< KE, VN >
 The type of an entry in the set or map. More...
 

Public Member Functions

 ArraySetOrMapImpl ()=default
 Zero-argument constructor. More...
 
 ArraySetOrMapImpl (Entry *entries, FwSizeType capacity)
 
 ArraySetOrMapImpl (ByteArray data, FwSizeType capacity)
 
 ArraySetOrMapImpl (const ArraySetOrMapImpl< KE, VN > &impl)
 Copy constructor. More...
 
 ~ArraySetOrMapImpl ()=default
 Destructor. More...
 
ArraySetOrMapImpl< KE, VN > & operator= (const ArraySetOrMapImpl< KE, VN > &impl)
 operator= More...
 
ConstIterator begin () const
 Get the begin iterator. More...
 
void clear ()
 Clear the set or map. More...
 
ConstIterator end () const
 Get the end iterator. More...
 
Success find (const KE &keyOrElement, VN &valueOrNil) const
 
FwSizeType getCapacity () const
 
FwSizeType getSize () const
 
Success insert (const KE &keyOrElement, const VN &valueOrNil)
 
Success remove (const KE &keyOrElement, VN &valueOrNil)
 
void setStorage (Entry *entries, FwSizeType capacity)
 
void setStorage (ByteArray data, FwSizeType capacity)
 

Static Public Member Functions

static constexpr U8 getByteArrayAlignment ()
 
static constexpr FwSizeType getByteArraySize (FwSizeType capacity)
 

Friends

template<typename KK , typename VV >
class ArraySetOrMapImplTester
 

Detailed Description

template<typename KE, typename VN>
class Fw::ArraySetOrMapImpl< KE, VN >

Definition at line 19 of file ArraySetOrMapImpl.hpp.

Member Typedef Documentation

◆ Entry

template<typename KE, typename VN>
using Fw::ArraySetOrMapImpl< KE, VN >::Entry = SetOrMapImplEntry<KE, VN>

The type of an entry in the set or map.

Definition at line 33 of file ArraySetOrMapImpl.hpp.

Constructor & Destructor Documentation

◆ ArraySetOrMapImpl() [1/4]

template<typename KE, typename VN>
Fw::ArraySetOrMapImpl< KE, VN >::ArraySetOrMapImpl ( )
default

Zero-argument constructor.

◆ ArraySetOrMapImpl() [2/4]

template<typename KE, typename VN>
Fw::ArraySetOrMapImpl< KE, VN >::ArraySetOrMapImpl ( Entry entries,
FwSizeType  capacity 
)
inline

Constructor providing typed backing storage. entries must point to at least capacity elements of type Entry.

Parameters
entriesThe entries
capacityThe capacity

Definition at line 124 of file ArraySetOrMapImpl.hpp.

◆ ArraySetOrMapImpl() [3/4]

template<typename KE, typename VN>
Fw::ArraySetOrMapImpl< KE, VN >::ArraySetOrMapImpl ( ByteArray  data,
FwSizeType  capacity 
)
inline

Constructor providing untyped backing storage. data must be aligned according to getByteArrayAlignment(). data must contain at least getByteArraySize(capacity) bytes.

Parameters
dataThe data
capacityThe capacity

Definition at line 133 of file ArraySetOrMapImpl.hpp.

◆ ArraySetOrMapImpl() [4/4]

template<typename KE, typename VN>
Fw::ArraySetOrMapImpl< KE, VN >::ArraySetOrMapImpl ( const ArraySetOrMapImpl< KE, VN > &  impl)
inline

Copy constructor.

Definition at line 140 of file ArraySetOrMapImpl.hpp.

◆ ~ArraySetOrMapImpl()

template<typename KE, typename VN>
Fw::ArraySetOrMapImpl< KE, VN >::~ArraySetOrMapImpl ( )
default

Destructor.

Member Function Documentation

◆ begin()

template<typename KE, typename VN>
ConstIterator Fw::ArraySetOrMapImpl< KE, VN >::begin ( ) const
inline

Get the begin iterator.

Definition at line 160 of file ArraySetOrMapImpl.hpp.

◆ clear()

template<typename KE, typename VN>
void Fw::ArraySetOrMapImpl< KE, VN >::clear ( )
inline

Clear the set or map.

Definition at line 163 of file ArraySetOrMapImpl.hpp.

◆ end()

template<typename KE, typename VN>
ConstIterator Fw::ArraySetOrMapImpl< KE, VN >::end ( ) const
inline

Get the end iterator.

Definition at line 166 of file ArraySetOrMapImpl.hpp.

◆ find()

template<typename KE, typename VN>
Success Fw::ArraySetOrMapImpl< KE, VN >::find ( const KE &  keyOrElement,
VN &  valueOrNil 
) const
inline

Find a value associated with a key in the map or an element in a set

Returns
SUCCESS if the item was found
Parameters
keyOrElementThe key or element
valueOrNilThe value or Nil

Definition at line 174 of file ArraySetOrMapImpl.hpp.

◆ getByteArrayAlignment()

template<typename KE, typename VN>
static constexpr U8 Fw::ArraySetOrMapImpl< KE, VN >::getByteArrayAlignment ( )
inlinestatic

Get the alignment of the storage for an ArraySetOrMapImpl

Returns
The alignment

Definition at line 265 of file ArraySetOrMapImpl.hpp.

◆ getByteArraySize()

template<typename KE, typename VN>
static constexpr FwSizeType Fw::ArraySetOrMapImpl< KE, VN >::getByteArraySize ( FwSizeType  capacity)
inlinestatic

Get the size of the storage for an ExternalArray of the specified capacity, as a byte array

Returns
The byte array size
Parameters
capacityThe capacity

Definition at line 270 of file ArraySetOrMapImpl.hpp.

◆ getCapacity()

template<typename KE, typename VN>
FwSizeType Fw::ArraySetOrMapImpl< KE, VN >::getCapacity ( ) const
inline

Get the capacity of the set or map (max number of entries)

Returns
The capacity

Definition at line 191 of file ArraySetOrMapImpl.hpp.

◆ getSize()

template<typename KE, typename VN>
FwSizeType Fw::ArraySetOrMapImpl< KE, VN >::getSize ( ) const
inline

Get the size (number of entries)

Returns
The size

Definition at line 195 of file ArraySetOrMapImpl.hpp.

◆ insert()

template<typename KE, typename VN>
Success Fw::ArraySetOrMapImpl< KE, VN >::insert ( const KE &  keyOrElement,
const VN &  valueOrNil 
)
inline

Insert an element in the set or a (key, value) pair in the map

Returns
SUCCESS if there is room in the set or map
Parameters
keyOrElementThe key or element
valueOrNilThe value or Nil

Definition at line 199 of file ArraySetOrMapImpl.hpp.

◆ operator=()

template<typename KE, typename VN>
ArraySetOrMapImpl<KE, VN>& Fw::ArraySetOrMapImpl< KE, VN >::operator= ( const ArraySetOrMapImpl< KE, VN > &  impl)
inline

operator=

Definition at line 151 of file ArraySetOrMapImpl.hpp.

◆ remove()

template<typename KE, typename VN>
Success Fw::ArraySetOrMapImpl< KE, VN >::remove ( const KE &  keyOrElement,
VN &  valueOrNil 
)
inline

Remove an element from the set or a (key, value) pair from the map

Returns
SUCCESS if the key or element was there
Parameters
keyOrElementThe key or element
valueOrNilThe value or Nil

Definition at line 221 of file ArraySetOrMapImpl.hpp.

◆ setStorage() [1/2]

template<typename KE, typename VN>
void Fw::ArraySetOrMapImpl< KE, VN >::setStorage ( Entry entries,
FwSizeType  capacity 
)
inline

Set the backing storage (typed data) entries must point to at least capacity elements of type Entry.

Parameters
entriesThe entries
capacityThe capacity

Definition at line 241 of file ArraySetOrMapImpl.hpp.

◆ setStorage() [2/2]

template<typename KE, typename VN>
void Fw::ArraySetOrMapImpl< KE, VN >::setStorage ( ByteArray  data,
FwSizeType  capacity 
)
inline

Set the backing storage (untyped data) data must be aligned according to getByteArrayAlignment(). data must contain at least getByteArraySize(capacity) bytes.

Parameters
dataThe data
capacityThe capacity

Definition at line 251 of file ArraySetOrMapImpl.hpp.

Friends And Related Function Documentation

◆ ArraySetOrMapImplTester

template<typename KE, typename VN>
template<typename KK , typename VV >
friend class ArraySetOrMapImplTester
friend

Definition at line 25 of file ArraySetOrMapImpl.hpp.


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