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

#include <Fw/DataStructures/ExternalArrayMap.hpp>

Inheritance diagram for Fw::ExternalArrayMap< K, V >:
Fw::MapBase< K, V > Fw::SizedContainer

Public Types

using ConstIterator = MapConstIterator< K, V >
 The type of a const iterator. More...
 
using Entry = SetOrMapImplEntry< K, V >
 The type of a map entry. More...
 
- Public Types inherited from Fw::MapBase< K, V >
using ConstIterator = MapConstIterator< K, V >
 The type of a map const iterator. More...
 

Public Member Functions

 ExternalArrayMap ()=default
 Zero-argument constructor. More...
 
 ExternalArrayMap (Entry *entries, FwSizeType capacity)
 
 ExternalArrayMap (ByteArray data, FwSizeType capacity)
 
 ExternalArrayMap (const ExternalArrayMap< K, V > &map)
 Copy constructor. More...
 
 ~ExternalArrayMap () override=default
 Destructor. More...
 
ExternalArrayMap< K, V > & operator= (const ExternalArrayMap< K, V > &map)
 operator= More...
 
ConstIterator begin () const override
 
void clear () override
 Clear the map. More...
 
ConstIterator end () const override
 
Success find (const K &key, V &value) const override
 
FwSizeType getCapacity () const override
 
FwSizeType getSize () const override
 
Success insert (const K &key, const V &value) override
 
Success remove (const K &key, V &value) override
 
void setStorage (Entry *entries, FwSizeType capacity)
 
void setStorage (ByteArray data, FwSizeType capacity)
 
- Public Member Functions inherited from Fw::MapBase< K, V >
void copyDataFrom (const MapBase< K, V > &map)
 Copy data from another map. More...
 
- Public Member Functions inherited from Fw::SizedContainer
bool isEmpty () const
 
bool isFull () const
 

Static Public Member Functions

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

Friends

template<typename KK , typename VV >
class ExternalArrayMapTester
 

Additional Inherited Members

- Protected Member Functions inherited from Fw::MapBase< K, V >
 MapBase ()
 Zero-argument constructor. More...
 
virtual ~MapBase ()=default
 Destructor. More...
 
- Protected Member Functions inherited from Fw::SizedContainer
 SizedContainer ()
 Zero-argument constructor. More...
 
virtual ~SizedContainer ()=default
 Destructor. More...
 

Detailed Description

template<typename K, typename V>
class Fw::ExternalArrayMap< K, V >

Definition at line 17 of file ExternalArrayMap.hpp.

Member Typedef Documentation

◆ ConstIterator

template<typename K, typename V>
using Fw::ExternalArrayMap< K, V >::ConstIterator = MapConstIterator<K, V>

The type of a const iterator.

Definition at line 31 of file ExternalArrayMap.hpp.

◆ Entry

template<typename K, typename V>
using Fw::ExternalArrayMap< K, V >::Entry = SetOrMapImplEntry<K, V>

The type of a map entry.

Definition at line 34 of file ExternalArrayMap.hpp.

Constructor & Destructor Documentation

◆ ExternalArrayMap() [1/4]

template<typename K, typename V>
Fw::ExternalArrayMap< K, V >::ExternalArrayMap ( )
default

Zero-argument constructor.

◆ ExternalArrayMap() [2/4]

