RepastHPC  2.3.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
repast::ValueLayer< ValueType, PointType > Class Template Referenceabstract

A collection that stores values at point locations. More...

#include <ValueLayer.h>

Inheritance diagram for repast::ValueLayer< ValueType, PointType >:
repast::BaseValueLayer

Public Member Functions

 ValueLayer (const std::string &name, const GridDimensions &dimensions)
 
virtual ValueType & get (const Point< PointType > &pt)=0
 Gets the value at the specified point. More...
 
virtual void set (const ValueType &value, const Point< PointType > &pt)=0
 Sets the value at the specified point. More...
 
ValueType & operator[] (const Point< PointType > &pt)
 Gets the value at the specified point. More...
 
const ValueType & operator[] (const Point< PointType > &pt) const
 Gets the value at the specified point. More...
 
const GridDimensions dimensions () const
 Gets the dimensions of this ValueLayer. More...
 
const Point< double > shape () const
 Gets the extents of this ValueLayer. More...
 
- Public Member Functions inherited from repast::BaseValueLayer
 BaseValueLayer (const std::string &name)
 Creates a BaseValueLayer with the specified name.
 
std::string name () const
 Gets the value layer's name. More...
 

Protected Member Functions

void translate (std::vector< PointType > &pt)
 Translates pt by dimensions origin.
 

Protected Attributes

GridDimensions _dimensions
 
- Protected Attributes inherited from repast::BaseValueLayer
std::string _name
 

Detailed Description

template<typename ValueType, typename PointType>
class repast::ValueLayer< ValueType, PointType >

A collection that stores values at point locations.

Template Parameters
ValueTypethe type stored by the value layer.
thecoordinate type (int or double) of the point locations.

Member Function Documentation

◆ dimensions()

template<typename ValueType , typename PointType >
const GridDimensions repast::ValueLayer< ValueType, PointType >::dimensions ( ) const
inline

Gets the dimensions of this ValueLayer.

Returns
the dimensions of this ValueLayer.

◆ get()

template<typename ValueType , typename PointType >
virtual ValueType& repast::ValueLayer< ValueType, PointType >::get ( const Point< PointType > &  pt)
pure virtual

Gets the value at the specified point.

If no value has been set at the specified point then this returns some default value. Subclasses will determine the default value.

param pt the location to get the value of

Returns
the value at the specified point, or if no value has been set, then some default value.

Implemented in repast::DiscreteValueLayer< ValueType, Borders >, and repast::ContinuousValueLayer< ValueType, Borders >.

◆ operator[]() [1/2]

template<typename ValueType , typename PointType >
ValueType & repast::ValueLayer< ValueType, PointType >::operator[] ( const Point< PointType > &  pt)

Gets the value at the specified point.

If no value has been set at the specified point then this returns some default value. Subclasses will determine the default value.

param pt the location to get the value of

Returns
the value at the specified point, or if no value has been set, then some default value.

◆ operator[]() [2/2]

template<typename ValueType , typename PointType >
const ValueType & repast::ValueLayer< ValueType, PointType >::operator[] ( const Point< PointType > &  pt) const

Gets the value at the specified point.

If no value has been set at the specified point then this returns some default value. Subclasses will determine the default value.

param pt the location to get the value of

Returns
the value at the specified point, or if no value has been set, then some default value.

◆ set()

template<typename ValueType , typename PointType >
virtual void repast::ValueLayer< ValueType, PointType >::set ( const ValueType &  value,
const Point< PointType > &  pt 
)
pure virtual

Sets the value at the specified point.

Parameters
valuethe value
ptthe point where the value should be stored

Implemented in repast::DiscreteValueLayer< ValueType, Borders >, and repast::ContinuousValueLayer< ValueType, Borders >.

◆ shape()

template<typename ValueType , typename PointType >
const Point<double> repast::ValueLayer< ValueType, PointType >::shape ( ) const
inline

Gets the extents of this ValueLayer.

Returns
the extents of this ValueLayer.

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