Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
GridInterface.hpp
Go to the documentation of this file.
1
6// Copyright (c) 2017 Czech Technical University in Prague | Faculty of Information Technology. All rights reserved.
7
8#pragma once
9
10#include <alib/set>
11#include <alib/pair>
12#include <alib/vector>
13#include <functional>
14
15#include "GridBase.hpp"
16
17namespace grid {
18
19template<typename TCoordinate, typename TEdge>
20class GridInterface : public GridBase {
21// ---------------------------------------------------------------------------------------------------------------------
22 public:
23 using coordinate_type = TCoordinate;
24 using edge_type = TEdge;
26
27// ---------------------------------------------------------------------------------------------------------------------
28
29 virtual size_t nodeCount() const = 0;
30 virtual size_t edgeCount() const = 0;
31
32// ---------------------------------------------------------------------------------------------------------------------
33
34 virtual ext::set<node_type> getNodes() const = 0;
35 virtual ext::vector<TEdge> getEdges() const = 0;
36
37// ---------------------------------------------------------------------------------------------------------------------
38
39 virtual ext::set<node_type> successors(const node_type &n) const = 0;
40 virtual ext::vector<TEdge> successorEdges(const node_type &n) const = 0;
41 virtual ext::set<node_type> predecessors(const node_type &n) const = 0;
42 virtual ext::vector<TEdge> predecessorEdges(const node_type &n) const = 0;
43
44// ---------------------------------------------------------------------------------------------------------------------
45
46 virtual std::string name() const = 0;
47
48// ---------------------------------------------------------------------------------------------------------------------
49};
50
51// =====================================================================================================================
52
53}
54
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Definition: set.hpp:44
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: GridBase.hpp:15
Definition: GridInterface.hpp:20
TCoordinate coordinate_type
Definition: GridInterface.hpp:23
virtual ext::set< node_type > successors(const node_type &n) const =0
virtual size_t edgeCount() const =0
TEdge edge_type
Definition: GridInterface.hpp:24
virtual ext::vector< TEdge > successorEdges(const node_type &n) const =0
virtual size_t nodeCount() const =0
virtual std::string name() const =0
virtual ext::vector< TEdge > predecessorEdges(const node_type &n) const =0
virtual ext::set< node_type > predecessors(const node_type &n) const =0
virtual ext::set< node_type > getNodes() const =0
virtual ext::vector< TEdge > getEdges() const =0
Definition: GridDirection.hpp:12