Exemple #1
0
        public void PostIntrospectorCommand(int nodeIndex, TargetInProgessState child, TargetInProgessState parent)
        {
            // Send the updated settings once the node has initialized
            LocalCallDescriptorForPostIntrospectorCommand callDescriptor =
                new LocalCallDescriptorForPostIntrospectorCommand(child, parent);

            nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor);
        }
Exemple #2
0
        /// <summary>
        /// This method first reads the objectId as an int from the stream,
        /// this int should be found in the "ObjectType" enumeration. This
        /// objectId informs the method what kind of object should be
        /// deserialized and returned from the method. The objectId is an
        /// output parameter. This parameter is also returned so it can be
        /// used in the read and write methods to determine if
        /// a frame or end marker was found.
        /// </summary>
        private object DeserializeFromStream(out int objectId)
        {
            object objectRead = null;

            objectId = readStream.ReadByte();
            switch ((ObjectType)objectId)
            {
            case ObjectType.NetSerialization:
                objectRead = binaryFormatter.Deserialize(readStream);
                break;

            case ObjectType.FrameMarker:
                objectRead = binaryReader.ReadInt32();
                break;

            case ObjectType.PostBuildResult:
                objectRead = new LocalCallDescriptorForPostBuildResult();
                ((LocalCallDescriptorForPostBuildResult)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.PostBuildRequests:
                objectRead = new LocalCallDescriptorForPostBuildRequests();
                ((LocalCallDescriptorForPostBuildRequests)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.PostLoggingMessagesToHost:
                objectRead = new LocalCallDescriptorForPostLoggingMessagesToHost();
                ((LocalCallDescriptorForPostLoggingMessagesToHost)objectRead).CreateFromStream(binaryReader, loggingTypeCache);
                break;

            case ObjectType.InitializeNode:
                objectRead = new LocalCallDescriptorForInitializeNode();
                ((LocalCallDescriptorForInitializeNode)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.InitializationComplete:
                objectRead = new LocalCallDescriptorForInitializationComplete();
                ((LocalCallDescriptorForInitializationComplete)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.UpdateNodeSettings:
                objectRead = new LocalCallDescriptorForUpdateNodeSettings();
                ((LocalCallDescriptorForUpdateNodeSettings)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.RequestStatus:
                objectRead = new LocalCallDescriptorForRequestStatus();
                ((LocalCallDescriptorForRequestStatus)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.PostCacheEntriesToHost:
                objectRead = new LocalCallDescriptorForPostingCacheEntriesToHost();
                ((LocalCallDescriptorForPostingCacheEntriesToHost)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.GetCacheEntriesFromHost:
                objectRead = new LocalCallDescriptorForGettingCacheEntriesFromHost();
                ((LocalCallDescriptorForGettingCacheEntriesFromHost)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.ShutdownComplete:
                objectRead = new LocalCallDescriptorForShutdownComplete();
                ((LocalCallDescriptorForShutdownComplete)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.ShutdownNode:
                objectRead = new LocalCallDescriptorForShutdownNode();
                ((LocalCallDescriptorForShutdownNode)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.PostIntrospectorCommand:
                objectRead = new LocalCallDescriptorForPostIntrospectorCommand(null, null);
                ((LocalCallDescriptorForPostIntrospectorCommand)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.GenericSingleObjectReply:
                objectRead = new LocalReplyCallDescriptor();
                ((LocalReplyCallDescriptor)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.PostStatus:
                objectRead = new LocalCallDescriptorForPostStatus();
                ((LocalCallDescriptorForPostStatus)objectRead).CreateFromStream(binaryReader);
                break;

            case ObjectType.EndMarker:
                return(null);

            default:
                ErrorUtilities.VerifyThrow(false, "Should not be here, ObjectId:" + objectId + "Next:" + readStream.ReadByte());
                break;
            }
            return(objectRead);
        }
Exemple #3
0
 /// <summary>
 /// This method first reads the objectId as an int from the stream, 
 /// this int should be found in the "ObjectType" enumeration. This 
 /// objectId informs the method what kind of object should be 
 /// deserialized and returned from the method. The objectId is an
 /// output parameter. This parameter is also returned so it can be 
 /// used in the read and write methods to determine if 
 /// a frame or end marker was found.
 /// </summary>
 private object DeserializeFromStream(out int objectId)
 {
     object objectRead = null;
     objectId = readStream.ReadByte();
     switch ((ObjectType)objectId)
     {
         case ObjectType.NetSerialization:
             objectRead = binaryFormatter.Deserialize(readStream);
             break;
         case ObjectType.FrameMarker:
             objectRead = binaryReader.ReadInt32();
             break;
         case ObjectType.PostBuildResult:
             objectRead = new LocalCallDescriptorForPostBuildResult();
             ((LocalCallDescriptorForPostBuildResult)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.PostBuildRequests:
             objectRead = new LocalCallDescriptorForPostBuildRequests();
             ((LocalCallDescriptorForPostBuildRequests)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.PostLoggingMessagesToHost:
             objectRead = new LocalCallDescriptorForPostLoggingMessagesToHost();
             ((LocalCallDescriptorForPostLoggingMessagesToHost)objectRead).CreateFromStream(binaryReader, loggingTypeCache);
             break;
         case ObjectType.InitializeNode:
             objectRead = new LocalCallDescriptorForInitializeNode();
             ((LocalCallDescriptorForInitializeNode)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.InitializationComplete:
             objectRead = new LocalCallDescriptorForInitializationComplete();
             ((LocalCallDescriptorForInitializationComplete)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.UpdateNodeSettings:
             objectRead = new LocalCallDescriptorForUpdateNodeSettings();
             ((LocalCallDescriptorForUpdateNodeSettings)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.RequestStatus:
             objectRead = new LocalCallDescriptorForRequestStatus();
             ((LocalCallDescriptorForRequestStatus)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.PostCacheEntriesToHost:
             objectRead = new LocalCallDescriptorForPostingCacheEntriesToHost();
             ((LocalCallDescriptorForPostingCacheEntriesToHost)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.GetCacheEntriesFromHost:
             objectRead = new LocalCallDescriptorForGettingCacheEntriesFromHost();
             ((LocalCallDescriptorForGettingCacheEntriesFromHost)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.ShutdownComplete:
             objectRead = new LocalCallDescriptorForShutdownComplete();
             ((LocalCallDescriptorForShutdownComplete)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.ShutdownNode:
             objectRead = new LocalCallDescriptorForShutdownNode();
             ((LocalCallDescriptorForShutdownNode)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.PostIntrospectorCommand:
             objectRead = new LocalCallDescriptorForPostIntrospectorCommand(null, null);
             ((LocalCallDescriptorForPostIntrospectorCommand)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.GenericSingleObjectReply:
             objectRead = new LocalReplyCallDescriptor();
             ((LocalReplyCallDescriptor)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.PostStatus:
             objectRead = new LocalCallDescriptorForPostStatus();
             ((LocalCallDescriptorForPostStatus)objectRead).CreateFromStream(binaryReader);
             break;
         case ObjectType.EndMarker:
             return null;
         default:
             ErrorUtilities.VerifyThrow(false, "Should not be here, ObjectId:" + objectId + "Next:" + readStream.ReadByte());
             break;
     }
     return objectRead;
 }
Exemple #4
0
 public void PostIntrospectorCommand(int nodeIndex, TargetInProgessState child, TargetInProgessState parent)
 {
     // Send the updated settings once the node has initialized
     LocalCallDescriptorForPostIntrospectorCommand callDescriptor =
           new LocalCallDescriptorForPostIntrospectorCommand(child, parent);
     nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor);
 }