mod private
{
use crate::prelude::*;
use core::fmt;
use indexmap::IndexMap;
use crate::meta::*;
include!( "./factory_impl.rs" );
#[ derive( Default ) ]
pub struct ReadableNodeFactory< NodeId = crate::IdentityWithInt, EdgeId = crate::IdentityWithInt >
where
NodeId : IdentityInterface,
EdgeId : IdentityInterface,
ReadableNodeFactory< NodeId, EdgeId > : crate::GraphNodesNominalInterface,
{
pub id_to_node_map : IndexMap< NodeId, crate::canonical::Node< NodeId, EdgeId > >,
pub id_to_edge_map : IndexMap< EdgeId, crate::canonical::Edge< EdgeId, NodeId > >,
}
impl< NodeId, EdgeId > GraphNodesNominalInterface
for ReadableNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface,
EdgeId : IdentityInterface,
{
type NodeHandle = crate::canonical::Node< NodeId, EdgeId >;
index!
{
node,
out_nodes_ids,
}
}
impl< NodeId, EdgeId > GraphEdgesNominalInterface
for ReadableNodeFactory< NodeId, EdgeId >
where
EdgeId : IdentityInterface,
NodeId : IdentityInterface,
{
type EdgeHandle = crate::canonical::Edge< EdgeId, NodeId >;
index!
{
edge,
out_edges_ids,
}
}
impl< NodeId, EdgeId > GraphNodesEnumerableInterface
for ReadableNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface,
EdgeId : IdentityInterface,
{
index!
{
nodes,
nnodes,
}
}
impl< NodeId, EdgeId > GraphEdgesEnumerableInterface
for ReadableNodeFactory< NodeId, EdgeId >
where
EdgeId : IdentityInterface,
NodeId : IdentityInterface,
{
index!
{
edges,
nedges,
}
}
impl< NodeId, EdgeId > fmt::Debug
for ReadableNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface,
EdgeId : IdentityInterface,
{
index!( fmt );
}
}
crate::mod_interface!
{
orphan use ReadableNodeFactory;
}