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

Full specialization for woss::CustomTransducer. More...

#include <woss-creator-container.h>

Collaboration diagram for woss::WossCreatorContainer< CustomTransducer >:
Collaboration graph

Public Member Functions

 WossCreatorContainer ()=default
 
 ~WossCreatorContainer ()=default
 
bool isEmpty () const
 
int size () const
 
bool insert (const CustomTransducer &data, const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx)
 
bool insert (const CustomTransducer &data, const CoordZ &tx, const CoordZ &rx)
 
CustomTransducer get (const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx) const
 
CustomTransducer get (const CoordZ &tx, const CoordZ &rx) const
 
CustomTransduceraccessAllLocations ()
 
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 CustomTransducer &data, const std::shared_ptr< Location > &tx, const std::shared_ptr< Location > &rx)
 
void replace (const CustomTransducer &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
 
static const CoordZ ALL_COORDZ
 

Protected Types

using InnerContainer = std::map< std::shared_ptr< Location >, CustomTransducer >
 
using ICIter = InnerContainer::iterator
 
using ICRIter = InnerContainer::reverse_iterator
 
using ICCIter = InnerContainer::const_iterator
 
using ICCRIter = InnerContainer::const_reverse_iterator
 
using DataContainer = std::map< std::shared_ptr< Location >, InnerContainer >
 
using DCIter = DataContainer::iterator
 
using DCCIter = DataContainer::const_iterator
 
using DCRIter = DataContainer::reverse_iterator
 
using DCRCIter = 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

Full specialization for woss::CustomTransducer.

Full specialization for woss::CustomTransducer

Member Typedef Documentation

◆ DataContainer

using woss::WossCreatorContainer< CustomTransducer >::DataContainer = std::map< std::shared_ptr<Location>, InnerContainer >
protected

◆ DCCIter

using woss::WossCreatorContainer< CustomTransducer >::DCCIter = DataContainer::const_iterator
protected

◆ DCIter

using woss::WossCreatorContainer< CustomTransducer >::DCIter = DataContainer::iterator
protected

◆ DCRCIter

using woss::WossCreatorContainer< CustomTransducer >::DCRCIter = DataContainer::const_reverse_iterator
protected

◆ DCRIter

using woss::WossCreatorContainer< CustomTransducer >::DCRIter = DataContainer::reverse_iterator
protected

◆ ICCIter

using woss::WossCreatorContainer< CustomTransducer >::ICCIter = InnerContainer::const_iterator
protected

◆ ICCRIter

using woss::WossCreatorContainer< CustomTransducer >::ICCRIter = InnerContainer::const_reverse_iterator
protected

◆ ICIter

using woss::WossCreatorContainer< CustomTransducer >::ICIter = InnerContainer::iterator
protected

◆ ICRIter

using woss::WossCreatorContainer< CustomTransducer >::ICRIter = InnerContainer::reverse_iterator
protected

◆ InnerContainer

using woss::WossCreatorContainer< CustomTransducer >::InnerContainer = std::map< std::shared_ptr<Location>, CustomTransducer >
protected

Constructor & Destructor Documentation

◆ WossCreatorContainer()

woss::WossCreatorContainer< CustomTransducer >::WossCreatorContainer ( )
default

◆ ~WossCreatorContainer()

Member Function Documentation

◆ accessAllLocations()

CustomTransducer & woss::WossCreatorContainer< CustomTransducer >::accessAllLocations ( )
inline

Returns a reference to the CustomTransducer associated to transmitter and receiver Location equal to ALL_LOCATIONS. If no keys were present, the CustomTransducer is defaulted constructed and a reference to it is returned. The user has to properly delete the pointer prior changing it

Returns
a reference to a Data pointer

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

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

◆ clear()

◆ createLocation()

std::shared_ptr< Location > woss::WossCreatorContainer< CustomTransducer >::createLocation ( const CoordZ coordinates)
inlineprotected

◆ erase() [1/2]

void woss::WossCreatorContainer< CustomTransducer >::erase ( const CoordZ tx,
const CoordZ rx 
)
inline

Erases an CustomTransducer from the container. If the keys are already present, the previous object is deleted

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

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

◆ erase() [2/2]

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

Erases an CustomTransducer from the container. If the keys are already present, the previous object is deleted

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
true if it's empty, false otherwise

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

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

◆ find() [1/2]

DCIter woss::WossCreatorContainer< CustomTransducer >::find ( const CoordZ coordinates)
protected

◆ find() [2/2]

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

◆ get() [1/2]

CustomTransducer woss::WossCreatorContainer< CustomTransducer >::get ( const CoordZ tx,
const CoordZ rx 
) const

Returns a CustomTransducer pointer for given keys. If the keys are not found a nullptr pointer is returned

Parameters
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ
Returns
a pointer to a rotated CustomTransducer object

◆ get() [2/2]

CustomTransducer woss::WossCreatorContainer< CustomTransducer >::get ( const std::shared_ptr< Location > &  tx,
const std::shared_ptr< Location > &  rx 
) const

Returns a CustomTransducer for given keys. If the keys are not found a nullptr pointer 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 pointer to a rotated CustomTransducer object

Referenced by woss::BellhopCreator::getCustomTransducer(), woss::BellhopCreator::getCustomTransducer(), and woss::BellhopCreator::initializeBhWoss().

◆ insert() [1/2]

bool woss::WossCreatorContainer< CustomTransducer >::insert ( const CustomTransducer 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 and it is deleted

Parameters
dataconst pointer to a CustomTransducer 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

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

Here is the call graph for this function:

◆ insert() [2/2]

bool woss::WossCreatorContainer< CustomTransducer >::insert ( const CustomTransducer 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 and it is deleted

Parameters
dataconst reference to a CustomTransducer 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

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

◆ isEmpty()

◆ isUsingDebug()

◆ replace() [1/2]

void woss::WossCreatorContainer< CustomTransducer >::replace ( const CustomTransducer data,
const CoordZ tx,
const CoordZ rx 
)
inline

Replaces a pointer into the container. If the keys are already present, the previous object is deleted

Parameters
dataconst pointer to a CustomTransducer 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

References woss::WossCreatorContainer< Data >::createLocation(), and woss::WossCreatorContainer< Data >::data_container.

Here is the call graph for this function:

◆ replace() [2/2]

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

Replaces a pointer into the container. If the keys are already present, the previous object is deleted

Parameters
dataconst reference to a CustomTransducer 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

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

Referenced by woss::BellhopCreator::setCustomTransducer(), and woss::BellhopCreator::setCustomTransducer().

◆ setDebug()

◆ size()

Member Data Documentation

◆ ALL_COORDZ

const CoordZ woss::WossCreatorContainer< CustomTransducer >::ALL_COORDZ
static

◆ ALL_LOCATIONS

std::shared_ptr<Location> woss::WossCreatorContainer< CustomTransducer >::ALL_LOCATIONS
static

◆ data_container

◆ debug

bool woss::WossCreatorContainer< CustomTransducer >::debug = false
protected

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