.NET Based OPC UA Client/Server SDK  3.3.3.537
UnifiedAutomation.UaBase.TypeUtils Class Reference

Functions that operate on built in types. More...

Public Member Functions

delegate object CastArrayElementHandler (object source, BuiltInType srcType, BuiltInType dstType)
 A delegate for a function that converts an array element. More...
 

Static Public Member Functions

static void RegisterTypeDefinition (Type type)
 Registers a type that represents a type definition. More...
 
static object Clone (object value)
 Returns a deep copy of the value. More...
 
static bool IsEqual (object value1, object value2)
 Checks if two values are equal. More...
 
static string Format (IFormatProvider provider, object value)
 Formats the value using the specified format provider. More...
 
static NodeId GetDataTypeId (object value)
 Returns the data type id that describes a value. More...
 
static NodeId GetDataTypeId (Type type)
 Returns the data type id that describes a value. More...
 
static NodeId GetDataTypeId (TypeInfo typeInfo)
 Returns the data type id that describes a value. More...
 
static int GetValueRank (object value)
 Returns the array rank for a value. More...
 
static int GetValueRank (Type type)
 Returns the array rank for a type. More...
 
static BuiltInType GetBuiltInType (NodeId datatypeId)
 Returns the BuiltInType type for the DataTypeId. More...
 
static bool IsNumericType (BuiltInType builtInType)
 Returns true if the built-in type is a numeric type. More...
 
static bool IsValueType (BuiltInType builtInType)
 Returns true if the built-in type is a type that cannot be null. More...
 
static BuiltInType GetBuiltInType (NodeId datatypeId, ITypeTable typeTree)
 Returns the BuiltInType type for the DataTypeId. More...
 
static Type GetSystemType (NodeId datatypeId, EncodeableFactory factory)
 Returns the system type for the data type. More...
 
static TypeInfo IsInstanceOfDataType (object value, NodeId expectedDataTypeId, int expectedValueRank, NamespaceTable namespaceUris, ITypeTable typeTree)
 Returns the type info if the value is an instance of the data type with the specified value rank. More...
 
static TypeInfo IsInstanceOfDataType (Variant value, TypeInfo expectedType)
 Returns the type info if the value is an instance of the data type with the specified value rank. More...
 
static TypeInfo IsInstanceOfDataType (Variant value, NodeId expectedDataTypeId, int expectedValueRank, NamespaceTable namespaceUris, ITypeTable typeTree)
 Returns the type info if the value is an instance of the data type with the specified value rank. More...
 
static Type GetSystemType (BuiltInType builtInType, int valueRank)
 Returns the system type a scalar or array instance of the built-in type. More...
 
static Variant GetDefaultValue (BuiltInType type)
 Returns the default value for the specified built-in type. More...
 
static Variant GetDefaultValue (NodeId dataType, int valueRank)
 Returns the default value for the specified data type and value rank. More...
 
static Variant GetDefaultValue (NodeId dataType, int valueRank, ITypeTable typeTree)
 Returns the default value for the specified data type and value rank. More...
 
static Array CreateArray (BuiltInType type, params int[] dimensions)
 Returns the default value for the specified built-in type. More...
 
static Variant Cast2 (Variant source, BuiltInType targetType)
 Casts a value to the specified target type. More...
 
static Variant Cast2 (Variant source, TypeInfo sourceType, BuiltInType targetType)
 Casts a value to the specified target type. More...
 
static object Cast (object source, BuiltInType targetType)
 Casts a value to the specified target type. More...
 
static object Cast (object source, TypeInfo sourceType, BuiltInType targetType)
 Casts a value to the specified target type. More...
 
static void CastArray (Array dst, BuiltInType dstType, Array src, BuiltInType srcType, CastArrayElementHandler convertor)
 Converts the array using the specified conversion function. More...
 
static Array CastArray (Array srcArray, BuiltInType srcType, BuiltInType dstType, CastArrayElementHandler convertor)
 Converts the array. More...
 
static bool ValidateArrayDimensions (int valueRank, IList< uint > arrayDimensions)
 Validates the array dimensions. More...
 

Static Public Attributes

static readonly UTF8Encoding UTF8 = new UTF8Encoding(false)
 A preallocated UTF8 encoder object. More...
 

Detailed Description

Functions that operate on built in types.

Member Function Documentation

static object UnifiedAutomation.UaBase.TypeUtils.Cast ( object  source,
BuiltInType  targetType 
)
static

Casts a value to the specified target type.

Parameters
sourceThe instance of a source value.
targetTypeType of the target.
Returns
Return casted value.
Exceptions
InvalidCastExceptionif impossible to cast.
static object UnifiedAutomation.UaBase.TypeUtils.Cast ( object  source,
TypeInfo  sourceType,
BuiltInType  targetType 
)
static

