World Ocean Simulation System (WOSS) library
woss::WossCreatorContainer< Data > Class Template Reference

Class that stores WossCreator parameters. More...

#include <woss-creator-container.h>

Inheritance diagram for woss::WossCreatorContainer< Data >:
Inheritance graph
Collaboration diagram for woss::WossCreatorContainer< Data >:
Collaboration graph

Public Member Functions

 WossCreatorContainer ()=default
 
 ~WossCreatorContainer ()=default
 
bool isEmpty () const
 
int size () const
 
bool insert (const Data &data, const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx)
 
bool insert (const Data &data, const CoordZ &tx, const CoordZ &rx)
 
Data get (const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx) const
 
Data get (const CoordZ &tx, const CoordZ &rx) const
 
Data & accessAllLocations ()
 
void erase (const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx)
 
void erase (const CoordZ &tx, const CoordZ &rx)
 
void replace (const Data &data, const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx)
 
void replace (const Data &data, const CoordZ &tx, const CoordZ &rx)
 
void clear ()
 
void setDebug (bool flag)
 
bool isUsingDebug () const
 

Static Public Attributes

static std::shared_ptr< LocationALL_LOCATIONS = nullptr
 
static const CoordZ ALL_COORDZ = CoordZ()
 

Protected Types

using InnerContainer = std::map< std::shared_ptr< Location >, Data >
 
using ICIter = typename InnerContainer::iterator
 
using ICRIter = typename InnerContainer::reverse_iterator
 
using ICCIter = typename InnerContainer::const_iterator
 
using ICCRIter = typename InnerContainer::const_reverse_iterator
 
using DataContainer = std::map< std::shared_ptr< Location >, InnerContainer >
 
using DCIter = typename DataContainer::iterator
 
using DCCIter = typename DataContainer::const_iterator
 
using DCRIter = typename DataContainer::reverse_iterator
 
using DCRCIter = typename DataContainer::const_reverse_iterator
 

Protected Member Functions

DCIter find (const CoordZ &coordinates)
 
ICIter find (const CoordZ &coordinates, const DCIter &iter)
 
std::shared_ptr< LocationcreateLocation (const CoordZ &coordinates)
 

Protected Attributes

DataContainer data_container
 
bool debug = false
 

Detailed Description

template<typename Data>
class woss::WossCreatorContainer< Data >

Class that stores WossCreator parameters.

WossCreatorContainer provides interface for storing and retrieving custom WossCreator data, indexed by transmitter and receiver std::shared_ptr<woss::Location>

Member Typedef Documentation

◆ DataContainer

template<typename Data >
using woss::WossCreatorContainer< Data >::DataContainer = std::map< std::shared_ptr<Location>, InnerContainer >
protected

The outer container. It associates a transmitter Location pointer to a InnerContainer object

◆ DCCIter

template<typename Data >
using woss::WossCreatorContainer< Data >::DCCIter = typename DataContainer::const_iterator
protected

◆ DCIter

template<typename Data >
using woss::WossCreatorContainer< Data >::DCIter = typename DataContainer::iterator
protected

◆ DCRCIter

template<typename Data >
using woss::WossCreatorContainer< Data >::DCRCIter = typename DataContainer::const_reverse_iterator
protected

◆ DCRIter

template<typename Data >
using woss::WossCreatorContainer< Data >::DCRIter = typename DataContainer::reverse_iterator
protected

◆ ICCIter

template<typename Data >
using woss::WossCreatorContainer< Data >::ICCIter = typename InnerContainer::const_iterator
protected

◆ ICCRIter

template<typename Data >
using woss::WossCreatorContainer< Data >::ICCRIter = typename InnerContainer::const_reverse_iterator
protected

◆ ICIter

template<typename Data >
using woss::WossCreatorContainer< Data >::ICIter = typename InnerContainer::iterator
protected

◆ ICRIter

template<typename Data >
using woss::WossCreatorContainer< Data >::ICRIter = typename InnerContainer::reverse_iterator
protected

◆ InnerContainer

template<typename Data >
using woss::WossCreatorContainer< Data >::InnerContainer = std::map< std::shared_ptr<Location>, Data >
protected

