/// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(0, ChannelId);
            writer.WriteObject(1, Cause);
        }
Exemple #2
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteBoolean(0, IsParallel);
     writer.WriteObject(1, Extractor);
     writer.WriteObject(2, Comparer);
     writer.WriteInt32(3, Results);
 }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteString(0, type);
     writer.WriteString(1, message);
     writer.WriteObject(2, stackTrace);
     writer.WriteObject(3, innerException);
 }
Exemple #4
0
            public void Serialize(IPofWriter writer)
            {
                int i = 0;

                writer.WriteObject(i++, key);
                writer.WriteObject(i++, value);
                writer.WriteBoolean(i++, isPresent);
            }
 public void Serialize(IPofWriter writer)
 {
     writer.WriteU32(0, invocationId);
     writer.WriteGuid(1, serviceGuid);
     writer.WriteString(2, methodName);
     writer.WriteObject(3, genericArguments);
     writer.WriteObject(4, methodArguments);
 }
Exemple #6
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(2, KeysOnly);
            writer.WriteBinary(3, Cookie);
            writer.WriteObject(4, FilterCookie);
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteBoolean(1, Add);
            writer.WriteObject(2, Extractor);
            writer.WriteBoolean(3, IsOrdered);
            writer.WriteObject(4, Comparer);
        }
Exemple #8
0
            public void Serialize(IPofWriter pofWriter, object o)
            {
                var c = (Customer)o;

                pofWriter.WriteString(0, c.getName());
                pofWriter.WriteObject(1, c.getProduct());
                pofWriter.WriteObject(2, c.getBalance());
                pofWriter.WriteRemainder(null);
            }
Exemple #9
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_filter);
     writer.WriteInt32(1, m_pageSize);
     writer.WriteInt32(2, m_page);
     writer.WriteObject(3, m_comparer);
     writer.WriteObject(4, m_anchorTop);
     writer.WriteObject(5, m_anchorBottom);
 }
 /// <see cref="IPortableObject"/>
 void IPortableObject.WriteExternal(IPofWriter writer)
 {
     writer.WriteString(FIRST_NAME, m_firstName);
     writer.WriteString(LAST_NAME, m_lastName);
     writer.WriteObject(HOME_ADDRESS, m_addrHome);
     writer.WriteObject(WORK_ADDRESS, m_addrWork);
     writer.WriteDictionary(PHONE_NUMBERS, m_dictPhoneNumber,
                            typeof(string), typeof(PhoneNumber));
     writer.WriteDate(BIRTH_DATE, m_dtBirth);
 }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            // COH-6337
            if (ImplVersion > 2)
            {
                writer.WriteObject(7, Filter);
                writer.WriteObject(8, FilterCookie);
            }
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing
        /// its state using the specified <see cref="IPofWriter"/>
        /// object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's
        /// state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(1, ClientId);
            writer.WriteInt32(2, Edition);
            writer.WriteDictionary(3, ProtocolVersionMap, typeof(string), typeof(Int32[]));
            writer.WriteByteArray(4, IdentityToken);
            writer.WriteObject(5, Member);
            writer.WriteString(6, ClusterName);
            writer.WriteString(7, ServiceName);
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt64(0, RequestId);
            writer.WriteBoolean(1, IsFailure);

            ResultFormatType format = ResultFormat;

            writer.WriteInt32(2, (int)format);

            switch (format)
            {
            default:
            case ResultFormatType.Generic:
                writer.WriteObject(3, Result);
                break;

            case ResultFormatType.Collection:
                writer.WriteCollection(4, (ICollection)Result);
                break;

            case ResultFormatType.Map:
                writer.WriteDictionary(5, (IDictionary)Result);
                break;
            }
        }
        /// <summary>
        /// Serialize a user type instance to a POF stream by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <remarks>
        /// An implementation of <b>IPofSerializer</b> is required to follow
        /// the following steps in sequence for writing out an object of a
        /// user type:
        /// <list type="number">
        /// <item>
        /// <description>
        /// The implementation may write any combination of the properties of
        /// the user type by using the "write" methods of the
        /// <b>IPofWriter</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 written,
        /// the implementation must terminate the writing of the user type by
        /// calling <see cref="IPofWriter.WriteRemainder"/>.
        /// </description>
        /// </item>
        /// </list>
        /// </remarks>
        /// <param name="writer">
        /// The <b>IPofWriter</b> with which to write the object's state.
        /// </param>
        /// <param name="o">
        /// The object to serialize.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public void Serialize(IPofWriter writer, object o)
        {
            MemoryStream stream = new MemoryStream();

            try
            {
                new BinaryFormatter().Serialize(stream, o);

                stream.Position = 0;
                writer.WriteObject(0, stream.GetBuffer());
                writer.WriteRemainder(null);
            }
            catch (SerializationException e)
            {
                string typeName = null;
                try
                {
                    typeName = writer.PofContext.GetTypeName(m_typeId);
                }
                catch (Exception)
                { }

                string actual = o.GetType().FullName;
                throw new IOException(
                          "An exception occurred writing an object"
                          + " user type to a POF stream: type-id=" + m_typeId
                          + (typeName == null ? "" : ", class-name=" + typeName)
                          + (actual == null ? "" : ", actual class-name=" + actual)
                          + ", exception=\n" + e);
            }
            finally
            {
                stream.Close();
            }
        }
