DOFType ClassOpenDOF Object Access Library
This base class defines common functionality for all types that can be used by the OAL, and provides a base implementation for most of that functionality.
Inheritance Hierarchy

SystemObject
  org.opendof.core.oalDOFType
    More...

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
[SerializableAttribute]
public abstract class DOFType : DOFImmutable

The DOFType type exposes the following members.

Constructors

  NameDescription
Protected methodDOFType(Int16)
Construct a base type object using the specified type identifier.
Protected methodDOFType(DOFPacket)
Construct a type from the data read from the wire.
Top
Methods

  NameDescription
Public methodStatic memberasBoolean
Returns the result's value as a boolean.
Public methodStatic memberasByte
Returns the result's value as an unsigned byte.
Public methodStatic memberasBytes
Returns the result's value as a byte array.
Public methodStatic memberasDate
Returns the result's value as a Date.
Public methodStatic memberasDOFInterfaceID
Returns the result's value as a DOFInterfaceID.
Public methodStatic memberasDOFObjectID
Returns the result's value as a DOFObjectID.
Public methodStatic memberasDouble
Returns the result's value as a double.
Public methodStatic memberasFloat
Returns the result's value as a float.
Public methodStatic memberasInt
Returns the result's value as an int.
Public methodStatic memberasLong
Returns the result's value as a Long.
Public methodStatic memberasSByte
Returns the result's value as an sbyte.
Public methodStatic memberasShort
Returns the result's value as a short.
Public methodStatic memberasString
Returns the result's value as a String.
Public methodStatic memberasUInt
Returns the result's value as a uint.
Public methodStatic memberasULong
Returns the result's value as a ulong.
Public methodStatic memberasUShort
Returns the result's value as a ushort.
Protected methoddataAvailable
Return whether the type has more data available.
Public methodEquals
Return whether two types are equal.
(Overrides ObjectEquals(Object).)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic membergetCharSet
Return a Java encoding string based on a MIB enum assignment.
Public methodgetEncoding
Get the string encoding for the type.
Public methodGetHashCode
Return a hash code for the type.
(Overrides ObjectGetHashCode.)
Public methodgetInstance
Create a DOFValue instance from a DOFPacket .

When called the current buffer location will point at the first byte of data associated with the type. On completion, the buffer location must point at the first byte after the data, meaning the first unread byte.

Public methodgetMaxLength
Get the maximum length of the type.
Public methodgetMinLength
Get the minimum length of the type.
Public methodgetSubtypes
Return a list of subtypes associated with this type.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodgetTypeID
Get the type identifier of this type.
Public methodStatic memberisCompatibleWith
Check for compatibility between a type and a value, properly handling the case where the value is
null
.
Public methodisDefined
Return whether of not the type is fully defined.
Public methodmarshal(DOFTypeContext, DOFPacket)
Marshal, or output a binary representation of this type, into the specified packet.
Public methodStatic membermarshal(DOFType, DOFValue, DOFPacket)
Write a DOFValue to a buffer, handling the case where the value is null.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodstartLength
Define the ending point of the data associated with a type.
Public methodToString
Returns a description of the type.
(Overrides ObjectToString.)
Protected methodvalidateLength
Verify that the data length for a type matched the data read for the type.
Top
Fields

  NameDescription
Public fieldStatic memberARRAY
The type identifier for an array.
Public fieldStatic memberBLOB
The type identifier for a binary large object.
Public fieldStatic memberBOOLEAN
The type identifier for a boolean.
Public fieldStatic memberDATETIME
The type identifier for a coordinated universal time (UTC).
Public fieldStatic memberFLOAT32
The type identifier for a single-precision float.
Public fieldStatic memberFLOAT64
The type identifier for a double-precision float.
Public fieldStatic memberGUID
The type identifier for a 16 byte globally unique identifier.
Public fieldStatic memberINT16
The type identifier for a signed short.
Public fieldStatic memberINT32
The type identifier for a signed integer.
Public fieldStatic memberINT64
The type identifier for a signed 64-bit integer.
Public fieldStatic memberINT8
The type identifier for a signed byte.
Public fieldStatic memberINTERFACEID
The type identifier for a DOF Interface Identifier.
Public fieldStatic memberNULLABLE
The type identifier for a nullable type.
Public fieldStatic memberOBJECTID
The type identifier for a DOF Object Identifier.
Public fieldStatic memberREFERENCE
The type identifier for a reference.
Public fieldStatic memberSTRING
The type identifier for a string.
Public fieldStatic memberSTRUCTURE
The type identifier for a structure.
Protected fieldtype
The type identifier.
Public fieldStatic memberUINT16
The type identifier for a unsigned short.
Public fieldStatic memberUINT32
The type identifier for a unsigned integer.
Public fieldStatic memberUINT64
The type identifier for a unsigned 64-bit integer.
Public fieldStatic memberUINT8
The type identifier for a unsigned byte.
Top
Remarks

This base class defines common functionality for all types that can be used by the OAL, and provides a base implementation for most of that functionality. Types are associated with all DOFValue implementations, and are used by themselves in some routines (see DOFInterface ).

Types in the OAL are immutable. This means that once completely defined they must not change. Note the wording of "once completely defined", and see the documentation for isDefined() and Typedef.defineAs(DOFType) .

Classes that extend DOFType do at least the following: 1) represent a given DOF type, as defined by the DOF Protocol Specification; and 2) represent a given implementation of values of that type, which they are linked to through the getInstance(DOFPacket) method.

The linkage between a DOFType implementation and a DOFValue implementation is always one-to-one. The getInstance(DOFPacket) method returns a DOFValue , and the DOFValue.getDOFType() method returns the original DOFType.

Classes that extend DOFType must be able to write and read their types to a DOFPacket . This requires that they follow the specification for their type.

This last requirement means that the easiest way to define a new type is by extending an existing type. In this case, only the getInstance(DOFPacket) call must be overridden (and it must be overridden to preserve the one-to-one association of type to value).

See Also

Reference

Inheritance Hierarchy

SystemObject
  org.opendof.core.oalDOFType
    org.opendof.core.oalDOFInterfaceIDType
    org.opendof.core.oalDOFObjectIDType
    org.opendof.core.oalDOFTypeNullable
    org.opendof.core.oalDOFTypeTypedef
    org.opendof.core.oal.valueDatalessType
    org.opendof.core.oal.valueDOFArrayType
    org.opendof.core.oal.valueDOFBlobType
    org.opendof.core.oal.valueDOFStringType
    org.opendof.core.oal.valueDOFStructureType