7 #ifndef __FWATOMSPATCH_VERSIONSGRAPH_HPP__ 8 #define __FWATOMSPATCH_VERSIONSGRAPH_HPP__ 10 #include "fwAtomsPatch/LinkDescriptor.hpp" 11 #include "fwAtomsPatch/VersionDescriptor.hpp" 12 #include "fwAtomsPatch/config.hpp" 14 #include <fwCore/BaseObject.hpp> 15 #include <fwCore/mt/types.hpp> 17 #include <boost/graph/adjacency_list.hpp> 18 #include <boost/graph/graph_traits.hpp> 36 typedef ::fwAtomsPatch::VersionDescriptor
NodeType;
37 typedef ::fwAtomsPatch::LinkDescriptor
EdgeType;
38 typedef ::boost::adjacency_list< ::boost::listS, ::boost::vecS, ::boost::directedS, NodeType, EdgeType> GraphType;
39 typedef ::boost::graph_traits<GraphType>::vertex_descriptor NodeIDType;
40 typedef ::boost::graph_traits<GraphType>::edge_descriptor EdgeIDType;
41 typedef std::map<NodeType, NodeIDType, ::fwAtomsPatch::VersionDescriptor::Compare> ExistingNodesType;
42 typedef std::map<EdgeType, EdgeIDType, ::fwAtomsPatch::LinkDescriptor::Compare> ExistingEdgesType;
43 typedef std::vector< NodeIDType > VersionSeriesType;
44 typedef std::pair<LinkDescriptor::VersionIDType, bool> LinkedVersionType;
61 FWATOMSPATCH_API
void addNode(NodeType node);
67 FWATOMSPATCH_API
void addEdge(EdgeType edge);
74 FWATOMSPATCH_API VersionSeriesType shortestPath(
const std::string& origin,
const std::string& target);
79 FWATOMSPATCH_API NodeType getNode(
const NodeIDType& nodeID);
84 FWATOMSPATCH_API NodeIDType getNode(
const std::string& name)
const;
89 FWATOMSPATCH_API EdgeType getEdge(
const NodeIDType& origin,
const NodeIDType& target);
95 FWATOMSPATCH_API LinkedVersionType getLinkedVersion(
101 FWATOMSPATCH_API std::vector< std::string > getConnectedVersions(
const std::string& currentVersion);
109 FWATOMSPATCH_API NodeIDType createOrUpdateNode(
const NodeType& node);
115 FWATOMSPATCH_API EdgeIDType createEdge(
const EdgeType& edge);
122 FWATOMSPATCH_API VersionSeriesType shortestPath(
const NodeType& origin,
const NodeType& target);
125 mutable ::fwCore::mt::ReadWriteMutex m_graphMutex;
128 mutable ::fwCore::mt::ReadWriteMutex m_nodesMutex;
131 mutable ::fwCore::mt::ReadWriteMutex m_edgesMutex;
137 ExistingNodesType m_nodes;
140 ExistingEdgesType m_edges;
Base class for all FW4SPL's classes.
Version descriptor used to identify a version.
Contains base functionalities used to transform objects from a version to another.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Link descriptor used to identify a link between two versions.
Versions graph description.
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
std::pair< std::string, std::string > VersionIDType
VersionID used to link type and version.