47 template <
typename NodeType,
typename... Args>
51 template <
typename N,
typename... Ns>
174 ->
std::vector<
std::
string>;
227#include "smgl/GraphImpl.hpp"
Class defining a Graph's style when writing to a Dot file.
A collection of Nodes for managing pipeline state and serialization.
static auto Schedule(const Graph &g) -> std::vector< Node::Pointer >
Generate an update schedule for the provided Graph.
auto cacheFile() const -> filesystem::path
Get the root cache file for the Graph.
auto cacheEnabled() const -> bool
Whether or not graph caching is enabled.
auto size() const -> std::size_t
Get the number of nodes in the graph.
void insertNodes(N &n0, Ns &&... nodes)
Add one or more Nodes to the Graph.
static auto Save(const filesystem::path &path, const Graph &g, bool writeCache=false) -> void
Save a Graph to a JSON file.
auto cacheDir() const -> filesystem::path
Returns the cache directory as configured by cacheFile() and cacheType()
void setCacheFile(const filesystem::path &p)
Set the root cache file for the Graph.
static auto Load(const filesystem::path &path) -> Graph
Load a Graph from a JSON file.
void setCacheType(CacheType t)
Set the graph's CacheType.
static constexpr std::uint32_t Version
filesystem::path cacheFile_
std::unordered_map< Uuid, Node::Pointer > nodes_
void setProjectMetadata(const Metadata &m)
Set the project metadata.
static auto CheckRegistration(const filesystem::path &path) -> std::vector< std::string >
Checks that a Graph JSON file can be loaded.
static auto Serialize(const Graph &g, bool useCache, const filesystem::path &cacheDir) -> Metadata
void setEnableCache(bool enable)
Set whether or not graph caching is enabled.
auto update() -> State
Update the Graph's nodes.
friend auto WriteDotFile(const filesystem::path &path, const Graph &g, const GraphStyle &style) -> void
Write Graph to a file in the Graphviz Dot format.
static auto Serialize(const Graph &g) -> Metadata
Serialize a Graph to a Metadata object.
auto operator[](const Uuid &uuid) const -> Node::Pointer
Get a Node by Uuid.
void insertNode(const Node::Pointer &n)
Add a Node to the Graph.
auto cacheType() const -> CacheType
Get the graph's CacheType.
void removeNode(const Node::Pointer &n)
Remove a Node from the Graph.
auto state() const -> State
Get the current graph state.
auto projectMetadata() const -> const Metadata &
Get the project metadata.
std::shared_ptr< Node > Pointer
Base class for objects which are uniquely identifiable.
auto uuid() const -> Uuid
Universally unique identifier class.
Project top-level namespace.
CacheType
Cache Location Type.
nlohmann::ordered_json Metadata
Metadata storage class.
@ Error
Error messages and above.
ISO C++ top-level namespace.