The innermost container. It associates a receiver Location pointer to the Data object

Constructor & Destructor Documentation

◆ WossCreatorContainer()

template<typename Data >
woss::WossCreatorContainer< Data >::WossCreatorContainer ( )
default

◆ ~WossCreatorContainer()

template<typename Data >
woss::WossCreatorContainer< Data >::~WossCreatorContainer ( )
default

Member Function Documentation

◆ accessAllLocations()

template<typename Data >
Data & woss::WossCreatorContainer< Data >::accessAllLocations ( )
inline

Returns a reference to the Data object associated to transmitter and receiver Location equal to ALL_LOCATIONS. If no keys were present, the Data object is default constructed and a reference to it is returned

Returns
a reference to a Data object

Referenced by woss::WossCreator::WossCreator().

◆ clear()

template<typename Data >
void woss::WossCreatorContainer< Data >::clear ( )
inline

Clears the container

◆ createLocation()

template<typename Data >
std::shared_ptr< Location > woss::WossCreatorContainer< Data >::createLocation ( const CoordZ coordinates)
inlineprotected

Creates a Location for a given CoordZ

Parameters
coordinatesa const reference to a valid receiver CoordZ
Returns
a std::shared_ptr to a heap-allocated Location pointer

References woss::Singleton< T >::instance().

Referenced by woss::WossCreatorContainer< CustomTransducer >::createLocation(), woss::WossCreatorContainer< CustomTransducer >::insert(), and woss::WossCreatorContainer< CustomTransducer >::replace().

Here is the call graph for this function:

◆ erase() [1/2]

template<typename Data >
void woss::WossCreatorContainer< Data >::erase ( const CoordZ tx,
const CoordZ rx 
)
inline

Erases an object into the container

Parameters
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ

◆ erase() [2/2]

template<typename Data >
void woss::WossCreatorContainer< Data >::erase ( const std::shared_ptr< Location > &  tx,
const std::shared_ptr< Location > &  rx 
)
inline

Erases an object into the container

Parameters
txconst reference to a std::shared_ptr to a valid transmitter Location
rxconst reference to a std::shared_ptr to a valid receiver Location

Referenced by woss::BellhopCreator::eraseAltimetryType(), woss::BellhopCreator::eraseAltimetryType(), woss::BellhopCreator::eraseAngles(), woss::BellhopCreator::eraseAngles(), woss::BellhopCreator::eraseBathymetryMethod(), woss::BellhopCreator::eraseBathymetryMethod(), woss::BellhopCreator::eraseBathymetryType(), woss::BellhopCreator::eraseBathymetryType(), woss::BellhopCreator::eraseBeamOptions(), woss::BellhopCreator::eraseBeamOptions(), woss::BellhopCreator::eraseBhMode(), woss::BellhopCreator::eraseBhMode(), woss::BellhopCreator::eraseBoxDepth(), woss::BellhopCreator::eraseBoxDepth(), woss::BellhopCreator::eraseBoxRange(), woss::BellhopCreator::eraseBoxRange(), woss::BellhopCreator::eraseCustomTransducer(), woss::WossCreator::eraseEvolutionTimeQuantum(), woss::WossCreator::eraseEvolutionTimeQuantum(), woss::WossCreator::eraseFrequencyStep(), woss::WossCreator::eraseFrequencyStep(), woss::BellhopCreator::eraseRaysNumber(), woss::BellhopCreator::eraseRaysNumber(), woss::BellhopCreator::eraseRxMaxDepthOffset(), woss::BellhopCreator::eraseRxMaxDepthOffset(), woss::BellhopCreator::eraseRxMaxRangeOffset(), woss::BellhopCreator::eraseRxMaxRangeOffset(), woss::BellhopCreator::eraseRxMinDepthOffset(), woss::BellhopCreator::eraseRxMinDepthOffset(), woss::BellhopCreator::eraseRxMinRangeOffset(), woss::BellhopCreator::eraseRxMinRangeOffset(), woss::BellhopCreator::eraseRxTotalDepths(), woss::BellhopCreator::eraseRxTotalDepths(), woss::BellhopCreator::eraseRxTotalRanges(), woss::BellhopCreator::eraseRxTotalRanges(), woss::WossCreator::eraseSimTime(), woss::WossCreator::eraseSimTime(), woss::BellhopCreator::eraseSspDepthPrecision(), woss::BellhopCreator::eraseSspDepthPrecision(), woss::BellhopCreator::eraseSspDepthSteps(), woss::BellhopCreator::eraseSspDepthSteps(), woss::BellhopCreator::eraseTotalRangeSteps(), woss::BellhopCreator::eraseTotalRangeSteps(), woss::WossCreator::eraseTotalRuns(), woss::WossCreator::eraseTotalRuns(), woss::BellhopCreator::eraseTotalTransmitters(), woss::BellhopCreator::eraseTotalTransmitters(), woss::BellhopCreator::eraseTxMaxDepthOffset(), woss::BellhopCreator::eraseTxMaxDepthOffset(), woss::BellhopCreator::eraseTxMinDepthOffset(), and woss::BellhopCreator::eraseTxMinDepthOffset().

