fpmas 1.6
node.h
Go to the documentation of this file.
1#ifndef FPMAS_NODE_API_H
2#define FPMAS_NODE_API_H
3
8#include <vector>
10
11namespace fpmas { namespace api { namespace graph {
12
16 template<typename _IdType, typename _EdgeType>
17 class Node {
18 public:
22 typedef _IdType IdType;
26 typedef _EdgeType EdgeType;
27
33 virtual IdType getId() const = 0;
34
42 virtual float getWeight() const = 0;
43
49 virtual void setWeight(float weight) = 0;
50
57 virtual const std::vector<EdgeType*> getIncomingEdges() const = 0;
58
66 virtual const std::vector<EdgeType*> getIncomingEdges(LayerId layer_id) const = 0;
67
75 virtual const std::vector<typename EdgeType::NodeType*> inNeighbors() const = 0;
76
85 virtual const std::vector<typename EdgeType::NodeType*> inNeighbors(LayerId layer_id) const = 0;
86
93 virtual const std::vector<EdgeType*> getOutgoingEdges() const = 0;
94
102 virtual const std::vector<EdgeType*> getOutgoingEdges(LayerId layer_id) const = 0;
103
111 virtual const std::vector<typename EdgeType::NodeType*> outNeighbors() const = 0;
112
121 virtual const std::vector<typename EdgeType::NodeType*> outNeighbors(LayerId layer_id) const = 0;
122
133 virtual void linkIn(EdgeType* edge) = 0;
134
145 virtual void linkOut(EdgeType* edge) = 0;
146
157 virtual void unlinkIn(EdgeType* edge) = 0;
158
169 virtual void unlinkOut(EdgeType* edge) = 0;
170
171 virtual ~Node() {}
172 };
173}}}
174#endif
Definition: node.h:17
virtual const std::vector< typename EdgeType::NodeType * > inNeighbors() const =0
virtual void unlinkOut(EdgeType *edge)=0
virtual const std::vector< typename EdgeType::NodeType * > outNeighbors() const =0
virtual void setWeight(float weight)=0
virtual const std::vector< typename EdgeType::NodeType * > outNeighbors(LayerId layer_id) const =0
virtual const std::vector< EdgeType * > getIncomingEdges() const =0
virtual void linkIn(EdgeType *edge)=0
virtual float getWeight() const =0
virtual void unlinkIn(EdgeType *edge)=0
virtual IdType getId() const =0
virtual const std::vector< EdgeType * > getIncomingEdges(LayerId layer_id) const =0
virtual const std::vector< EdgeType * > getOutgoingEdges() const =0
virtual void linkOut(EdgeType *edge)=0
virtual const std::vector< EdgeType * > getOutgoingEdges(LayerId layer_id) const =0
_EdgeType EdgeType
Definition: node.h:26
_IdType IdType
Definition: node.h:22
virtual const std::vector< typename EdgeType::NodeType * > inNeighbors(LayerId layer_id) const =0
int LayerId
Definition: edge.h:13
Definition: fpmas.cpp:3