Diffusion .NET API  5.9.24
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Data.IDataType< TValue > Interface Template Reference

Represents a data type that is specified for a particular value type. It provides methods to convert values to and from binary. Diffusion provides several IDataTypes implementations. More...

Inheritance diagram for PushTechnology.ClientInterface.Data.IDataType< TValue >:
PushTechnology.ClientInterface.Data.IDataType PushTechnology.ClientInterface.Data.Binary.IBinaryDataType PushTechnology.ClientInterface.Data.JSON.IJSONDataType

Public Member Functions

void WriteValue (TValue value, Stream outputStream)
 Serializes a value to binary. More...
 
new TValue ReadValue (byte[] input, int offset, int length)
 Parses a value from a binary data segment. More...
 
new TValue ReadValue (byte[] input)
 Parses a value from a binary. More...
 
new TValue ReadValue (IBytes bytes)
 Parses a value from binary. More...
 
void Validate (TValue value)
 Checks whether a value is valid. More...
 
IDeltaType< TValue, TDelta > DeltaType< TDelta > ()
 Returns a IDeltaType by type. More...
 
- Public Member Functions inherited from PushTechnology.ClientInterface.Data.IDataType
void WriteValue (object value, Stream outputStream)
 Serializes a value to binary. More...
 
void Validate (object value)
 Checks whether a value is valid. More...
 
IDeltaType DeltaType (string typeName)
 Returns a IDeltaType by name. More...
 
IDeltaType DeltaType (Type valueDeltaType)
 Returns a IDeltaType by type. More...
 

Additional Inherited Members

- Properties inherited from PushTechnology.ClientInterface.Data.IDataType
string TypeName [get]
 Returns the external type identifier. More...
 

Detailed Description

Represents a data type that is specified for a particular value type. It provides methods to convert values to and from binary. Diffusion provides several IDataTypes implementations.

This is a generic version of the IDataType interface that provides overloads for all object methods. It instead provides typed arguments and return values based on the given value type.

For more information about the data type interface, see

See Also
IDataType

.



Since 5.8

Template Parameters
TValueThe value type.

Member Function Documentation

IDeltaType<TValue, TDelta> PushTechnology.ClientInterface.Data.IDataType< TValue >.DeltaType< TDelta > ( )

Returns a IDeltaType by type.

Template Parameters
TDeltaThe delta value type.
Returns
The delta type.
Exceptions
ArgumentExceptionThis data type does not provide a IDeltaType for the given type or it provides more than one IDeltaType but none is preferred.
new TValue PushTechnology.ClientInterface.Data.IDataType< TValue >.ReadValue ( byte[]  input,
int  offset,
int  length 
)

Parses a value from a binary data segment.

Parameters
inputThe binary data. The implementation may re-use the array to avoid copying. The caller must ensure the array is not modified.
offsetThe starting index of the data segment.
lengthThe length of the data segment.
Returns
The value.

Implements PushTechnology.ClientInterface.Data.IDataType.

new TValue PushTechnology.ClientInterface.Data.IDataType< TValue >.ReadValue ( byte[]  input)

Parses a value from a binary.

This is equivalent to ReadValue(input,0,input.Length).

Parameters
inputThe binary data. The implementation may re-use the array to avoid copying. The caller must ensure the array is not modified.
Returns
The value.

Implements PushTechnology.ClientInterface.Data.IDataType.

new TValue PushTechnology.ClientInterface.Data.IDataType< TValue >.ReadValue ( IBytes  bytes)

Parses a value from binary.

This is equivalent to ReadValue(bytes.ToByteArray()).

Parameters
bytesThe binary data.
Returns
The value.

Implements PushTechnology.ClientInterface.Data.IDataType.

void PushTechnology.ClientInterface.Data.IDataType< TValue >.Validate ( TValue  value)

Checks whether a value is valid.

A DataType implementation is not required to check the binary data supplied to ReadValue(byte[],int,int). This method can be used the check the value at a later time.

Parameters
valueThe value to check for validity.
Exceptions
InvalidDataExceptionThe given value is invalid.
void PushTechnology.ClientInterface.Data.IDataType< TValue >.WriteValue ( TValue  value,
Stream  outputStream 
)

Serializes a value to binary.

Parameters
valueThe value.
outputStreamThe output stream.

The documentation for this interface was generated from the following file: