Skip to content

Commit

Permalink
Merge commit 'b33467e2fce240a8f47c7b5eaa9034c7eb4936c3' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
YdrMaster committed Oct 11, 2023
2 parents 42f4b19 + b33467e commit 75db867
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 32 deletions.
7 changes: 0 additions & 7 deletions src/01graph_topo/include/graph_topo/builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@

namespace refactor::graph_topo {

template<class Node, class Edge>
struct Graph {
GraphTopo topology;
std::vector<Node> nodes;
std::vector<Edge> edges;
};

template<class EdgeKey>
struct BuilderNode {
std::vector<EdgeKey> inputs, outputs;
Expand Down
11 changes: 9 additions & 2 deletions src/01graph_topo/include/graph_topo/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace refactor::graph_topo {
class Searcher;
class Modifier;
class InplaceModifier;

class GraphTopo {
friend class Searcher;
friend class Modifier;
friend class InplaceModifier;

class __Implement;
__Implement *_impl;
Expand Down Expand Up @@ -69,6 +69,13 @@ namespace refactor::graph_topo {
void __setGlobalOutputs(std::vector<size_t> outputs) noexcept;
};

template<class Node, class Edge>
struct Graph {
GraphTopo topology;
std::vector<Node> nodes;
std::vector<Edge> edges;
};

}// namespace refactor::graph_topo

#endif// GRAPH_TOPO_CONTAINER_H
2 changes: 1 addition & 1 deletion src/01graph_topo/include/graph_topo/graph_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define GRAPH_TOPO_GRAPH_TOPO_H

#include "builder.hpp"
#include "modifier.h"
#include "inplace_modifier.h"
#include "searcher.h"

#endif// GRAPH_TOPO_GRAPH_TOPO_H
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef GRAPH_TOPO_MODIFIER_H
#define GRAPH_TOPO_MODIFIER_H
#ifndef GRAPH_TOPO_INPLACE_MODIFIER_H
#define GRAPH_TOPO_INPLACE_MODIFIER_H

#include "container.h"

Expand Down Expand Up @@ -37,14 +37,14 @@ namespace refactor::graph_topo {
size_t node, edge;
};

class Modifier {
class InplaceModifier {
GraphTopo _g;

public:
Modifier() noexcept = default;
InplaceModifier() noexcept = default;

/// @brief 把图拓扑存入修改器。
explicit Modifier(GraphTopo) noexcept;
explicit InplaceModifier(GraphTopo) noexcept;

/// @brief 将图拓扑从修改器中取出。
GraphTopo take() noexcept;
Expand All @@ -57,4 +57,4 @@ namespace refactor::graph_topo {

}// namespace refactor::graph_topo

#endif// GRAPH_TOPO_MODIFIER_H
#endif// GRAPH_TOPO_INPLACE_MODIFIER_H
Loading

0 comments on commit 75db867

Please sign in to comment.