public void Deserialize(IPofReader reader) { var version = reader.ReadU32(0); SourceDirectory = reader.ReadString(1); DestinationDirectory = reader.ReadString(2); ThumbnailsToGenerate = reader.ReadS32(3); Trace.Assert(version == kVersion, "version == kVersion"); }
public void Deserialize(IPofReader reader) { var version = reader.ReadU32(0); Id = reader.ReadGuid(1); Name = reader.ReadString(2); Authors = reader.ReadArray<string>(3); Website = reader.ReadString(4); Targets = reader.ReadArray<uint>(5).Select(GameType.FromValue).ToArray(); Trace.Assert(version == kVersion); }
public void Deserialize(IPofReader reader) { var version = reader.ReadS32(0); IsEnabled = reader.ReadBoolean(1); Trace.Assert(version == kVersion, "version == kVersion"); }
public void Deserialize(IPofReader reader) { MobileId = reader.ReadS32(0); X = reader.ReadS32(1); Y = reader.ReadS32(2); IsStartOfGame = reader.ReadBoolean(3); }
public void Deserialize(IPofReader reader) { var version = reader.ReadS32(0); category = LeagueModificationCategory.FromValue(reader.ReadU32(1)); Trace.Assert(version == kVersion, $"Unexpected {nameof(LeagueMetadataComponent)} kVersion {version} expected {kVersion}!"); }
public void Deserialize(IPofReader reader) { packetId = reader.ReadS32(0); leftX = reader.ReadFloat(1); leftY = reader.ReadFloat(2); rightX = reader.ReadFloat(3); rightY = reader.ReadFloat(4); leftTrigger = reader.ReadFloat(5); rightTrigger = reader.ReadFloat(6); buttons = reader.ReadArray<bool>(7); }
/// <summary> /// Deserialize a user type instance from a POF stream by reading its /// state using the specified <see cref="IPofReader"/> object. /// </summary> /// <remarks> /// An implementation of <b>IPofSerializer</b> is required to follow /// the following steps in sequence for reading in an object of a /// user type: /// <list type="number"> /// <item> /// <description> /// If the object is evolvable, the implementation must get the /// version by calling <see cref="IPofWriter.VersionId"/>. /// </description> /// </item> /// <item> /// <description> /// The implementation may read any combination of the /// properties of the user type by using "read" methods of the /// <b>IPofReader</b>, but it must do so in the order of the property /// indexes. /// </description> /// </item> /// <item> /// <description> /// After all desired properties of the user type have been read, /// the implementation must terminate the reading of the user type by /// calling <see cref="IPofReader.ReadRemainder"/>. /// </description> /// </item> /// </list> /// </remarks> /// <param name="reader"> /// The <b>IPofReader</b> with which to read the object's state. /// </param> /// <returns> /// The deserialized user type instance. /// </returns> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public object Deserialize(IPofReader reader) { IList identities = (IList)reader.ReadCollection(0, new ArrayList(1)); reader.ReadRemainder(); IPrincipal principal = null; if (identities.Count > 0) { IIdentity identity = (IIdentity)identities[0]; principal = new SimplePrincipal(identity, null); reader.RegisterIdentity(principal); } return(principal); }
/// <summary> /// Deserialize an enum instance from a POF stream by reading its /// value using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> with which to read the object's state. /// </param> /// <returns> /// The deserialized enum instance. /// </returns> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public object Deserialize(IPofReader reader) { IPofContext pofContext = reader.PofContext; Type enumType = pofContext.GetType(reader.UserTypeId); if (!enumType.IsEnum) { throw new ArgumentException( "EnumPofSerializer can only be used to deserialize enum types."); } object enumValue = Enum.Parse(enumType, reader.ReadString(0)); reader.RegisterIdentity(enumValue); reader.ReadRemainder(); return(enumValue); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public void ReadExternal(IPofReader reader) { // note: this public method must not call ensureConstructed() if (m_hash != 0) { // an attempt was made to change a UUID -- which is an immutable // object -- by deserializing into it! throw new InvalidOperationException(); } m_dateTime = DateTimeUtils.GetTimeMillisFromEpochBasedTime(reader.ReadInt64(0)); m_addr1 = reader.ReadInt32(1); m_addr2 = reader.ReadInt32(2); m_addr3 = reader.ReadInt32(3); m_addr4 = reader.ReadInt32(4); m_port = reader.ReadInt32(5); m_count = reader.ReadInt32(6); InitHashcode(); }
/// <summary> /// Deserialize a user type instance from a POF stream by reading its /// state using the specified <see cref="IPofReader"/> object. /// </summary> /// <remarks> /// An implementation of <b>IPofSerializer</b> is required to follow /// the following steps in sequence for reading in an object of a /// user type: /// <list type="number"> /// <item> /// <description> /// If the object is evolvable, the implementation must get the /// version by calling <see cref="IPofWriter.VersionId"/>. /// </description> /// </item> /// <item> /// <description> /// The implementation may read any combination of the /// properties of the user type by using "read" methods of the /// <b>IPofReader</b>, but it must do so in the order of the property /// indexes. /// </description> /// </item> /// <item> /// <description> /// After all desired properties of the user type have been read, /// the implementation must terminate the reading of the user type by /// calling <see cref="IPofReader.ReadRemainder"/>. /// </description> /// </item> /// </list> /// </remarks> /// <param name="reader"> /// The <b>IPofReader</b> with which to read the object's state. /// </param> /// <returns> /// The deserialized user type instance. /// </returns> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public Object Deserialize(IPofReader reader) { String typeName = reader.ReadString(0); Binary bin = reader.ReadBinary(1); reader.ReadRemainder(); ConfigurablePofContext ctx = m_pofContext; IPortableObject po; try { po = (IPortableObject)ObjectUtils.CreateInstance(TypeResolver.Resolve(typeName)); } catch (Exception e) { throw new Exception("Unable to instantiate PortableObject class: " + typeName, e); } DataReader dataReader = bin.GetReader(); int nType = dataReader.ReadPackedInt32(); if (nType != TYPE_PORTABLE) { throw new IOException("Invalid POF type: " + nType + " (" + TYPE_PORTABLE + " expected)"); } int iVersion = dataReader.ReadPackedInt32(); IPofReader pofReader = new PofStreamReader.UserTypeReader( dataReader, ctx, TYPE_PORTABLE, iVersion); m_serializer.Initialize(po, pofReader); Register(typeName); return(po); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); EventType = (CacheEventType)reader.ReadInt32(0); int implVersion = ImplVersion; if (implVersion > 3) { FilterIds = reader.ReadInt64Array(1); } else { FilterId = reader.ReadInt64(1); } Key = reader.ReadObject(2); ValueNew = reader.ReadObject(3); ValueOld = reader.ReadObject(4); IsSynthetic = reader.ReadBoolean(5); // COH-9355 if (implVersion > 4) { TransformState = (CacheEventArgs.TransformationState)reader.ReadInt32(6); } // COH-13916 if (implVersion > 5) { IsTruncate = reader.ReadBoolean(7); } // COH-18376 if (implVersion > 6) { IsPriming = reader.ReadBoolean(8); } }
/// <summary> /// Initialize the specified (newly instantiated) PortableObject instance /// using the specified reader. /// </summary> /// <param name="portable">The object to initialize.</param> /// <param name="reader"> /// The PofReader with which to read the object's state. /// </param> public void Initialize(IPortableObject portable, IPofReader reader) { // set the version identifier bool isEvolvable = portable is IEvolvable; IEvolvable evolvable = null; if (isEvolvable) { evolvable = (IEvolvable)portable; evolvable.DataVersion = reader.VersionId; } // read the object's properties portable.ReadExternal(reader); // read any future properties Binary remainder = reader.ReadRemainder(); if (isEvolvable) { evolvable.FutureData = remainder; } }
public void Deserialize(IPofReader reader) { value = reader.ReadString(0); left = reader.ReadObject <Node>(1); right = reader.ReadObject <Node>(2); }
public void Deserialize(IPofReader reader) { Buffer = reader.ReadBytes(0); Offset = reader.ReadS32(1); Length = reader.ReadS32(2); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_isParallel = reader.ReadBoolean(0); m_extractor = (IValueExtractor)reader.ReadObject(1); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_filter = (IFilter)reader.ReadObject(0); m_value = reader.ReadObject(1); m_return = reader.ReadBoolean(2); }
public void Deserialize(IPofReader reader) { Type = reader.ReadString(0); Data = reader.ReadBytes(1); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_filter = (IFilter)reader.ReadObject(0); m_processor = (IEntryProcessor)reader.ReadObject(1); }
public void Deserialize(IPofReader reader) { internalList = reader.ReadCollection<Command, List<Command>>(0, true); }
public void TestString() { IPofReader pofReader = initPofReader("String"); Assert.AreEqual("coherence", pofReader.ReadString(0)); }
public void Deserialize(IPofReader reader) { value = reader.ReadString(0); }
protected abstract void Deserialize(IPofReader reader, int baseSlot);
protected override void Deserialize(IPofReader reader, int baseSlot) { Blocks = reader.ReadArray<PartitionBlockInterval>(baseSlot + 0); }
public void Deserialize(IPofReader reader) { StartBlockInclusive = reader.ReadU32(0); EndBlockExclusive = reader.ReadU32(1); }
public void Deserialize(IPofReader reader) { this.commandList = reader.ReadObject<CommandList>(0); this.initializationLatch.Signal(); }
protected override void Deserialize(IPofReader reader, int baseSlot) { EpochId = reader.ReadGuid(baseSlot + 0); OrderedParticipants = reader.ReadArray<Guid>(baseSlot + 1); }
public void Deserialize(IPofReader reader) { var version = reader.ReadS32(0); ServicePort = reader.ReadS32(1); Trace.Assert(version == kVersion, "version == kVersion"); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_aggregators = (IParallelAwareAggregator[])reader.ReadArray(0, EMPTY_AGGREGATOR_ARRAY); }
public void Deserialize(IPofReader reader) { processNames = reader.ReadCollection<string, HashSet<string>>(0); }
public void Deserialize(IPofReader reader) { Min = new Vector3(reader.ReadFloat(0), reader.ReadFloat(1), reader.ReadFloat(2)); Max = new Vector3(reader.ReadFloat(3), reader.ReadFloat(4), reader.ReadFloat(5)); }
public void Deserialize(IPofReader reader) { Id = reader.ReadGuid(0); Name = reader.ReadObject<string>(1); Version = reader.ReadObject<string>(2); }
public void Deserialize(IPofReader reader) { var version = reader.ReadS32(0); SelectedThumbnailPath = reader.ReadString(1); Trace.Assert(version == kVersion, "version == kVersion"); }
public void Deserialize(IPofReader reader) { blocks = reader.ReadMap<uint, object>(0); }
public void Deserialize(IPofReader reader) { OverridingEnabled = reader.ReadBoolean(0); }
public void Deserialize(IPofReader reader) { name = reader.ReadString(0); value = reader.ReadU32(1); }
protected override void Deserialize(IPofReader reader, int baseSlot) { Nominee = reader.ReadGuid(baseSlot + 0); Followers = reader.ReadCollection<Guid, ItzWarty.Collections.HashSet<Guid>>(baseSlot + 1); }
public void Deserialize(IPofReader reader) { Type = reader.ReadString(0); Data = reader.ReadBytes(1); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); m_comparer = (IComparer)reader.ReadObject(1); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public void ReadExternal(IPofReader reader) { m_navigator = (IPofNavigator)reader.ReadObject(0); }
/// <summary> /// Restore the contents of a AirDealComparer instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public void ReadExternal(IPofReader reader) { }
public void Deserialize(IPofReader reader) { cacheId = reader.ReadGuid(0); Deserialize(reader, 1); }
public void Deserialize(IPofReader reader) { OverridingEnabled = reader.ReadBoolean(0); }
public void Deserialize(IPofReader reader) { InjectionAttempts = reader.ReadS32(0); InjectionAttemptDelay = reader.ReadS32(1); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> /// <seealso cref="Request.ReadExternal"/> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); Map = reader.ReadDictionary(1, new HashDictionary()); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); Cause = (Exception)reader.ReadObject(0); }
public void Deserialize(IPofReader reader) { }
public void TestTime() { IPofReader pofReader = initPofReader("Time"); Assert.AreEqual(new RawTime(14, 49, 10, 0, false), pofReader.ReadRawTime(0)); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public abstract void ReadExternal(IPofReader reader);
public void Deserialize(IPofReader reader) { value = reader.ReadS32(0); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); Cookie = reader.ReadBinary(6); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_updater = (IValueUpdater)reader.ReadObject(0); m_value = reader.ReadObject(1); }
public void Deserialize(IPofReader reader) { commandList = reader.ReadObject<CommandList>(0); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public virtual void ReadExternal(IPofReader reader) { m_type = (QueryRecorder.RecordType)reader.ReadInt32(0); }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <remarks> /// This implementation reserves property index 10. /// </remarks> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); m_filter = (IIndexAwareFilter)reader.ReadObject(10); }
protected override void Deserialize(IPofReader reader, int baseSlot) { }
/// <summary> /// Restore the contents of a user type instance by reading its state /// using the specified <see cref="IPofReader"/> object. /// </summary> /// <param name="reader"> /// The <b>IPofReader</b> from which to read the object's state. /// </param> /// <exception cref="IOException"> /// If an I/O error occurs. /// </exception> /// <seealso cref="Request.ReadExternal"/> public override void ReadExternal(IPofReader reader) { base.ReadExternal(reader); IsTruncate = reader.ReadBoolean(1); }