◆ find() [1/2]

template<typename Data >
WossCreatorContainer< Data >::DCIter woss::WossCreatorContainer< Data >::find ( const CoordZ coordinates)
protected

Returns an DataContainer iterators that points to the given transmitter coordinates. An iterator to the end of the DataContainer is returned if no coordinates are found

Parameters
coordinatesa const reference to a valid transmitter CoordZ
Returns
a DataContainer::iterator

References woss::WossCreatorContainer< Data >::ALL_COORDZ, woss::WossCreatorContainer< Data >::ALL_LOCATIONS, woss::WossCreatorContainer< Data >::data_container, and woss::WossCreatorContainer< Data >::debug.

Referenced by woss::WossCreatorContainer< Data >::get(), and woss::WossCreatorContainer< CustomTransducer >::insert().

◆ find() [2/2]

template<typename Data >
WossCreatorContainer< Data >::ICIter woss::WossCreatorContainer< Data >::find ( const CoordZ coordinates,
const DCIter iter 
)
protected

Returns an InnerContainer iterators for the DataContainter iterator that points to the given receiver coordinates. An iterator to the relative end of the InnerContainer is returned if no coordinates are found

Parameters
coordinatesa const reference to a valid receiver CoordZ
Returns
a DataContainer::iterator

References woss::WossCreatorContainer< Data >::ALL_COORDZ, woss::WossCreatorContainer< Data >::ALL_LOCATIONS, and woss::WossCreatorContainer< Data >::debug.

◆ get() [1/2]

template<typename Data >
Data woss::WossCreatorContainer< Data >::get ( const CoordZ tx,
const CoordZ rx 
) const
inline

Returns an object into the container. If the keys are NOT found, a default constructed object is returned

Parameters
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ
Returns
a copy of the original object

References woss::WossCreatorContainer< Data >::ALL_COORDZ, woss::WossCreatorContainer< Data >::data_container, woss::WossCreatorContainer< Data >::debug, and woss::WossCreatorContainer< CustomTransducer >::find().

Here is the call graph for this function:

◆ get() [2/2]

template<typename Data >
Data woss::WossCreatorContainer< Data >::get ( const std::shared_ptr< Location > &  tx,
const std::shared_ptr< Location > &  rx 
) const
inline

Returns an object into the container. If the keys are NOT found, a default constructed object is returned

Parameters
txconst reference to a std::shared_ptr to a valid transmitter Location
rxconst reference to a std::shared_ptr to a valid receiver Location
Returns
a copy of the original object

References woss::WossCreatorContainer< Data >::ALL_LOCATIONS, woss::WossCreatorContainer< Data >::data_container, woss::WossCreatorContainer< Data >::debug, and woss::WossCreatorContainer< Data >::find().