template<typename K, typename V>
Fw::ExternalArrayMap< K, V >::ExternalArrayMap ( 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 46 of file ExternalArrayMap.hpp.

◆ ExternalArrayMap() [3/4]

template<typename K, typename V>
Fw::ExternalArrayMap< K, V >::ExternalArrayMap ( 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 56 of file ExternalArrayMap.hpp.

◆ ExternalArrayMap() [4/4]

template<typename K, typename V>
Fw::ExternalArrayMap< K, V >::ExternalArrayMap ( const ExternalArrayMap< K, V > &  map)
inline

Copy constructor.

Definition at line 64 of file ExternalArrayMap.hpp.

◆ ~ExternalArrayMap()

template<typename K, typename V>
Fw::ExternalArrayMap< K, V >::~ExternalArrayMap ( )
overridedefault

Destructor.

Member Function Documentation

◆ begin()

template<typename K, typename V>
ConstIterator Fw::ExternalArrayMap< K, V >::begin ( ) const
inlineoverridevirtual

Get the begin iterator

Returns
The iterator

Implements Fw::MapBase< K, V >.

Definition at line 84 of file ExternalArrayMap.hpp.

◆ clear()

template<typename K, typename V>
void Fw::ExternalArrayMap< K, V >::clear ( )
inlineoverridevirtual

Clear the map.

Implements Fw::SizedContainer.

Definition at line 87 of file ExternalArrayMap.hpp.

◆ end()

template<typename K, typename V>
ConstIterator Fw::ExternalArrayMap< K, V >::end ( ) const
inlineoverridevirtual

Get the end iterator

Returns
The iterator

Implements Fw::MapBase< K, V >.

Definition at line 91 of file ExternalArrayMap.hpp.

◆ find()

template<typename K, typename V>
Success Fw::ExternalArrayMap< K, V >::find ( const K &  key,
V &  value 
) const
inlineoverridevirtual

Find a value associated with a key in the map

Returns
SUCCESS if the item was found
Parameters
keyThe key
valueThe value

Implements Fw::MapBase< K, V >.

Definition at line 95 of file ExternalArrayMap.hpp.

◆ getByteArrayAlignment()

template<typename K, typename V>
static constexpr U8 Fw::ExternalArrayMap< K, V >::getByteArrayAlignment ( )
inlinestatic

Get the alignment of the storage for an ArraySetOrMapImpl

Returns
The alignment

Definition at line 149 of file ExternalArrayMap.hpp.

◆ getByteArraySize()

template<typename K, typename V>
static constexpr FwSizeType Fw::ExternalArrayMap< K, V >::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 154 of file ExternalArrayMap.hpp.

◆ getCapacity()

template<typename K, typename V>
FwSizeType Fw::ExternalArrayMap< K, V >::getCapacity ( ) const
inlineoverridevirtual

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

Returns
The capacity

Implements Fw::SizedContainer.

Definition at line 103 of file ExternalArrayMap.hpp.

◆ getSize()

template<typename K, typename V>
FwSizeType Fw::ExternalArrayMap< K, V >::getSize ( ) const
inlineoverridevirtual

Get the size (number of entries)

Returns
The size

Implements Fw::SizedContainer.

Definition at line 107 of file ExternalArrayMap.hpp.

◆ insert()

template<typename K, typename V>
Success Fw::ExternalArrayMap< K, V >::insert ( const K &  key,
const V &  value 
)
inlineoverridevirtual

Insert a (key, value) pair in the map

Returns
SUCCESS if there is room in the map
Parameters
keyThe key
valueThe value

Implements Fw::MapBase< K, V >.

Definition at line 111 of file ExternalArrayMap.hpp.

◆ operator=()

template<typename K, typename V>
ExternalArrayMap<K, V>& Fw::ExternalArrayMap< K, V >::operator= ( const ExternalArrayMap< K, V > &  map)
inline

operator=

Definition at line 75 of file ExternalArrayMap.hpp.

◆ remove()

template<typename K, typename V>
Success Fw::ExternalArrayMap< K, V >::remove ( const K &  key,
V &  value 
)
inlineoverridevirtual

Remove a (key, value) pair from the map

Returns
SUCCESS if the key was there
Parameters
keyThe key
valueThe value

Implements Fw::MapBase< K, V >.

Definition at line 119 of file ExternalArrayMap.hpp.

◆ setStorage() [1/2]

template<typename K, typename V>
void Fw::ExternalArrayMap< K, V >::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 127 of file ExternalArrayMap.hpp.

◆ setStorage() [2/2]

template<typename K, typename V>
void Fw::ExternalArrayMap< K, V >::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 136 of file ExternalArrayMap.hpp.

Friends And Related Function Documentation

◆ ExternalArrayMapTester

template<typename K, typename V>
template<typename KK , typename VV >
friend class ExternalArrayMapTester
friend

Definition at line 23 of file ExternalArrayMap.hpp.


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