RepastHPC  2.3.1
Public Member Functions | List of all members
repast::MultipleOccupancy< T, GPType > Class Template Reference

Multiple Occupancy cell accessor for accessing the occupants of locations in a Grid. More...

#include <MultipleOccupancy.h>

Public Member Functions

T * get (const Point< GPType > &location) const
 Gets the first object found at the specified location. More...
 
void getAll (const Point< GPType > &location, std::vector< T * > &out) const
 Gets all the items found at the specified location. More...
 
bool put (boost::shared_ptr< T > &agent, const Point< GPType > &location)
 Puts the specified item at the specified location. More...
 
void remove (boost::shared_ptr< T > &agent, const Point< GPType > &location)
 Removes the specified item from the specified location. More...
 

Detailed Description

template<typename T, typename GPType>
class repast::MultipleOccupancy< T, GPType >

Multiple Occupancy cell accessor for accessing the occupants of locations in a Grid.

Each locations can have multiple occupants.

Parameters
Tthe type of object in the Grid
GPTypethe coordinate type of the grid point locations. This must be an int or a double.

Member Function Documentation

◆ get()

template<typename T , typename GPType >
T * repast::MultipleOccupancy< T, GPType >::get ( const Point< GPType > &  location) const

Gets the first object found at the specified location.

Parameters
locationthe location to get the object at
Returns
the first object found at the specified location or 0 if there are no objects at the specified location.

◆ getAll()

template<typename T , typename GPType >
void repast::MultipleOccupancy< T, GPType >::getAll ( const Point< GPType > &  location,
std::vector< T * > &  out 
) const

Gets all the items found at the specified location.

Parameters
locationthe location to get the items at
[out]thefound items will be returned in this vector

◆ put()

template<typename T , typename GPType >
bool repast::MultipleOccupancy< T, GPType >::put ( boost::shared_ptr< T > &  agent,
const Point< GPType > &  location 
)

Puts the specified item at the specified location.

Parameters
agentthe item to put
locationthe location to put the item at

◆ remove()

template<typename T , typename GPType >
void repast::MultipleOccupancy< T, GPType >::remove ( boost::shared_ptr< T > &  agent,
const Point< GPType > &  location 
)

Removes the specified item from the specified location.

Parameters
agentthe item to remove
locationthe location to remove the item from

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