Releases: Vipyr/cppdigraph
Updated cmake files and reordered node/edge deletion in digraph.
Updated the cmake files to organize the build in a more sane way with lib/*.so
and include/cdg/*.h
Reverted the node/edge deletion order change from December. Admittedly, this shouldn't matter so we're investigating a better way to handle it.
Iteration, IDs, and Filtering Improvements
This release comes with the implementation of Chain and BidirectionalChain that implement the iterator interface.
Node and Edge IDs are calculated using a much simpler static int now.
Some filtering improvements to make passing of filter objects to all nodes and edges more consistent.
Relationships!
Implemented node Relationships, so nodes can now interact with other types by inheriting from the Relationship<tail_t, head_t>
type.
Example Usage:
class MyNode: public cdg::Node, public cdg::Relationship<MyNode, MyNode> {
public:
...
private:
...
};
int main() {
// Instantiate the Relationship<MyNode, MyNode> connector object
cdg::Relationship<MyNode, MyNode>::connector<> connector = cdg::Relationship<MyNode, MyNode>::connector<>();
// Create a couple of nodes
MyNode* n0 = new MyNode("n0");
MyNode* n1 = new MyNode("n1");
// Connect n0 and n1 with the type aware getNext and getPrev API
connector(n0, n1);
// Traverse an edge
assert n1 == n0->Relationship<MyNode, MyNode>::getNext();
assert n0 == n1->Relationship<MyNode, MyNode>::getPrev();
return 0;
}
Version 0.3
Templated edge improvements and a connector<EdgeType>
class to allow users to inject their own edge types.
Edge Handles and Factories!
Added Edge Handles for head and tail to unify edge traversal. User code can now traverse to the other side without having to know about heads and tails.
myHead->getTail();
myTail->getHead();
can now just be
myHandle->traverse();
Edge creation can be done with the createEdge
factory method, or by simply doing myNode->connect(otherNode);
.
Renamed the CDG_DESTRUCT_NODE_RELATIONSHIP
macro to AUTO_DELETE_EDGES
for clarity. Functionality is unchanged.
Version 0.1
First beta release that looks like it could be useful. Node and Edge API is there and src/test.cpp
contains a reasonable example of a simple graph. Standalone documentation and cookbook stuff still to come.