Exemple #15
0
            public void Serialize(IPofWriter pofWriter, object o)
            {
                var p = (Product)o;

                pofWriter.WriteObject(0, p.getBalance());
                pofWriter.WriteRemainder(null);
            }
        public void WriteExternal(IPofWriter writer)
        {
            writer.WriteInt32(0, INTEGER);

            IPofWriter nested1 = writer.CreateNestedPofWriter(1);

            IPofWriter nested2 = nested1.CreateNestedPofWriter(0);

            nested2.WriteString(0, STRING);
            nested2.WriteObject(1, PERSON);
            nested2.WriteDoubleArray(2, DOUBLE_ARRAY);

            IPofWriter nested3 = nested2.CreateNestedPofWriter(3);

            nested3.WriteArray(0, STRING_ARRAY, typeof(String));

            nested2.WriteBoolean(4, false);
            nested2.WriteRemainder(null);

            nested1.WriteCollection(1, (ICollection <String>)set);
            nested1.WriteDouble(2, 2.0);
            nested1.WriteInt32(3, 5);
            nested1.WriteCollection(4, set, typeof(String));
            nested1.WriteObject(5, PERSON);
            nested1.WriteDouble(10, 2.222);

            writer.WriteDouble(2, 4.444);
            writer.WriteInt32(3, 15);
            writer.WriteObject(4, PERSON);
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(2, Processor);
            writer.WriteBinary(3, Cookie);
        }
Exemple #18
0
            public void Serialize(IPofWriter pofWriter, object o)
            {
                var bal = (Balance)o;

                pofWriter.WriteDouble(0, bal.getBalance());
                pofWriter.WriteObject(1, bal.getCustomer());
                pofWriter.WriteRemainder(null);
            }
Exemple #19
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public virtual void WriteExternal(IPofWriter writer)
        {
            writer.WriteInt32(0, (int)m_mask);
            writer.WriteObject(1, m_filter);

            // space left for MapEventFilter expansion
            writer.WriteInt32(10, (int)m_maskSynth);
        }
Exemple #20
0
            public void Serialize(IPofWriter writer)
            {
                int i = 0;

                writer.WriteObject(i++, key);
                writer.WriteS32(i++, level);
                writer.WriteArray(i++, friends.ToArray());
            }
