Program Listing for File DynamicGraphSource.hpp

Return to documentation for file (include/networkit/generators/DynamicGraphSource.hpp)

/*
 * DynamicGraphSpurce.hpp
 *
 *  Created on: 03.04.2013
 *      Author: cls
 */

#ifndef NETWORKIT_GENERATORS_DYNAMIC_GRAPH_SOURCE_HPP_
#define NETWORKIT_GENERATORS_DYNAMIC_GRAPH_SOURCE_HPP_

#include <functional>

#include <networkit/dynamics/GraphEventProxy.hpp>

namespace NetworKit {

class DynamicGraphSource {

protected:
    GraphEventProxy *Gproxy; // receives events produced by the generator and forwards them
    Graph *G;
    // true if newGraph has been called and graph and proxy instances are properly set
    bool graphSet;
    // true if initializeGraph has been called and graph has been properly initialized
    bool graphInitialized;

public:
    DynamicGraphSource();

    // DynamicGraphGenerator(GraphEventProxy& proxy);

    virtual ~DynamicGraphSource() = default;

    GraphEventProxy *newGraph();

    virtual void initializeGraph() = 0;

    virtual void generate() = 0;

    /*
     * Continue generating while function does not return false.
     * @param[in] cont generator continues when this function returns true
     */
    virtual void generateWhile(std::function<bool(void)> cont);

    virtual void generateNodes(count n);

    virtual void generateEdges(count m);

    virtual void generateTimeSteps(count t);
};

} /* namespace NetworKit */
#endif // NETWORKIT_GENERATORS_DYNAMIC_GRAPH_SOURCE_HPP_