Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/aidge/aidge_core
  • hrouis/aidge_core
  • mszczep/aidge_core
  • oantoni/aidge_core
  • cguillon/aidge_core
  • jeromeh/aidge_core
  • axelfarr/aidge_core
  • cmoineau/aidge_core
  • noamzerah/aidge_core
  • lrakotoarivony/aidge_core
  • silvanosky/aidge_core
  • maab05/aidge_core
  • mick94/aidge_core
  • lucaslopez/aidge_core_ll
  • wboussella/aidge_core
  • farnez/aidge_core
  • mnewson/aidge_core
17 results
Show changes
Commits on Source (2)
......@@ -38,6 +38,13 @@ enum class DataType;
/**
* @brief Groupement of Nodes forming a computational graph on which properties and functions
* can easily and safely be applied or run.
* A GraphView countains:
* - mName: The name of the GraphView
* - mRootNode: The root of the GraphView, an arbitrary Node of the GraphView
* - mNodes: The set of Nodes included in the GraphView
* - mNodeRegistry: Set of nodes included in the graphview with names
* - mInputNodes: GraphView inputs IOIndex_t designates the input number
* - mOutputNodes: GraphView outputs IOIndex_t designates the input number
*/
class GraphView : public std::enable_shared_from_this<GraphView> {
private:
......@@ -56,27 +63,44 @@ private:
/// @brief GraphView inputs IOIndex_t designates the input number
std::vector<std::pair<NodePtr, IOIndex_t>> mInputNodes;
/// @brief GraphView outputs IOIndex_t designates the input number
/// @brief GraphView outputs IOIndex_t designates the output number
std::vector<std::pair<NodePtr, IOIndex_t>> mOutputNodes;
public:
/**
* @brief Constructs a GraphView object with a given name
* @params string name : name given to the GraphView
*/
GraphView(const std::string& name="")
: mName(name)
{
// ctor
}
/**
* @brief equality operator, tests if the current GraphView and the gv GraphView have the same Nodes
* @params GraphView &gv GraphView that shall be compared to the current one
* @returns bool True if both GraphView have the same set of Nodes
*/
bool operator==(const GraphView &gv) const
{
return mNodes == gv.mNodes;
}
/**
* @brief Allows to find a Node in the GraphView using the Node's name
* @params string The name of the Node we are looking for
* @returns NodePtr Pointer of the Node that is found
* @details Returns nullptr if the Node isn't found
*/
const NodePtr operator[](const std::string& nodeName) const;
///////////////////////////////////////////////////////
// FUNCTIONAL DESCRIPTION
///////////////////////////////////////////////////////
/**
* @todo
*/
Connector operator()(const std::vector<Connector> ctors);
///////////////////////////////////////////////////////
......@@ -84,15 +108,15 @@ public:
///////////////////////////////////////////////////////
public:
/**
* @brief Name of the node.
* @brief Name of the GraphView.
* @return std::string
*/
inline std::string name() const noexcept { return mName; }
/**
* @brief Set the node name.
* @warning Undefined behaviour when several Nodes have the same name.
* @param name New name for the node.
* @brief Set the GraphView name.
* @warning Undefined behaviour when several GraphViews have the same name. @todo to check if true
* @param name New name for the GraphView.
*/
inline void setName(const std::string &name) { mName = name; }
......@@ -105,7 +129,9 @@ public:
/**
* @brief Save the GraphView as a Mermaid graph in a .md file at the
* specified location.
* @param path
* @param path: Path where the file should be put
* @param verbose @todo i have no idea what it's doing
* @param showProducers if true, shows additional informations
*/
void save(const std::string& path, bool verbose = false, bool showProducers = true) const;
......@@ -114,7 +140,7 @@ public:
/**
* Check that a node is in the current GraphView.
* @param nodePtr Node to check
* @return bool True is nodePtr belongs to the GraphView.
* @return bool True if nodePtr belongs to the GraphView.
*/
bool inView(const NodePtr& nodePtr) const;
......@@ -125,10 +151,18 @@ public:
*/
bool inView(const std::string& nodeName) const;
/**
* Retruns the rootNode of the GraphView
* @return NodePtr of the rootNode
*/
inline NodePtr rootNode() const noexcept {
return mRootNode;
}
/**
* Changes the rootNode of the GraphView
* @param NodePtr of the new rootNode
*/
void setRootNode(NodePtr node);
///////////////////////////////////////////////////////
......@@ -147,6 +181,8 @@ public:
/** @brief Assess if the given Node is an output Node of the GraphView object. */
bool isOutputNode(const NodePtr& nodePtr) const;
/** @todo here i am
*/
void setOrderedInputs(const std::vector<std::pair<NodePtr, IOIndex_t>>& inputs);
void setOrderedOutputs(const std::vector<std::pair<NodePtr, IOIndex_t>>& outputs);
......