DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
MapObjectContainer< Obj, Idx > Class Template Reference

A generic Container class form Map Objects. More...

#include <mapobjectcontainer.h>

Public Types

typedef QMap< Idx, ObjC * >::const_iterator Iterator
 

Public Member Functions

 MapObjectContainer ()
 
 ~MapObjectContainer ()
 
Idx add (Idx id, Obj *object, int role)
 add an object with the specified id and role More...
 
Obj * get (Idx id, int role)
 
void clear ()
 
Iterator begin ()
 
bool atEnd (Iterator it)
 
Obj * get (Iterator it, int role)
 
Obj * remove (Idx id, int role)
 remove the object specified by the id and role. The collection identified by id is not removed. Use remove(int) to remove also the list of roles it is responsibility of the caller to de-allocate the pointer returned More...
 
QList< Obj * > remove (Idx id)
 Remove all the objects identified by the id, with all roles. The collection identified by id is removed. It is responsibility of the caller to de-allocate the objects returned with the pointer list. More...
 

Detailed Description

template<typename Obj, typename Idx = int>
class MapObjectContainer< Obj, Idx >

A generic Container class form Map Objects.

Member Typedef Documentation

◆ Iterator

template<typename Obj, typename Idx = int>
typedef QMap<Idx,ObjC *>::const_iterator MapObjectContainer< Obj, Idx >::Iterator

Constructor & Destructor Documentation

◆ MapObjectContainer()

template<typename Obj, typename Idx = int>
MapObjectContainer< Obj, Idx >::MapObjectContainer ( )
inline

◆ ~MapObjectContainer()

template<typename Obj, typename Idx = int>
MapObjectContainer< Obj, Idx >::~MapObjectContainer ( )
inline

Member Function Documentation

◆ add()

template<typename Obj, typename Idx = int>
Idx MapObjectContainer< Obj, Idx >::add ( Idx  id,
Obj *  object,
int  role 
)
inline

add an object with the specified id and role

◆ atEnd()

template<typename Obj, typename Idx = int>
bool MapObjectContainer< Obj, Idx >::atEnd ( Iterator  it)
inline

◆ begin()

template<typename Obj, typename Idx = int>
Iterator MapObjectContainer< Obj, Idx >::begin ( )
inline

◆ clear()

template<typename Obj, typename Idx = int>
void MapObjectContainer< Obj, Idx >::clear ( )
inline

◆ get() [1/2]

template<typename Obj, typename Idx = int>
Obj* MapObjectContainer< Obj, Idx >::get ( Idx  id,
int  role 
)
inline

◆ get() [2/2]

template<typename Obj, typename Idx = int>
Obj* MapObjectContainer< Obj, Idx >::get ( Iterator  it,
int  role 
)
inline

◆ remove() [1/2]

template<typename Obj, typename Idx = int>
Obj* MapObjectContainer< Obj, Idx >::remove ( Idx  id,
int  role 
)
inline

remove the object specified by the id and role. The collection identified by id is not removed. Use remove(int) to remove also the list of roles it is responsibility of the caller to de-allocate the pointer returned

Returns
The Pointer to the object removed.

◆ remove() [2/2]

template<typename Obj, typename Idx = int>
QList<Obj *> MapObjectContainer< Obj, Idx >::remove ( Idx  id)
inline

Remove all the objects identified by the id, with all roles. The collection identified by id is removed. It is responsibility of the caller to de-allocate the objects returned with the pointer list.

Returns
A List od pointers to the objects removed.

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