Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
grid::SquareGrid< TCoordinate, TEdge > Class Template Referenceabstract

#include <SquareGrid.hpp>

Inheritance diagram for grid::SquareGrid< TCoordinate, TEdge >:
[legend]
Collaboration diagram for grid::SquareGrid< TCoordinate, TEdge >:
[legend]

Public Types

using coordinate_type = TCoordinate
 
using edge_type = TEdge
 
using node_type = ext::pair< TCoordinate, TCoordinate >
 
using direction_type = SquareGridDirections
 
- Public Types inherited from grid::GridInterface< TCoordinate, TEdge >
using coordinate_type = TCoordinate
 
using edge_type = TEdge
 
using node_type = ext::pair< TCoordinate, TCoordinate >
 

Public Member Functions

 SquareGrid (TCoordinate height, TCoordinate width)
 
const ext::set< node_type > & getObstacleList () const &
 
ext::set< node_type > && getObstacleList () &&
 
void operator>> (ext::ostream &ostream) const override
 
TCoordinate getHeight () const
 
TCoordinate getWidth () const
 
virtual void resize (TCoordinate height, TCoordinate width)
 
virtual void addObstacle (const node_type &n)
 
virtual void addObstacle (node_type &&n)
 
virtual void addObstacle (TCoordinate &&x, TCoordinate &&y)
 
virtual ext::pair< bool, node_typestep (const node_type &n, direction_type direction) const
 
virtual ext::pair< bool, TEdge > stepEdge (const node_type &n, direction_type direction) const
 
virtual bool isObstacle (const node_type &n) const
 
virtual bool isNode (const node_type &n) const
 
virtual bool isValidDirection (direction_type direction) const =0
 
virtual std::string toStringAs (const ext::map< node_type, char > &map) const
 
size_t nodeCount () const override
 
size_t edgeCount () const override
 
ext::set< node_typegetNodes () const override
 
ext::vector< TEdge > getEdges () const override
 
ext::set< node_typesuccessors (const node_type &n) const override
 
ext::vector< TEdge > successorEdges (const node_type &n) const override
 
ext::set< node_typepredecessors (const node_type &n) const override
 
ext::vector< TEdge > predecessorEdges (const node_type &n) const override
 
- Public Member Functions inherited from grid::GridInterface< TCoordinate, TEdge >
virtual std::string name () const =0
 
- Public Member Functions inherited from grid::GridBase
virtual ~GridBase () noexcept=default
 

Protected Member Functions

virtual bool checkCoordinates (const node_type &coordinate) const
 
virtual void throwCoordinates (const node_type &coordinate) const
 
virtual TEdge createEdge (const node_type &a, const node_type &b) const =0
 

Protected Attributes

TCoordinate m_height
 
TCoordinate m_width
 
ext::set< node_typem_obstacles
 

Member Typedef Documentation

◆ coordinate_type

template<typename TCoordinate , typename TEdge >
using grid::SquareGrid< TCoordinate, TEdge >::coordinate_type = TCoordinate

◆ direction_type

template<typename TCoordinate , typename TEdge >
using grid::SquareGrid< TCoordinate, TEdge >::direction_type = SquareGridDirections

◆ edge_type

template<typename TCoordinate , typename TEdge >
using grid::SquareGrid< TCoordinate, TEdge >::edge_type = TEdge

◆ node_type

template<typename TCoordinate , typename TEdge >
using grid::SquareGrid< TCoordinate, TEdge >::node_type = ext::pair<TCoordinate, TCoordinate>

Constructor & Destructor Documentation

◆ SquareGrid()

template<typename TCoordinate , typename TEdge >
grid::SquareGrid< TCoordinate, TEdge >::SquareGrid ( TCoordinate  height,
TCoordinate  width 
)
explicit

Member Function Documentation

◆ addObstacle() [1/3]

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::addObstacle ( const node_type n)
virtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addObstacle() [2/3]

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::addObstacle ( node_type &&  n)
virtual
Here is the call graph for this function:

◆ addObstacle() [3/3]

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::addObstacle ( TCoordinate &&  x,
TCoordinate &&  y 
)
virtual
Here is the call graph for this function:

◆ checkCoordinates()

template<typename TCoordinate , typename TEdge >
bool grid::SquareGrid< TCoordinate, TEdge >::checkCoordinates ( const node_type coordinate) const
protectedvirtual
Here is the caller graph for this function:

◆ createEdge()

template<typename TCoordinate , typename TEdge >
virtual TEdge grid::SquareGrid< TCoordinate, TEdge >::createEdge ( const node_type a,
const node_type b 
) const
protectedpure virtual

Implemented in grid::SquareGrid4< TCoordinate, TEdge >, grid::SquareGrid8< TCoordinate, TEdge >, grid::WeightedSquareGrid4< TCoordinate, TEdge >, and grid::WeightedSquareGrid8< TCoordinate, TEdge >.

Here is the caller graph for this function:

◆ edgeCount()

template<typename TCoordinate , typename TEdge >
size_t grid::SquareGrid< TCoordinate, TEdge >::edgeCount
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:

◆ getEdges()

template<typename TCoordinate , typename TEdge >
ext::vector< TEdge > grid::SquareGrid< TCoordinate, TEdge >::getEdges
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:

