graph.h 648 字节
Newer Older
sahduashufa's avatar
0418  
sahduashufa 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#ifndef GRAPH_H
#define GRAPH_H

#include <map>
#include <vector>
#include <utility>

class Graph {
    private:
        std::map<long int, std::vector<std::pair<double, long int> > > nodes;
        static Graph* instance;
        Graph();

    public:
        static long int uid_counter;
        static long int uid();
        static Graph* getInstance();

        void connect(const long int& uid, const std::pair<double, long int>& edge);
        std::vector<std::pair<double, long int> > get(const long int& uid) const;
        bool has(const long int& uid) const;

        void new_recording();
};

#endif /* end of include guard: GRAPH_H */