Casts a value to the specified target type.

Parameters
sourceThe instance of a source value.
sourceTypeType of the source.
targetTypeType of the target.
Returns
Return casted value.
Exceptions
InvalidCastExceptionif impossible to cast.
static Variant UnifiedAutomation.UaBase.TypeUtils.Cast2 ( Variant  source,
BuiltInType  targetType 
)
static

Casts a value to the specified target type.

Parameters
sourceThe instance of a source value.
targetTypeType of the target.
Returns
Return casted value.
Exceptions
InvalidCastExceptionif impossible to cast.
static Variant UnifiedAutomation.UaBase.TypeUtils.Cast2 ( Variant  source,
TypeInfo  sourceType,
BuiltInType  targetType 
)
static

Casts a value to the specified target type.

Parameters
sourceThe instance of a source value.
sourceTypeType of the source.
targetTypeType of the target.
Returns
Return casted value.
Exceptions
InvalidCastExceptionif impossible to cast.
static void UnifiedAutomation.UaBase.TypeUtils.CastArray ( Array  dst,
BuiltInType  dstType,
Array  src,
BuiltInType  srcType,
CastArrayElementHandler  convertor 
)
static

Converts the array using the specified conversion function.

Parameters
dstThe destination array (must have the same size as the source array).
dstTypeThe data type of the elements in the destination array.
srcThe source array.
srcTypeThe data type of the elements in the source array.
convertorThe handler which does the conversion.
static Array UnifiedAutomation.UaBase.TypeUtils.CastArray ( Array  srcArray,
BuiltInType  srcType,
BuiltInType  dstType,
CastArrayElementHandler  convertor 
)
static

Converts the array.

Parameters
srcArrayThe source array.
srcTypeThe type of the source array.
dstTypeThe type of the converted array.
convertorThe handler which does the conversion.
Returns
The converted array.
delegate object UnifiedAutomation.UaBase.TypeUtils.CastArrayElementHandler ( object  source,
BuiltInType  srcType,
BuiltInType  dstType 
)

A delegate for a function that converts an array element.

Parameters
sourceThe element to be converted.
srcTypeThe type of the source element.
dstTypeThe type of the converted value.
Returns
The converted
static object UnifiedAutomation.UaBase.TypeUtils.Clone ( object  value)
static

Returns a deep copy of the value.

static Array UnifiedAutomation.UaBase.TypeUtils.CreateArray ( BuiltInType  type,
params int[]  dimensions 
)
static

Returns the default value for the specified built-in type.

Parameters
typeThe built-in type.
dimensionsThe dimensions.
Returns
The default value for the specified built-in type
static string UnifiedAutomation.UaBase.TypeUtils.Format ( IFormatProvider  provider,
object  value 
)
static

Formats the value using the specified format provider.

Parameters
providerThe format provider.
valueThe value.
Returns
The formatted string.
static BuiltInType UnifiedAutomation.UaBase.TypeUtils.GetBuiltInType ( NodeId  datatypeId)
static

Returns the BuiltInType type for the DataTypeId.

Parameters
datatypeIdThe data type identifier.
Returns
An BuiltInType for datatypeId
static BuiltInType UnifiedAutomation.UaBase.TypeUtils.GetBuiltInType ( NodeId  datatypeId,
ITypeTable  typeTree 
)
static

Returns the BuiltInType type for the DataTypeId.

Parameters
datatypeIdThe data type identyfier for a node in a server's address space.
typeTreeThe type tree for a server. .
Returns
A BuiltInType value for datatypeId
static NodeId UnifiedAutomation.UaBase.TypeUtils.GetDataTypeId ( object  value)
static

Returns the data type id that describes a value.

Parameters
valueThe value instance to check the data type.
Returns
An data type identifier for a node in a server's address space.
static NodeId UnifiedAutomation.UaBase.TypeUtils.GetDataTypeId ( Type  type)
static

Returns the data type id that describes a value.

Parameters
typeThe framework type.
Returns
An data type identifier for a node in a server's address space.
static NodeId UnifiedAutomation.UaBase.TypeUtils.GetDataTypeId ( TypeInfo  typeInfo)
static

Returns the data type id that describes a value.

Parameters
typeInfoThe type info.
Returns
An data type identifier for a node in a server's address space.
static Variant UnifiedAutomation.UaBase.TypeUtils.GetDefaultValue ( BuiltInType  type)
static

Returns the default value for the specified built-in type.

Parameters
typeThe Built-in type.
Returns
The default value.
static Variant UnifiedAutomation.UaBase.TypeUtils.GetDefaultValue ( NodeId  dataType,
int  valueRank 
)
static

