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

#include <Fw/DataStructures/MapBase.hpp>

Inheritance diagram for Fw::MapBase< K, V >:
Fw::SizedContainer Fw::ArrayMap< K, V, C > Fw::ExternalArrayMap< K, V > Fw::ExternalRedBlackTreeMap< K, V > Fw::RedBlackTreeMap< K, V, C >

Public Types

using ConstIterator = MapConstIterator< K, V >
 The type of a map const iterator. More...
 

Public Member Functions

virtual ConstIterator begin () const =0
 
void copyDataFrom (const MapBase< K, V > &map)
 Copy data from another map. More...
 
virtual ConstIterator end () const =0
 
virtual Success find (const K &key, V &value) const =0
 
virtual Success insert (const K &key, const V &value)=0
 
virtual Success remove (const K &key, V &value)=0
 
- Public Member Functions inherited from Fw::SizedContainer
virtual void clear ()=0
 Clear the container. More...
 
virtual FwSizeType getSize () const =0
 
virtual FwSizeType getCapacity () const =0
 
bool isEmpty () const
 
bool isFull () const
 

Protected Member Functions

 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::MapBase< K, V >

Definition at line 18 of file MapBase.hpp.

Member Typedef Documentation

◆ ConstIterator

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

The type of a map const iterator.

Definition at line 39 of file MapBase.hpp.

Constructor & Destructor Documentation

◆ MapBase()

template<typename K, typename V>
Fw::MapBase< K, V >::MapBase ( )
inlineprotected

Zero-argument constructor.

Definition at line 47 of file MapBase.hpp.

◆ ~MapBase()

template<typename K, typename V>
virtual Fw::MapBase< K, V >::~MapBase ( )
protectedvirtualdefault

Destructor.

Member Function Documentation

◆ begin()

template<typename K, typename V>
virtual ConstIterator Fw::MapBase< K, V >::begin ( ) const
pure virtual

Get the begin value of the iterator

Returns
The iterator

Implemented in Fw::ExternalRedBlackTreeMap< K, V >, Fw::ExternalArrayMap< K, V >, Fw::RedBlackTreeMap< K, V, C >, and Fw::ArrayMap< K, V, C >.

◆ copyDataFrom()

template<typename K, typename V>
void Fw::MapBase< K, V >::copyDataFrom ( const MapBase< K, V > &  map)
inline

Copy data from another map.

Definition at line 62 of file MapBase.hpp.

◆ end()

template<typename K, typename V>
virtual ConstIterator Fw::MapBase< K, V >::end ( ) const
pure virtual

Get the end value of the iterator

Returns
The iterator

Implemented in Fw::ExternalRedBlackTreeMap< K, V >, Fw::ExternalArrayMap< K, V >, Fw::RedBlackTreeMap< K, V, C >, and Fw::ArrayMap< K, V, C >.

◆ find()

template<typename K, typename V>
virtual Success Fw::MapBase< K, V >::find ( const K &  key,
V &  value 
) const
pure virtual

Find the value associated with a key in the map SUCCESS if the item was found

Parameters
keyThe key (input)
valueThe value (output)

Implemented in Fw::ExternalRedBlackTreeMap< K, V >, Fw::ExternalArrayMap< K, V >, Fw::RedBlackTreeMap< K, V, C >, and Fw::ArrayMap< K, V, C >.

◆ insert()

template<typename K, typename V>
virtual Success Fw::MapBase< K, V >::insert ( const K &  key,
const V &  value 
)
pure virtual

Insert a (key, value) pair in the map

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

Implemented in Fw::ExternalRedBlackTreeMap< K, V >, Fw::ExternalArrayMap< K, V >, Fw::RedBlackTreeMap< K, V, C >, and Fw::ArrayMap< K, V, C >.

◆ remove()

template<typename K, typename V>
virtual Success Fw::MapBase< K, V >::remove ( const K &  key,
V &  value 
)
pure virtual

Remove a (key, value) pair from the map Store the value into the value parameter if the key was there

Returns
SUCCESS if the key was there
Parameters
keyThe key (input)
valueThe value (output)

Implemented in Fw::ExternalRedBlackTreeMap< K, V >, Fw::ExternalArrayMap< K, V >, Fw::RedBlackTreeMap< K, V, C >, and Fw::ArrayMap< K, V, C >.


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