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

#include <Fw/DataStructures/ExternalRedBlackTreeMap.hpp>

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

Public Types

using ConstIterator = MapConstIterator< K, V >
 The type of a const iterator. More...
 
using Node = typename RedBlackTreeSetOrMapImpl< K, V >::Node
 The type of a tree node. More...
 
using Index = typename RedBlackTreeSetOrMapImpl< K, V >::Index
 The type of a tree node index. 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

 ExternalRedBlackTreeMap ()=default
 Zero-argument constructor. More...
 
 ExternalRedBlackTreeMap (Node *nodes, Index *freeNodes, FwSizeType capacity)
 
 ExternalRedBlackTreeMap (ByteArray data, FwSizeType capacity)
 
 ExternalRedBlackTreeMap (const ExternalRedBlackTreeMap< K, V > &map)
 Copy constructor. More...
 
 ~ExternalRedBlackTreeMap () override=default
 Destructor. More...
 
ExternalRedBlackTreeMap< K, V > & operator= (const ExternalRedBlackTreeMap< 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 (Node *nodes, Index *freeNodes, 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 ExternalRedBlackTreeMapTester
 

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

Definition at line 17 of file ExternalRedBlackTreeMap.hpp.

Member Typedef Documentation

◆ ConstIterator

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

The type of a const iterator.

Definition at line 31 of file ExternalRedBlackTreeMap.hpp.

◆ Index

template<typename K, typename V>
using Fw::ExternalRedBlackTreeMap< K, V >::Index = typename RedBlackTreeSetOrMapImpl<K, V>::Index

The type of a tree node index.

Definition at line 37 of file ExternalRedBlackTreeMap.hpp.

◆ Node

template<typename K, typename V>
using Fw::ExternalRedBlackTreeMap< K, V >::Node = typename RedBlackTreeSetOrMapImpl<K, V>::Node

The type of a tree node.

Definition at line 34 of file ExternalRedBlackTreeMap.hpp.

Constructor & Destructor Documentation

◆ ExternalRedBlackTreeMap() [1/4]

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

Zero-argument constructor.

◆ ExternalRedBlackTreeMap() [2/4]

template<typename K, typename V>
Fw::ExternalRedBlackTreeMap< K, V >::ExternalRedBlackTreeMap ( Node nodes,
Index freeNodes,
FwSizeType  capacity 
)
inline

Constructor providing typed backing storage. nodes must point to at least capacity elements of type Node. freeNodes must point to at least capacity elements of type FwSizeType.

Parameters
nodesThe nodes
freeNodesThe free nodes
capacityThe capacity

Definition at line 50 of file ExternalRedBlackTreeMap.hpp.

◆ ExternalRedBlackTreeMap() [3/4]

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

◆ ExternalRedBlackTreeMap() [4/4]

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

Copy constructor.

Definition at line 69 of file ExternalRedBlackTreeMap.hpp.

◆ ~ExternalRedBlackTreeMap()

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

Destructor.

Member Function Documentation

◆ begin()

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

Get the begin iterator

Returns
The iterator

Implements Fw::MapBase< K, V >.

Definition at line 89 of file ExternalRedBlackTreeMap.hpp.

◆ clear()

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

Clear the map.

Implements Fw::SizedContainer.

Definition at line 92 of file ExternalRedBlackTreeMap.hpp.

◆ end()

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

Get the end iterator

Returns
The iterator

Implements Fw::MapBase< K, V >.

Definition at line 96 of file ExternalRedBlackTreeMap.hpp.

◆ find()

template<typename K, typename V>
Success Fw::ExternalRedBlackTreeMap< 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 100 of file ExternalRedBlackTreeMap.hpp.

◆ getByteArrayAlignment()

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

Get the alignment of the storage for an RedBlackTreeSetOrMapImpl

Returns
The alignment

Definition at line 156 of file ExternalRedBlackTreeMap.hpp.

◆ getByteArraySize()

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

◆ getCapacity()

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

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

Returns
The capacity

Implements Fw::SizedContainer.

Definition at line 108 of file ExternalRedBlackTreeMap.hpp.

◆ getSize()

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

Get the size (number of entries)

Returns
The size

Implements Fw::SizedContainer.

Definition at line 112 of file ExternalRedBlackTreeMap.hpp.

◆ insert()

template<typename K, typename V>
Success Fw::ExternalRedBlackTreeMap< 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 116 of file ExternalRedBlackTreeMap.hpp.

◆ operator=()

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

operator=

Definition at line 80 of file ExternalRedBlackTreeMap.hpp.

◆ remove()

template<typename K, typename V>
Success Fw::ExternalRedBlackTreeMap< 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 124 of file ExternalRedBlackTreeMap.hpp.

◆ setStorage() [1/2]

template<typename K, typename V>
void Fw::ExternalRedBlackTreeMap< K, V >::setStorage ( Node nodes,
Index freeNodes,
FwSizeType  capacity 
)
inline

Set the backing storage (typed data) nodes must point to at least capacity elements of type Node. freeNodes must point to at least capacity elements of type FwSizeType.

Parameters
nodesThe nodes
freeNodesThe free nodes
capacityThe capacity

Definition at line 133 of file ExternalRedBlackTreeMap.hpp.

◆ setStorage() [2/2]

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

Friends And Related Function Documentation

◆ ExternalRedBlackTreeMapTester

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

Definition at line 23 of file ExternalRedBlackTreeMap.hpp.


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