1 #ifndef ALL_DISTANCE_SKETCH_ALL_DISTANCE_SKETCH_GRAPH_GENERIC_GRAPH_ADAPTOR_H_
2 #define ALL_DISTANCE_SKETCH_ALL_DISTANCE_SKETCH_GRAPH_GENERIC_GRAPH_ADAPTOR_H_
9 class GenericGraphAdaptor {
11 class GenericIterator {
13 int GetId() {
return 0; }
15 int GetDeg() {
return -1; }
17 int GetNbrNId(
int n) {
return -1; }
19 int GetOutDeg()
const {
return -1; }
21 bool HasMore()
const {
return false; }
23 int GetOutNId(
int n)
const {
return -1; }
25 GenericIterator& operator++(
int) {
return *
this; }
27 inline bool operator==(
const GenericIterator& rhs) {
return false; }
29 inline bool operator!=(
const GenericIterator& rhs) {
return false; }
34 GenericNode(
int dummy) {}
35 int GetId() {
return -1; }
38 typedef GenericNode TNode;
39 typedef GenericIterator TNodeI;
41 int AddNode(
int aNid = -1) {
return -1; }
43 int AddEdge(
const int& aSrcNId,
const int& aDstNId,
int aWeight = 1) {
57 bool IsEdge(
const int& aSrcNId,
const int& aDstNId)
const {
61 bool IsNode(
const int& NId)
const {
65 int GetNodes()
const {
return 0; }
67 int GetEdges()
const {
return 0; }
69 TNodeI GetNI(
const int& aNId)
const {
74 int GetMxNId()
const {
return 0; }
77 typedef GenericGraphAdaptor TUnDirectedGraph;
78 typedef GenericGraphAdaptor TDirectedGraph;
81 struct GraphTrait< TUnDirectedGraph > {
82 static const bool directed =
false;
95 #endif // ALL_DISTANCE_SKETCH_ALL_DISTANCE_SKETCH_GRAPH_GENERIC_GRAPH_ADAPTOR_H_