Пример #1
0
        public static void Serialize(OperationGraph state, System.IO.BinaryWriter writer)
        {
            // Write the File Header with version
            writer.Write(new char[] { 'B', 'O', 'G', '\0' });
            writer.Write(FileVersion);

            // Write out the set of files
            var files = state.GetReferencedFiles();

            writer.Write(new char[] { 'F', 'I', 'S', '\0' });
            writer.Write((uint)files.Count);
            foreach (var file in files)
            {
                // Write the file id + path length + path
                writer.Write(file.FileId.value);
                WriteValue(writer, file.Path.ToString());
            }

            // Write out the root operation ids
            writer.Write(new char[] { 'R', 'O', 'P', '\0' });
            WriteValues(writer, state.GetRootOperationIds());

            // Write out the set of operations
            var operations = state.GetOperations();

            writer.Write(new char[] { 'O', 'P', 'S', '\0' });
            writer.Write((uint)operations.Count);
            foreach (var operationValue in state.GetOperations())
            {
                WriteOperationInfo(writer, operationValue.Value);
            }
        }
Пример #2
0
        private IList <IList <GraphNode> > BuildGraph(FileSystemState fileSystemState, OperationGraph evaluateGraph)
        {
            this.operationDetailsLookup.Clear();
            var activeIds   = evaluateGraph.GetRootOperationIds();
            var activeGraph = new List <IList <GraphNode> >();
            var knownIds    = new HashSet <OperationId>();

            BuildGraphColumn(fileSystemState, evaluateGraph, activeGraph, activeIds, knownIds);

            return(activeGraph);
        }