MsgPack.MessagePackExtendedTypeObject Struct Reference

Represents Message Pack extended type object. More...

Inherits IEquatable< MessagePackExtendedTypeObject >.

Public Member Functions

byte[] GetBody ()
 Gets a copy of the binary value portion of this object. More...
 
 MessagePackExtendedTypeObject (byte typeCode, byte[] body)
 Initializes a new instance of the MessagePackExtendedTypeObject struct. More...
 
override string ToString ()
 Returns a System.String that represents this instance. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
override bool Equals (object obj)
 Determines whether the specified System.Object is equal to this instance. More...
 
bool Equals (MessagePackExtendedTypeObject other)
 Determines whether the specified MessagePackExtendedTypeObject is equal to this instance. More...
 

Static Public Member Functions

static MessagePackExtendedTypeObject Unpack (byte typeCode, byte[] body)
 Creates a new instance of the MessagePackExtendedTypeObject struct. More...
 
static bool operator== (MessagePackExtendedTypeObject left, MessagePackExtendedTypeObject right)
 Determines whether the specified MessagePackExtendedTypeObjects are equal. More...
 
static bool operator!= (MessagePackExtendedTypeObject left, MessagePackExtendedTypeObject right)
 Determines whether the specified MessagePackExtendedTypeObjects are not equal. More...
 

Properties

byte TypeCode [get]
 Gets a type code of this object. More...
 
bool IsValid [get]
 Gets a value indicating whether this instance is valid. More...
 

Detailed Description

Represents Message Pack extended type object.

Constructor & Destructor Documentation

◆ MessagePackExtendedTypeObject()

MsgPack.MessagePackExtendedTypeObject.MessagePackExtendedTypeObject ( byte  typeCode,
byte[]  body 
)

Initializes a new instance of the MessagePackExtendedTypeObject struct.

Parameters
typeCodeA type code of this extension object.
bodyA binary value portion.
Exceptions
System.ArgumentExceptionThe typeCode is over 127. Higher values are reserved for MessagePack format specification.
System.ArgumentNullExceptionThe body is null.

Member Function Documentation

◆ Equals() [1/2]

bool MsgPack.MessagePackExtendedTypeObject.Equals ( MessagePackExtendedTypeObject  other)

Determines whether the specified MessagePackExtendedTypeObject is equal to this instance.

Parameters
otherThe MessagePackExtendedTypeObject to compare with this instance.
Returns
true if the specified MessagePackExtendedTypeObject is equal to this instance; otherwise, false.

◆ Equals() [2/2]

override bool MsgPack.MessagePackExtendedTypeObject.Equals ( object  obj)

Determines whether the specified System.Object is equal to this instance.

Parameters
objThe System.Object to compare with this instance.
Returns
true if the specified System.Object is equal to this instance; otherwise, false.

◆ GetBody()

byte [] MsgPack.MessagePackExtendedTypeObject.GetBody ( )

Gets a copy of the binary value portion of this object.

A copy of the binary value portion of this object. This value will not be null.

◆ GetHashCode()

override int MsgPack.MessagePackExtendedTypeObject.GetHashCode ( )

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ operator!=()

static bool MsgPack.MessagePackExtendedTypeObject.operator!= ( MessagePackExtendedTypeObject  left,
MessagePackExtendedTypeObject  right 
)
static

Determines whether the specified MessagePackExtendedTypeObjects are not equal.

Parameters
leftA MessagePackExtendedTypeObject.
rightA MessagePackExtendedTypeObject.
Returns
true if the specified MessagePackExtendedTypeObjects are not equal; otherwise, false.

◆ operator==()

static bool MsgPack.MessagePackExtendedTypeObject.operator== ( MessagePackExtendedTypeObject  left,
MessagePackExtendedTypeObject  right 
)
static

Determines whether the specified MessagePackExtendedTypeObjects are equal.

Parameters
leftA MessagePackExtendedTypeObject.
rightA MessagePackExtendedTypeObject.
Returns
true if the specified MessagePackExtendedTypeObjects are equal; otherwise, false.

◆ ToString()

override string MsgPack.MessagePackExtendedTypeObject.ToString ( )

Returns a System.String that represents this instance.

Returns
A System.String that represents this instance.

◆ Unpack()

static MessagePackExtendedTypeObject MsgPack.MessagePackExtendedTypeObject.Unpack ( byte  typeCode,
byte[]  body 
)
static

Creates a new instance of the MessagePackExtendedTypeObject struct.

Parameters
typeCodeA type code of this extension object.
bodyA binary value portion.
Exceptions
System.ArgumentNullExceptionThe body is null.

This method allows reserved type code. It means that this method does not throw exception when the typeCode is reserved value (greater then 0x7F).

Property Documentation

◆ IsValid

bool MsgPack.MessagePackExtendedTypeObject.IsValid
get

Gets a value indicating whether this instance is valid.

true if this instance is valid; otherwise, false.

◆ TypeCode

byte MsgPack.MessagePackExtendedTypeObject.TypeCode
get

Gets a type code of this object.

A type code. Note that values over SByte.MaxValue are reserved for MsgPack spec itself.


The documentation for this struct was generated from the following file:
  • MsgPackSources/MessagePackExtendedTypeObject.cs