Exemple #21
0
            public void Serialize(IPofWriter writer)
            {
                int i = 0;

                writer.WriteObject(i++, key);
                writer.WriteS32(i++, level);
                writer.WriteCollection(i++, friends);
            }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public virtual void WriteExternal(IPofWriter writer)
        {
            IValueExtractor extractorOld = m_extractorOld;
            IValueExtractor extractorNew = m_extractorNew;

            if (Equals(extractorOld, extractorNew))
            {
                writer.WriteBoolean(0, true);
                writer.WriteObject(1, extractorNew);
            }
            else
            {
                writer.WriteBoolean(0, false);
                writer.WriteObject(1, extractorOld);
                writer.WriteObject(2, extractorNew);
            }
        }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 public void WriteExternal(IPofWriter writer)
 {
     writer.WriteBoolean(0, IsPresent);
     if (IsPresent)
     {
         writer.WriteObject(1, m_value);
     }
 }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(1, Value);

            // release state
            Value = null;
        }
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_sFilter);
     writer.WriteInt32(1, m_nEfficiency);
     writer.WriteInt32(2, m_nSizeIn);
     writer.WriteInt32(3, m_nSizeOut);
     writer.WriteInt64(4, m_cMillis);
     writer.WriteCollection(5, m_setIndexLookupRecords);
     writer.WriteCollection(6, m_listSubSteps);
 }
Exemple #26
0
 /// <summary>
 /// Save the contents of a POF user type instance by writing its
 /// state using the specified <see cref="IPofWriter"/> object.
 /// </summary>
 /// <param name="writer">
 /// The <b>IPofWriter</b> to which to write the object's state.
 /// </param>
 /// <exception cref="IOException">
 /// If an I/O error occurs.
 /// </exception>
 public virtual void WriteExternal(IPofWriter writer)
 {
     writer.WriteObject(0, m_uuid);
     writer.WriteString(6, ClusterName);
     writer.WriteString(7, m_siteName);
     writer.WriteString(8, m_rackName);
     writer.WriteString(9, m_machineName);
     writer.WriteString(10, m_processName);
     writer.WriteString(11, m_memberName);
     writer.WriteString(12, m_roleName);
 }
Exemple #27
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteObject(2, Value);
            writer.WriteInt64(3, ExpiryDelay);
            writer.WriteBoolean(4, IsReturnRequired);

            // release state
            Value = null;
        }
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        /// <seealso cref="Request.WriteExternal"/>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteBoolean(2, Add);
            writer.WriteBoolean(3, IsLite);
            writer.WriteObject(4, Trigger);
            if (ImplVersion > 5)
            {
                writer.WriteBoolean(5, IsPriming);
            }
        }
Exemple #29
0
 public override void WriteExternal(IPofWriter writer)
 {
     if (writer.UserTypeId == 2)
     {
         writer.WriteString(0, Breed);
         writer.WriteObject(1, Color);
     }
     else
     {
         base.WriteExternal(writer);
     }
 }
Exemple #30
0
        /// <summary>
        /// Save the contents of a POF user type instance by writing its
        /// state using the specified <see cref="IPofWriter"/> object.
        /// </summary>
        /// <param name="writer">
        /// The <b>IPofWriter</b> to which to write the object's state.
        /// </param>
        /// <exception cref="IOException">
        /// If an I/O error occurs.
        /// </exception>
        public override void WriteExternal(IPofWriter writer)
        {
            base.WriteExternal(writer);

            writer.WriteInt32(0, (int)EventType);
            int implVersion = ImplVersion;

            if (implVersion > 3)
            {
                writer.WriteInt64Array(1, FilterIds);
            }
            else
            {
                writer.WriteInt64(1, FilterId);
            }
            writer.WriteObject(2, Key);
            writer.WriteObject(3, ValueNew);
            writer.WriteObject(4, ValueOld);
            writer.WriteBoolean(5, IsSynthetic);

            // COH-9355
            if (implVersion > 4)
            {
                writer.WriteInt32(6, (int)TransformState);
            }

            // COH-13916
            if (implVersion > 5)
            {
                writer.WriteBoolean(7, IsTruncate);
            }

            // COH-18376
            if (implVersion > 6)
            {
                writer.WriteBoolean(8, IsPriming);
            }
        }
 public void Serialize(IPofWriter writer) {
    writer.WriteObject(0, commandList);
 }
 public void Serialize(IPofWriter writer) {
    writer.WriteGuid(0, Id);
    writer.WriteObject(1, Name);
    writer.WriteObject(2, Version);
 }
 public void Serialize(IPofWriter writer) {
    Wait();
    writer.WriteObject(0, this.commandList);
 }