◆ getHeight()

template<typename TCoordinate , typename TEdge >
TCoordinate grid::SquareGrid< TCoordinate, TEdge >::getHeight
Here is the caller graph for this function:

◆ getNodes()

template<typename TCoordinate , typename TEdge >
ext::set< typename SquareGrid< TCoordinate, TEdge >::node_type > grid::SquareGrid< TCoordinate, TEdge >::getNodes
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:

◆ getObstacleList() [1/2]

template<typename TCoordinate , typename TEdge >
ext::set< typename SquareGrid< TCoordinate, TEdge >::node_type > && grid::SquareGrid< TCoordinate, TEdge >::getObstacleList ( ) &&

◆ getObstacleList() [2/2]

template<typename TCoordinate , typename TEdge >
const ext::set< typename SquareGrid< TCoordinate, TEdge >::node_type > & grid::SquareGrid< TCoordinate, TEdge >::getObstacleList ( ) const &
Here is the caller graph for this function:

◆ getWidth()

template<typename TCoordinate , typename TEdge >
TCoordinate grid::SquareGrid< TCoordinate, TEdge >::getWidth
Here is the caller graph for this function:

◆ isNode()

template<typename TCoordinate , typename TEdge >
bool grid::SquareGrid< TCoordinate, TEdge >::isNode ( const node_type n) const
virtual
Here is the call graph for this function:

◆ isObstacle()

template<typename TCoordinate , typename TEdge >
bool grid::SquareGrid< TCoordinate, TEdge >::isObstacle ( const node_type n) const
virtual
Here is the caller graph for this function:

◆ isValidDirection()

template<typename TCoordinate , typename TEdge >
virtual bool grid::SquareGrid< TCoordinate, TEdge >::isValidDirection ( direction_type  direction) const
pure virtual

Implemented in grid::SquareGrid4< TCoordinate, TEdge >, grid::SquareGrid8< TCoordinate, TEdge >, grid::WeightedSquareGrid4< TCoordinate, TEdge >, and grid::WeightedSquareGrid8< TCoordinate, TEdge >.

Here is the caller graph for this function:

◆ nodeCount()

template<typename TCoordinate , typename TEdge >
size_t grid::SquareGrid< TCoordinate, TEdge >::nodeCount
overridevirtual

◆ operator>>()

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::operator>> ( ext::ostream ostream) const
overridevirtual

Implements grid::GridBase.

Here is the call graph for this function:

◆ predecessorEdges()

template<typename TCoordinate , typename TEdge >
ext::vector< TEdge > grid::SquareGrid< TCoordinate, TEdge >::predecessorEdges ( const node_type n) const
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:

◆ predecessors()

template<typename TCoordinate , typename TEdge >
ext::set< typename SquareGrid< TCoordinate, TEdge >::node_type > grid::SquareGrid< TCoordinate, TEdge >::predecessors ( const node_type n) const
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:

◆ resize()

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::resize ( TCoordinate  height,
TCoordinate  width 
)
virtual
Here is the call graph for this function:

◆ step()

template<typename TCoordinate , typename TEdge >
ext::pair< bool, typename SquareGrid< TCoordinate, TEdge >::node_type > grid::SquareGrid< TCoordinate, TEdge >::step ( const node_type n,
SquareGrid< TCoordinate, TEdge >::direction_type  direction 
) const
virtual
Here is the call graph for this function:

◆ stepEdge()

template<typename TCoordinate , typename TEdge >
ext::pair< bool, TEdge > grid::SquareGrid< TCoordinate, TEdge >::stepEdge ( const node_type n,
SquareGrid< TCoordinate, TEdge >::direction_type  direction 
) const
virtual
Here is the call graph for this function:

◆ successorEdges()

template<typename TCoordinate , typename TEdge >
ext::vector< TEdge > grid::SquareGrid< TCoordinate, TEdge >::successorEdges ( const node_type n) const
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ successors()

template<typename TCoordinate , typename TEdge >
ext::set< typename SquareGrid< TCoordinate, TEdge >::node_type > grid::SquareGrid< TCoordinate, TEdge >::successors ( const node_type n) const
overridevirtual

Implements grid::GridInterface< TCoordinate, TEdge >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ throwCoordinates()

template<typename TCoordinate , typename TEdge >
void grid::SquareGrid< TCoordinate, TEdge >::throwCoordinates ( const node_type coordinate) const
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toStringAs()

template<typename TCoordinate , typename TEdge >
std::string grid::SquareGrid< TCoordinate, TEdge >::toStringAs ( const ext::map< node_type, char > &  map) const
virtual
Here is the call graph for this function:

Field Documentation

◆ m_height

template<typename TCoordinate , typename TEdge >
TCoordinate grid::SquareGrid< TCoordinate, TEdge >::m_height
protected

◆ m_obstacles

template<typename TCoordinate , typename TEdge >
ext::set<node_type> grid::SquareGrid< TCoordinate, TEdge >::m_obstacles
protected

◆ m_width

template<typename TCoordinate , typename TEdge >
TCoordinate grid::SquareGrid< TCoordinate, TEdge >::m_width
protected

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