Returns the default value for the specified data type and value rank.

Parameters
dataTypeThe data type.
valueRankThe value rank.
Returns
The default value.
static Variant UnifiedAutomation.UaBase.TypeUtils.GetDefaultValue ( NodeId  dataType,
int  valueRank,
ITypeTable  typeTree 
)
static

Returns the default value for the specified data type and value rank.

Parameters
dataTypeThe data type.
valueRankThe value rank.
typeTreeThe type tree for a server.
Returns
A default value.
static Type UnifiedAutomation.UaBase.TypeUtils.GetSystemType ( NodeId  datatypeId,
EncodeableFactory  factory 
)
static

Returns the system type for the data type.

Parameters
datatypeIdThe data type id.
factoryThe factory used to store and retrieve underlying OPC UA system types.
Returns
The system type for the datatypeId .
static Type UnifiedAutomation.UaBase.TypeUtils.GetSystemType ( BuiltInType  builtInType,
int  valueRank 
)
static

Returns the system type a scalar or array instance of the built-in type.

Parameters
builtInTypeA built-in type.
valueRankThe value rank.
Returns
A system type equivalent to the built-in type.
static int UnifiedAutomation.UaBase.TypeUtils.GetValueRank ( object  value)
static

Returns the array rank for a value.

Parameters
valueThe value instance to check the array rank.
Returns
The array rank of the value
static int UnifiedAutomation.UaBase.TypeUtils.GetValueRank ( Type  type)
static

Returns the array rank for a type.

Parameters
typeThe framework type to check the array rank.
Returns
The array rank of the type
static bool UnifiedAutomation.UaBase.TypeUtils.IsEqual ( object  value1,
object  value2 
)
static

Checks if two values are equal.

static TypeInfo UnifiedAutomation.UaBase.TypeUtils.IsInstanceOfDataType ( object  value,
NodeId  expectedDataTypeId,
int  expectedValueRank,
NamespaceTable  namespaceUris,
ITypeTable  typeTree 
)
static

Returns the type info if the value is an instance of the data type with the specified value rank.

Parameters
valueThe value instance to check.
expectedDataTypeIdThe expected data type identifier for a node.
expectedValueRankThe expected value rank.
namespaceUrisThe namespace URI's.
typeTreeThe type tree for a server.
Returns
An data type info if the value is an instance of the data type with the specified value rank; otherwise null.
static TypeInfo UnifiedAutomation.UaBase.TypeUtils.IsInstanceOfDataType ( Variant  value,
TypeInfo  expectedType 
)
static

Returns the type info if the value is an instance of the data type with the specified value rank.

Parameters
valueThe value instance to check.
expectedTypeThe expected type.
Returns
An data type info if the value is an instance of the data type with the specified value rank; otherwise null.
static TypeInfo UnifiedAutomation.UaBase.TypeUtils.IsInstanceOfDataType ( Variant  value,
NodeId  expectedDataTypeId,
int  expectedValueRank,
NamespaceTable  namespaceUris,
ITypeTable  typeTree 
)
static

Returns the type info if the value is an instance of the data type with the specified value rank.

Parameters
valueThe value instance to check.
expectedDataTypeIdThe expected data type identifier for a node.
expectedValueRankThe expected value rank.
namespaceUrisThe namespace URI's.
typeTreeThe type tree for a server.
Returns
An data type info if the value is an instance of the data type with the specified value rank; otherwise null.
static bool UnifiedAutomation.UaBase.TypeUtils.IsNumericType ( BuiltInType  builtInType)
static

Returns true if the built-in type is a numeric type.

Parameters
builtInTypeThe built-in type to check.
Returns
True if the built-in type is a numeric type.
static bool UnifiedAutomation.UaBase.TypeUtils.IsValueType ( BuiltInType  builtInType)
static

Returns true if the built-in type is a type that cannot be null.

Parameters
builtInTypeThe built in type to check.
Returns
True if the built-in type is a type that cannot be null.
static void UnifiedAutomation.UaBase.TypeUtils.RegisterTypeDefinition ( Type  type)
static

Registers a type that represents a type definition.

Parameters
typeThe type definition.
static bool UnifiedAutomation.UaBase.TypeUtils.ValidateArrayDimensions ( int  valueRank,
IList< uint >  arrayDimensions 
)
static

Validates the array dimensions.

Parameters
valueRankThe value rank.
arrayDimensionsThe array dimensions.
Returns

Member Data Documentation

readonly UTF8Encoding UnifiedAutomation.UaBase.TypeUtils.UTF8 = new UTF8Encoding(false)
static

A preallocated UTF8 encoder object.


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