Class AbstractPofValue
An abstract base class that implements common functionality for all IPofValue types.
Implements
Inherited Members
Namespace: Tangosol.IO.Pof.Reflection
Assembly: Coherence.dll
Syntax
public abstract class AbstractPofValue : IPofValue
Constructors
AbstractPofValue(IPofValue, Binary, IPofContext, int, int)
Construct a PofValue instance wrapping the supplied binary.
Declaration
protected AbstractPofValue(IPofValue valueParent, Binary binValue, IPofContext ctx, int of, int nType)
Parameters
Type | Name | Description |
---|---|---|
IPofValue | valueParent | Parent value within the POF stream. |
Binary | binValue | Binary representation of this value. |
IPofContext | ctx | POF context to use when reading or writing properties. |
int | of | Offset of this value from the beginning of POF stream. |
int | nType | POF type identifier for this value. |
Fields
m_nType
POF type identifer of this value.
Declaration
protected int m_nType
Field Value
Type | Description |
---|---|
int |
m_oValue
Deserialized representation of this value.
Declaration
protected object m_oValue
Field Value
Type | Description |
---|---|
object |
Properties
BinaryValue
Return binary representation of this value.
Declaration
protected virtual Binary BinaryValue { get; }
Property Value
Type | Description |
---|---|
Binary | Binary representation of this value. |
DirtyBytesCount
Get the estimated number of dirty bytes in this POF value hierarchy.
Declaration
protected virtual int DirtyBytesCount { get; }
Property Value
Type | Description |
---|---|
int | The number of dirty bytes. |
IsDirty
Return true
if this value has been modified,
false
otherwise.
Declaration
public virtual bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
|
IsRoot
Return true
if this instance is the root of the IPofValue
hierarchy.
Declaration
protected virtual bool IsRoot { get; }
Property Value
Type | Description |
---|---|
bool |
|
IsUniformEncoded
Return true
if the buffer contains only the value, without
the type identifier.
Declaration
protected virtual bool IsUniformEncoded { get; }
Property Value
Type | Description |
---|---|
bool |
|
Offset
Return the offset of this value from the beginning of POF stream.
Declaration
public virtual int Offset { get; }
Property Value
Type | Description |
---|---|
int | The offset of this value from the beginning of POF stream. |
Parent
Return the parent of this value.
Declaration
public virtual IPofValue Parent { get; }
Property Value
Type | Description |
---|---|
IPofValue | The parent value, or |
PofContext
Return the POF context to use for serialization and deserialization.
Declaration
public virtual IPofContext PofContext { get; }
Property Value
Type | Description |
---|---|
IPofContext | The POF context. |
Root
Return the root of the hierarchy this value belongs to.
Declaration
public virtual IPofValue Root { get; }
Property Value
Type | Description |
---|---|
IPofValue | The root value. |
Size
Return the size of the encoded value in bytes.
Declaration
public virtual int Size { get; }
Property Value
Type | Description |
---|---|
int | The size of the encoded value. |
TypeId
Obtain the POF type identifier for this value.
Declaration
public virtual int TypeId { get; }
Property Value
Type | Description |
---|---|
int | POF type identifier for this value. |
Methods
ApplyChanges()
Apply all the changes that were made to this value and return a binary representation of the new value.
Declaration
public virtual Binary ApplyChanges()
Returns
Type | Description |
---|---|
Binary | New Binary object that contains modified PofValue. |
Remarks
Any format prefixes and/or decorations that were present in the original buffer this value orginated from will be preserved.
Note: This method can only be called on the root PofValue.Exceptions
Type | Condition |
---|---|
NotSupportedException | If called on a non-root PofValue. |
EnsureReferenceRegistry()
Obtain the registry for identity-reference pairs, creating it if necessary.
Declaration
protected virtual ILongArray EnsureReferenceRegistry()
Returns
Type | Description |
---|---|
ILongArray | The identity-reference registry, never |
GetBoolean()
Return the Boolean which this IPofValue represents.
Declaration
public virtual bool GetBoolean()
Returns
Type | Description |
---|---|
bool | The Boolean value. |
GetBooleanArray()
Return the Boolean[] which this IPofValue represents.
Declaration
public virtual bool[] GetBooleanArray()
Returns
Type | Description |
---|---|
bool[] | The Boolean[] value. |
GetByte()
Return the Byte which this IPofValue represents.
Declaration
public virtual byte GetByte()
Returns
Type | Description |
---|---|
byte | The Byte value. |
GetByteArray()
Return the Byte[] which this IPofValue represents.
Declaration
public virtual byte[] GetByteArray()
Returns
Type | Description |
---|---|
byte[] | The Byte[] value. |
GetChanges()
Return a binary containing changes made to this IPofValue in the format defined by the BinaryDeltaCompressor.
Declaration
public virtual Binary GetChanges()
Returns
Type | Description |
---|---|
Binary | A binary containing changes made to this IPofValue. |
Remarks
Note: This method can only be called on the root IPofValue.
Exceptions
Type | Condition |
---|---|
NotSupportedException | If called on a non-root IPofValue. |
GetChar()
Return the Char which this IPofValue represents.
Declaration
public virtual char GetChar()
Returns
Type | Description |
---|---|
char | The Char value. |
GetCharArray()
Return the Char[] which this IPofValue represents.
Declaration
public virtual char[] GetCharArray()
Returns
Type | Description |
---|---|
char[] | The Char[] value. |
GetChild(int)
Locate a child IPofValue contained within this IPofValue.
Declaration
public abstract IPofValue GetChild(int nIndex)
Parameters
Type | Name | Description |
---|---|---|
int | nIndex | The index of the child value. |
Returns
Type | Description |
---|---|
IPofValue | The child IPofValue. |
Remarks
The returned IPofValue could represent a non-existent (null) value.
Exceptions
Type | Condition |
---|---|
PofNavigationException | If this value is a "terminal" or the child value cannot be located for any other reason. |
GetCollection(ICollection)
Return an ICollection of object values which this IPofValue represents.
Declaration
public virtual ICollection GetCollection(ICollection coll)
Parameters
Type | Name | Description |
---|---|---|
ICollection | coll | The optional ICollection to use to store the values. |
Returns
Type | Description |
---|---|
ICollection | An ICollection of object values. |
GetCollection<T>(ICollection<T>)
Return an ICollection<T> of object values which this IPofValue represents.
Declaration
public virtual ICollection<T> GetCollection<T>(ICollection<T> coll)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | coll | The optional ICollection<T> to use to store the values. |
Returns
Type | Description |
---|---|
ICollection<T> | An ICollection<T> of object values. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the collection. |
GetDate()
Return the DateTime which this IPofValue represents.
Declaration
public virtual DateTime GetDate()
Returns
Type | Description |
---|---|
DateTime | The DateTime value. |
Remarks
This method will return only the date component. It will ignore the time component if present and initialize the time-related fields of the return value to their default values.
GetDateTime()
Return the DateTime which this IPofValue represents.
Declaration
public virtual DateTime GetDateTime()
Returns
Type | Description |
---|---|
DateTime | The DateTime value. |
GetDayTimeInterval()
Return the TimeSpan which this IPofValue represents.
Declaration
public virtual TimeSpan GetDayTimeInterval()
Returns
Type | Description |
---|---|
TimeSpan | The TimeSpan value. |
GetDecimal()
Return the Decimal which this IPofValue represents.
Declaration
public virtual decimal GetDecimal()
Returns
Type | Description |
---|---|
decimal | The Decimal value. |
GetDictionary(IDictionary)
Return an IDictionary of key/value pairs which this IPofValue represents.
Declaration
public virtual IDictionary GetDictionary(IDictionary dict)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | dict | The optional IDictionary to use to store the key/value pairs. |
Returns
Type | Description |
---|---|
IDictionary | An IDictionary of key/value pairs. |
GetDictionary<TKey, TValue>(IDictionary<TKey, TValue>)
Read an IDictionar<TKey, TValue>y of key/value pairs which this IPofValue represents.
Declaration
public virtual IDictionary<TKey, TValue> GetDictionary<TKey, TValue>(IDictionary<TKey, TValue> dict)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<TKey, TValue> | dict | The optional IDictionary<TKey, TValue> use to store the key/value pairs. |
Returns
Type | Description |
---|---|
IDictionary<TKey, TValue> | An IDictionary<TKey, TValue> of key/value pairs. |
Type Parameters
Name | Description |
---|---|
TKey | The key type of the IDictionary<TKey, TValue>. |
TValue | The value type of the IDictionary<TKey, TValue>. |
GetDouble()
Return the Double which this IPofValue represents.
Declaration
public virtual double GetDouble()
Returns
Type | Description |
---|---|
double | The Double value. |
GetDoubleArray()
Return the Double[] which this IPofValue represents.
Declaration
public virtual double[] GetDoubleArray()
Returns
Type | Description |
---|---|
double[] | The Double[] value. |
GetInt16()
Return the Int16 which this IPofValue represents.
Declaration
public virtual short GetInt16()
Returns
Type | Description |
---|---|
short | The Int16 value. |
GetInt16Array()
Return the Int16[] which this IPofValue represents.
Declaration
public virtual short[] GetInt16Array()
Returns
Type | Description |
---|---|
short[] | The Int16[] value. |
GetInt32()
Return the Int32 which this IPofValue represents.
Declaration
public virtual int GetInt32()
Returns
Type | Description |
---|---|
int | The Int32 value. |
GetInt32Array()
Return the Int32[] which this IPofValue represents.
Declaration
public virtual int[] GetInt32Array()
Returns
Type | Description |
---|---|
int[] | The Int32[] value. |
GetInt64()
Return the Int64 which this IPofValue represents.
Declaration
public virtual long GetInt64()
Returns
Type | Description |
---|---|
long | The Int64 value. |
GetInt64Array()
Return the Int64[] which this IPofValue represents.
Declaration
public virtual long[] GetInt64Array()
Returns
Type | Description |
---|---|
long[] | The Int64[] value. |
GetSerializedValue()
Return this value's serialized form.
Declaration
public virtual Binary GetSerializedValue()
Returns
Type | Description |
---|---|
Binary | This value's serialized form. |
GetSingle()
Return the Single which this IPofValue represents.
Declaration
public virtual float GetSingle()
Returns
Type | Description |
---|---|
float | The Single value. |
GetSingleArray()
Return the Single[] which this IPofValue represents.
Declaration
public virtual float[] GetSingleArray()
Returns
Type | Description |
---|---|
float[] | The Single[] value. |
GetString()
Return the String which this IPofValue represents.
Declaration
public virtual string GetString()
Returns
Type | Description |
---|---|
string | The String value. |
GetValue()
Return the deserialized value which this IPofValue represents.
Declaration
public virtual object GetValue()
Returns
Type | Description |
---|---|
object | The deserialized value. |
GetValue(int)
Return the deserialized value which this IPofValue represents.
Declaration
public virtual object GetValue(int typeId)
Parameters
Type | Name | Description |
---|---|---|
int | typeId | The required Pof type of the returned value or T_UNKNOWN if the type is to be inferred from the serialized state. |
Returns
Type | Description |
---|---|
object | The deserialized value. |
Exceptions
Type | Condition |
---|---|
InvalidCastException | If the value is incompatible with the specified type. |
GetValue(Type)
Return the deserialized value which this IPofValue represents.
Declaration
public virtual object GetValue(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The required type of the returned value or |
Returns
Type | Description |
---|---|
object | The deserialized value. |
Exceptions
Type | Condition |
---|---|
InvalidCastException | If the value is incompatible with the specified type. |
IncrementDirtyBytesCount(int)
Increment the counter representing the estimated number of bytes in the original buffer that have been modified.
Declaration
protected virtual void IncrementDirtyBytesCount(int cb)
Parameters
Type | Name | Description |
---|---|---|
int | cb | The number of bytes to increment counter for. |
IncrementDirtyValuesCount()
Increment the counter representing the number of values within this POF hierarchy that have been modified.
Declaration
protected virtual void IncrementDirtyValuesCount()
LookupIdentity(int)
Look up the specified identity and return the object to which it refers.
Declaration
protected IPofValue LookupIdentity(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | The identity. |
Returns
Type | Description |
---|---|
IPofValue | The object registered under that identity. |
Exceptions
Type | Condition |
---|---|
IOException | If the requested identity is not registered. |
RegisterIdentity(int, object)
Register the passed value with the passed identity.
Declaration
protected void RegisterIdentity(int id, object value)
Parameters
Type | Name | Description |
---|---|---|
int | id | The identity. |
object | value | The object registerd under the passed identity. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If the specified identity is already registered with a different object. |
SetDirty()
Set the dirty flag for this value.
Declaration
protected virtual void SetDirty()
SetUniformEncoded()
Specifies that the buffer contains only a value, without a type identifier.
Declaration
protected virtual void SetUniformEncoded()
SetValue(object)
Update this PofValue.
Declaration
public virtual void SetValue(object oValue)
Parameters
Type | Name | Description |
---|---|---|
object | oValue | New deserialized value for this IPofValue. |
Remarks
The changes made using this method will be immediately reflected in the result of GetValue() method, but will not be applied to the underlying POF stream until the ApplyChanges() method is invoked on the root IPofValue.