msmazes::BasePattern<> Class Template Reference
[Core Pattern Layer]

#include <msmazes/core/pattern/base.hpp>

List of all members.


Detailed Description

template<>
class msmazes::BasePattern<>

All Pattern models provided by the Core Library are derived from BasePattern. This class template handles common initialization tasks and implements most of the associated types and functions specified in the Pattern concept.


Template parameters

Parameter Description Default
EdgeDirectedSelector The type that will represent whether the edges in the underlying graph are undirected (in which case this type is boost::undirectedS), directed (in which case this type is boost::directedS), or bidirectional (in which case this type is boost::bidirectionalS).
CellType The type of the objects that will be connected together.
CellEqualityPolicyType The type of the function object that will determine equality between any two cells in this BasePattern.
DirectionType The type that will represent the course or bearing that is followed when traversing an edge in the underlying graph.
CellContainer The type of the container that will store the cells. std::vector <CellType>


Model of


Type requirements



Public Types

typedef implementation_defined Cell
typedef implementation_defined CellEqualityPolicy
typedef implementation_defined Graph
typedef implementation_defined CellIndex
typedef implementation_defined EdgeDirectedCategory
typedef implementation_defined Direction

Public Member Functions

virtual ~BasePattern ()
 The destructor.
const GraphgetGraph () const
CellIndex getCellCount () const
const CellgetCell (const CellIndex index) const
virtual const CellgetEntranceCell () const =0
virtual const CellgetSourceCell () const =0
virtual const CellgetTargetCell () const =0
virtual const CellgetExitCell () const =0
Direction getEdgeDirection (const CellIndex source_index, const CellIndex target_index) const

Protected Member Functions

 BasePattern ()
 The default constructor.
template<typename PatternFormer, typename ArgumentPack>
void initializeWithPatternFormer (const PatternFormer &pattern_former, const ArgumentPack &p)
virtual Direction getEdgeDirectionDerived (const Cell &source, const Cell &target) const


Member Typedef Documentation

typedef implementation_defined msmazes::BasePattern<>::Cell
 

The type of the objects to be connected together, as defined in the Pattern concept.

typedef implementation_defined msmazes::BasePattern<>::CellEqualityPolicy
 

The type of the function object that determines equality between any two cells, as defined in the Pattern concept.

typedef implementation_defined msmazes::BasePattern<>::Graph
 

The type of the underlying object that represents the manner in which the cells are connected together, as defined in the Pattern concept.

typedef implementation_defined msmazes::BasePattern<>::CellIndex
 

An unsigned integral type for representing either the index of a cell or the number of such cells, as defined in the Pattern concept.

typedef implementation_defined msmazes::BasePattern<>::EdgeDirectedCategory
 

The type that represents whether the edges in the underlying graph are undirected, directed, or bidirectional, as defined in the Pattern concept.

typedef implementation_defined msmazes::BasePattern<>::Direction
 

A type for representing the course or bearing that is followed when traversing an edge in the underlying graph, as defined in the Pattern concept.


Constructor & Destructor Documentation

msmazes::BasePattern<>::BasePattern  )  [inline, protected]
 

Because the BasePattern class template defines pure virtual functions, direct instantiation is allowed only at the beginning of the initialization phase of construction of a subclass instance that fully implements these functions.

virtual msmazes::BasePattern<>::~BasePattern  )  [inline, virtual]
 

Destroys this BasePattern.


Member Function Documentation

template<typename PatternFormer, typename ArgumentPack>
void msmazes::BasePattern<>::initializeWithPatternFormer const PatternFormer &  pattern_former,
const ArgumentPack &  p
[inline, protected]
 

Constructs the cells and their connections in this BasePattern using the specified Pattern Former and any specified arguments that are subclass-specific. Call this function during initialization of the subclass instance.

Parameter Name Description Preconditions
pattern_former The specified pattern former. PatternFormer must model the Pattern Former concept.
p An object containing the other arguments. ArgumentPack must model the Argument Pack concept.

const Graph& msmazes::BasePattern<>::getGraph  )  const [inline]
 

Returns a const reference to the underlying object that represents the manner in which the cells are connected together in this BasePattern, as defined in the Pattern concept.

CellIndex msmazes::BasePattern<>::getCellCount  )  const [inline]
 

Returns the number of cells in this BasePattern, as defined in the Pattern concept.

const Cell& msmazes::BasePattern<>::getCell const CellIndex  index  )  const [inline]
 

Returns a const reference to the cell in this BasePattern to which the specified index refers, as defined in the Pattern concept.

virtual const Cell& msmazes::BasePattern<>::getEntranceCell  )  const [pure virtual]
 

Returns a const reference to the entrance cell in the solution path of an overlying maze, as defined in the Pattern concept.

virtual const Cell& msmazes::BasePattern<>::getSourceCell  )  const [pure virtual]
 

Returns a const reference to the cell that topologically follows the entrance cell in the solution path of an overlying maze, as defined in the Pattern concept.

virtual const Cell& msmazes::BasePattern<>::getTargetCell  )  const [pure virtual]
 

Returns a const reference to the cell that topologically precedes the exit cell in the solution path of an overlying maze, as defined in the Pattern concept.

virtual const Cell& msmazes::BasePattern<>::getExitCell  )  const [pure virtual]
 

Returns a const reference to the exit cell in the solution path of an overlying maze, as defined in the Pattern concept.

virtual Direction msmazes::BasePattern<>::getEdgeDirectionDerived const Cell source,
const Cell target
const [inline, protected, virtual]
 

Override this function to calculate the course or bearing that is followed when traversing the corresponding edge in the underlying graph. Do not override the public version.

Direction msmazes::BasePattern<>::getEdgeDirection const CellIndex  source_index,
const CellIndex  target_index
const [inline]
 

Returns a representation of the course or bearing that is followed when traversing the corresponding edge in the underlying graph, as defined in the Pattern concept.


Multi-State Mazes in C++ is hosted by SourceForge.net. Use the Table of Contents for navigation.