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

Partial specialization for pointers. More...

#include <woss-creator-container.h>

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

Public Member Functions

bool isEmpty () const
 
int size () const
 
bool insert (Data *data, Location *const tx, Location *const rx)
 
bool insert (Data *data, const CoordZ &tx, const CoordZ &rx)
 
Data * get (Location *const tx, Location *const rx) const
 
Data * get (const CoordZ &tx, const CoordZ &rx) const
 
Data *& accessAllLocations ()
 
void erase (Location *const tx, Location *const rx)
 
void erase (const CoordZ &tx, const CoordZ &rx)
 
void replace (Data *const data, Location *const tx, Location *const rx)
 
void replace (Data *const data, const CoordZ &tx, const CoordZ &rx)
 
void clear ()
 
void setDebug (bool flag)
 
bool isUsingDebug () const
 

Static Public Attributes

static Location *const ALL_LOCATIONS = NULL
 
static const CoordZ ALL_COORDZ = CoordZ()
 

Protected Types

typedef ::std::map< Location *, Data * > InnerContainer
 
typedef InnerContainer::iterator ICIter
 
typedef InnerContainer::reverse_iterator ICRIter
 
typedef InnerContainer::const_iterator ICCIter
 
typedef InnerContainer::const_reverse_iterator ICCRIter
 
typedef ::std::map< Location *, InnerContainer > DataContainer
 
typedef DataContainer::iterator DCIter
 
typedef DataContainer::const_iterator DCCIter
 
typedef DataContainer::reverse_iterator DCRIter
 
typedef DataContainer::const_reverse_iterator DCRCIter
 

Protected Member Functions

DCIter find (const CoordZ &coordinates)
 
ICIter find (const CoordZ &coordinates, const DCIter &iter)
 
LocationcreateLocation (const CoordZ &coordinates)
 

Protected Attributes

DataContainer data_container
 
bool debug
 

Detailed Description

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

Partial specialization for pointers.

Partial specialiation for heap-allocated pointers. PLEASE NOTE that object class type must implement clone() method

Member Function Documentation

◆ accessAllLocations()

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

Returns a reference to the Data pointer associated to transmitter and receiver Location equal to ALL_LOCATIONS. If no keys were present, the Data pointer is defaulted to NULL 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

◆ get() [1/2]

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

Returns a Data pointer for given keys. If the keys are not found a NULL pointer is returned

Parameters
txconst reference to a valid transmitter CoordZ
rxconst reference to a valid receiver CoordZ
Returns
a pointer to a cloned Data object

References woss::WossCreatorContainer< Data >::find().

Here is the call graph for this function:

◆ get() [2/2]

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

Returns a Data pointer for given keys. If the keys are not found a NULL pointer is returned

Parameters
txconst pointer to a valid transmitter Location
rxconst pointer to a valid receiver Location
Returns
a pointer to a cloned Data object

References woss::Location::clone().

Here is the call graph for this function:

◆ insert() [1/2]

template<typename Data >
bool woss::WossCreatorContainer< Data * >::insert ( 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 and it is deleted

Parameters
dataconst pointer 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 ( Data *  data,
Location *const  tx,
Location *const  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 Data object to be inserted
txconst pointer to a valid transmitter Location
rxconst pointer to a valid receiver Location
Returns
true if it's empty, false otherwise

◆ replace() [1/2]

template<typename Data >
void woss::WossCreatorContainer< Data * >::replace ( Data *const  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 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 ( Data *const  data,
Location *const  tx,
Location *const  rx 
)
inline

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

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

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