Changeset 2196


Ignore:
Timestamp:
Dec 11, 2010, 11:29:13 AM (11 years ago)
Author:
nolte
Message:

Serialising the Dictionary with the Binary Writer (writing)

Location:
trunk/CrypPlugins/KeySearcher/P2P
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/Storage/StorageHelper.cs

    r2155 r2196  
    11using System;
     2using System.Collections.Generic;
    23using System.IO;
    34using Cryptool.P2P;
     
    5051           
    5152            //TODO: Dictionary write;
     53//----------------------------------------------------------------------------------
     54/* 
     55            //Creating a copy of the activity dictionary
     56            Dictionary<String, Dictionary<long, int>> copyAct = nodeToUpdate.Activity;
     57
     58            //Write number of avatarnames
     59            binaryWriter.Write(copyAct.Keys.Count);
     60            foreach (string avatar in copyAct.Keys)
     61            {
     62                Dictionary<long, int> maschCopy = copyAct[avatar];
     63                //write avatarname
     64                binaryWriter.Write(avatar);
     65                //write the number of maschines for this avatar
     66                binaryWriter.Write(copyAct[avatar].Keys.Count);
     67
     68                foreach (long maschID in copyAct[avatar].Keys)
     69                {
     70                    //write the maschines and their patterncount
     71                    binaryWriter.Write(maschID);
     72                    binaryWriter.Write(maschCopy[maschID]);
     73                }
     74            }
     75*/
     76//----------------------------------------------------------------------------------)
    5277
    5378            return StoreWithStatistic(KeyInDht(nodeToUpdate), memoryStream.ToArray());
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/NodeBase.cs

    r2185 r2196  
    2525//-----------------------------------------------------------------------------------
    2626/*
    27         Dictionary Tests
     27        //Dictionary Tests
    2828        String Avatarname = "ct2";
    2929        public Dictionary<String, Dictionary<long, int>> Activity;
Note: See TracChangeset for help on using the changeset viewer.