Esempio n. 1
0
 public static void RegisterAlgNode(this AbstractAlgorithmNode n)
 {
     if (!_algNodes.ContainsKey(n.GetType()))
     {
         _algNodes.Add(n.GetType(), _tableFactory.MakeKeyTable <IAlgorithmNode>());
     }
     _algNodes[n.GetType()].Add(n.ID, n);
 }
Esempio n. 2
0
 public static IEnumerable <TAlg> GetAllNodes <TAlg>(this AbstractAlgorithmNode n) where TAlg : class, IAlgorithmNode
 {
     if (!_algNodes.ContainsKey(n.GetType()))
     {
         _algNodes.Add(n.GetType(), _tableFactory.MakeKeyTable <IAlgorithmNode>());
     }
     return(_algNodes[n.GetType()].Select <IAlgorithmNode, TAlg>(alg => alg as TAlg));
 }
Esempio n. 3
0
 public static TAlg GetAlgNode <TAlg>(this AbstractAlgorithmNode n, UUID id) where TAlg : class, IAlgorithmNode
 {
     return(_algNodes[n.GetType()][id] as TAlg);
 }