OpcDataTypeMemberLengthAttribute Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcDataTypeMemberLengthAttribute type exposes the following members.

OpcDataTypeMemberLengthAttribute(Int64)

Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a fixed length.

C#

public OpcDataTypeMemberLengthAttribute(long length)


Parameters

length Int64

The total number of instances within the stream of the custom data type of the member the attribute belongs to.


Exceptions

ArgumentOutOfRangeException

The length is less than zero.

OpcDataTypeMemberLengthAttribute(String)

Initializes a new instance of the OpcDataTypeMemberLengthAttribute class which declares a field or property with a variable length controlled by the value of a preceding field or property which can be identified by the name specified.

C#

public OpcDataTypeMemberLengthAttribute(string name)


Parameters

name String

The MemberInfo.Name or Name (if defined) of the preceding member its value is to be used to indicate the variable length of the member the attribute belongs to.


Exceptions

ArgumentException

The name is an empty string.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

Length

Gets the total number of instances within the stream of the custom data type of the member the attribute belongs to.

C#

public long Length { get; }


Property Value

Int64

The total number of instances within the stream. The default value is -1. In case there the value of the Length property is equals -1 the length of the field or property is variable and determined using the value of the field referenced by Name.

Name

Gets the name of the preceding member its value is to be evaluated to indicate the variable length of the member the attribute belongs to.

C#

public string Name { get; }


Property Value

String

The MemberInfo.Name or Name (if defined) of the preceding member or a null reference (Nothing in Visual Basic) in case there this OpcDataTypeMemberLengthAttribute uses a fixed Length to define the total number of instances within the stream.



Remarks

In case there Name referes to a field that is not present in an encoded value, then the default value for the length is 1. This situation can occur if the the field referenced is an optional field (see OpcDataTypeMemberSwitchAttribute).

The length field shall be a fixed length Base-2 representation of an integer. If the length field is one of the standard signed integer types and the value is a negative integer, then the field is not present in the encoded stream. The field referenced by the Name shall precede the field with the custom data type.

GetLength()

Retrieves the OpcMemberLength defined by the OpcDataTypeMemberLengthAttribute.

C#

public OpcMemberLength GetLength()


Returns

OpcMemberLength

A new OpcMemberLength instance which provides the information required to determine the length of the member the attribute belongs to.