Referenced by woss::BellhopCreator::getAltimetryType(), woss::BellhopCreator::getAltimetryType(), woss::BellhopCreator::getAngles(), woss::BellhopCreator::getAngles(), woss::BellhopCreator::getBathymetryMethod(), woss::BellhopCreator::getBathymetryMethod(), woss::BellhopCreator::getBathymetryType(), woss::BellhopCreator::getBathymetryType(), woss::BellhopCreator::getBeamOptions(), woss::BellhopCreator::getBeamOptions(), woss::BellhopCreator::getBhMode(), woss::BellhopCreator::getBhMode(), woss::BellhopCreator::getBoxDepth(), woss::BellhopCreator::getBoxDepth(), woss::BellhopCreator::getBoxRange(), woss::BellhopCreator::getBoxRange(), woss::WossCreator::getEvolutionTimeQuantum(), woss::WossCreator::getEvolutionTimeQuantum(), woss::WossCreator::getFrequencyStep(), woss::WossCreator::getFrequencyStep(), woss::BellhopCreator::getRaysNumber(), woss::BellhopCreator::getRaysNumber(), woss::BellhopCreator::getRxMaxDepthOffset(), woss::BellhopCreator::getRxMaxDepthOffset(), woss::BellhopCreator::getRxMaxRangeOffset(), woss::BellhopCreator::getRxMaxRangeOffset(), woss::BellhopCreator::getRxMinDepthOffset(), woss::BellhopCreator::getRxMinDepthOffset(), woss::BellhopCreator::getRxMinRangeOffset(), woss::BellhopCreator::getRxMinRangeOffset(), woss::BellhopCreator::getRxTotalDepths(), woss::BellhopCreator::getRxTotalDepths(), woss::BellhopCreator::getRxTotalRanges(), woss::BellhopCreator::getRxTotalRanges(), woss::WossCreator::getSimTime(), woss::WossCreator::getSimTime(), woss::BellhopCreator::getSspDepthPrecision(), woss::BellhopCreator::getSspDepthPrecision(), woss::BellhopCreator::getSspDepthSteps(), woss::BellhopCreator::getSspDepthSteps(), woss::BellhopCreator::getTotalRangeSteps(), woss::BellhopCreator::getTotalRangeSteps(), woss::WossCreator::getTotalRuns(), woss::WossCreator::getTotalRuns(), woss::BellhopCreator::getTotalTransmitters(), woss::BellhopCreator::getTotalTransmitters(), woss::BellhopCreator::getTxMaxDepthOffset(), woss::BellhopCreator::getTxMaxDepthOffset(), woss::BellhopCreator::getTxMinDepthOffset(), woss::BellhopCreator::getTxMinDepthOffset(), woss::BellhopCreator::initializeBhWoss(), and woss::WossCreator::initializeWoss().

Here is the call graph for this function:

◆ insert() [1/2]

template<typename Data >
bool woss::WossCreatorContainer< Data >::insert ( const Data &  data,
const CoordZ tx,
const CoordZ rx 
)
inline

Inserts an object into the container. If the keys are already present, the object is NOT inserted

Parameters
dataconst reference to a Data object to be inserted
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ
Returns
true if it's empty, false otherwise

◆ insert() [2/2]

template<typename Data >
bool woss::WossCreatorContainer< Data >::insert ( const Data &  data,
const std::shared_ptr< Location > &  tx,
const std::shared_ptr< Location > &  rx 
)
inline

Inserts an object into the container. If the keys are already present, the object is NOT inserted

Parameters
dataconst reference to a Data object to be inserted
txconst reference to a std::shared_ptr to a valid transmitter Location
rxconst reference to a std::shared_ptr to a valid receiver Location
Returns
true if it's empty, false otherwise

◆ isEmpty()

template<typename Data >
bool woss::WossCreatorContainer< Data >::isEmpty ( ) const
inline

Checks if the container is empty

Returns
true if it's empty, false otherwise

Referenced by woss::BellhopCreator::initializeBhWoss().

◆ isUsingDebug()

template<typename Data >
bool woss::WossCreatorContainer< Data >::isUsingDebug ( ) const
inline

Retuns the debug flag

Returns
true if is using the debug flag, false otherwise

References woss::WossCreatorContainer< Data >::debug.

◆ replace() [1/2]

template<typename Data >
void woss::WossCreatorContainer< Data >::replace ( const Data &  data,
const CoordZ tx,
const CoordZ rx 
)
inline

Replaces an object into the container. If the key are not present, the object is still inserted

