mod private
{
use crate::prelude::*;
use crate::canonical;
use crate::meta::*;
use core::fmt;
use indexmap::IndexMap;
use std::default::Default;
include!( "./factory_impl.rs" );
#[ derive( Default ) ]
pub struct GenerativeNodeFactory< NodeId = crate::IdentityWithInt, EdgeId = crate::IdentityWithInt >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
GenerativeNodeFactory< 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 > >,
pub _node_id_generator : NodeId::Generator,
pub _edge_id_generator : EdgeId::Generator,
}
impl< NodeId, EdgeId >
AsRef< GenerativeNodeFactory< NodeId, EdgeId > >
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
fn as_ref( &self ) -> &Self
{
self
}
}
impl< NodeId, EdgeId > GraphNodesNominalInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
type NodeHandle = crate::canonical::Node< NodeId, EdgeId >;
index!
{
node,
out_nodes_ids,
}
}
impl< NodeId, EdgeId > GraphEdgesNominalInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
{
type EdgeHandle = crate::canonical::Edge< EdgeId, NodeId >;
index!
{
edge,
out_edges_ids,
}
}
impl< NodeId, EdgeId > GraphNodesEnumerableInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
index!
{
nodes,
nnodes,
}
}
impl< NodeId, EdgeId > GraphEdgesEnumerableInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
{
index!
{
edges,
nedges,
}
}
impl< NodeId, EdgeId > GraphNodesExtendableInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
index!
{
node_mut,
node_add_out_nodes,
node_making,
}
}
impl< NodeId, EdgeId > GraphEdgesExtendableInterface
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
index!
{
_edge_add,
}
}
impl< NodeId, EdgeId > fmt::Debug
for GenerativeNodeFactory< NodeId, EdgeId >
where
NodeId : IdentityInterface + HasIdGenerator< NodeId >,
EdgeId : IdentityInterface + HasIdGenerator< EdgeId >,
{
index!( fmt );
}
}
crate::mod_interface!
{
orphan use GenerativeNodeFactory;
}