Parameters
dataconst reference to a Data object to be inserted
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ
Returns
true if it's empty, false otherwise

◆ replace() [2/2]

template<typename Data >
void woss::WossCreatorContainer< Data >::replace ( const Data &  data,
const std::shared_ptr< Location > &  tx,
const std::shared_ptr< Location > &  rx 
)
inline

Replaces an object into the container. If the key are not present, the object is still inserted

Parameters
dataconst reference to a Data object to be inserted
txconst reference to a std::shared_ptr to a valid transmitter Location
rxconst reference to a std::shared_ptr to a valid receiver Location
Returns
true if it's empty, false otherwise

Referenced by woss::BellhopCreator::setAltimetryType(), woss::BellhopCreator::setAltimetryType(), woss::BellhopCreator::setAngles(), woss::BellhopCreator::setAngles(), woss::BellhopCreator::setBathymetryMethod(), woss::BellhopCreator::setBathymetryMethod(), woss::BellhopCreator::setBathymetryType(), woss::BellhopCreator::setBathymetryType(), woss::BellhopCreator::setBeamOptions(), woss::BellhopCreator::setBeamOptions(), woss::BellhopCreator::setBhMode(), woss::BellhopCreator::setBhMode(), woss::BellhopCreator::setBoxDepth(), woss::BellhopCreator::setBoxDepth(), woss::BellhopCreator::setBoxRange(), woss::BellhopCreator::setBoxRange(), woss::WossCreator::setEvolutionTimeQuantum(), woss::WossCreator::setEvolutionTimeQuantum(), woss::WossCreator::setFrequencyStep(), woss::WossCreator::setFrequencyStep(), woss::BellhopCreator::setRaysNumber(), woss::BellhopCreator::setRaysNumber(), woss::BellhopCreator::setRxMaxDepthOffset(), woss::BellhopCreator::setRxMaxDepthOffset(), woss::BellhopCreator::setRxMaxRangeOffset(), woss::BellhopCreator::setRxMaxRangeOffset(), woss::BellhopCreator::setRxMinDepthOffset(), woss::BellhopCreator::setRxMinDepthOffset(), woss::BellhopCreator::setRxMinRangeOffset(), woss::BellhopCreator::setRxMinRangeOffset(), woss::BellhopCreator::setRxTotalDepths(), woss::BellhopCreator::setRxTotalDepths(), woss::BellhopCreator::setRxTotalRanges(), woss::BellhopCreator::setRxTotalRanges(), woss::WossCreator::setSimTime(), woss::WossCreator::setSimTime(), woss::BellhopCreator::setSspDepthPrecision(), woss::BellhopCreator::setSspDepthPrecision(), woss::BellhopCreator::setSspDepthSteps(), woss::BellhopCreator::setSspDepthSteps(), woss::BellhopCreator::setTotalRangeSteps(), woss::BellhopCreator::setTotalRangeSteps(), woss::WossCreator::setTotalRuns(), woss::WossCreator::setTotalRuns(), woss::BellhopCreator::setTotalTransmitters(), woss::BellhopCreator::setTotalTransmitters(), woss::BellhopCreator::setTxMaxDepthOffset(), woss::BellhopCreator::setTxMaxDepthOffset(), woss::BellhopCreator::setTxMinDepthOffset(), and woss::BellhopCreator::setTxMinDepthOffset().

◆ setDebug()

template<typename Data >
void woss::WossCreatorContainer< Data >::setDebug ( bool  flag)
inline

Sets or unsets the debug flag

Parameters
flagboolean flag

References woss::WossCreatorContainer< Data >::debug.

Referenced by woss::WossCreator::updateDebugFlag(), and woss::BellhopCreator::updateDebugFlag().

◆ size()

template<typename Data >
int woss::WossCreatorContainer< Data >::size ( ) const
inline

Returns the size of the container

Returns
container's size

Member Data Documentation

◆ ALL_COORDZ

template<typename Data >
const CoordZ woss::WossCreatorContainer< Data >::ALL_COORDZ = CoordZ()
static

◆ ALL_LOCATIONS

◆ data_container

◆ debug


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