UA Bundle SDK .NET  2.2.3.276
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Groups Pages
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 datatype. 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, 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 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...
 

Detailed Description

Functions that operate on built in types.

Member Function Documentation

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

Casts a value to the specified target type.

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

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 imposible to cast.
static void UnifiedAutomation.UaBase.TypeUtils.CastArray ( Array  dst,
BuiltInType  dstType,
Array  src,
BuiltInType  srcType,
CastArrayElementHandler  convertor 
)
inlinestatic

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 
)
inlinestatic

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)
inlinestatic

Returns a deep copy of the value.

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

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 
)
inlinestatic

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)
inlinestatic

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 
)
inlinestatic

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)
inlinestatic

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)
inlinestatic

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)
inlinestatic

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)
inlinestatic

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 
)
inlinestatic

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 
)
inlinestatic

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 
)
inlinestatic

Returns the system type for the datatype.

Parameters
datatypeIdThe datatype 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 
)
inlinestatic

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)
inlinestatic

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)
inlinestatic

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 
)
inlinestatic

Checks if two values are equal.

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

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,
NodeId  expectedDataTypeId,
int  expectedValueRank,
NamespaceTable  namespaceUris,
ITypeTable  typeTree 
)
inlinestatic

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)
inlinestatic

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)
inlinestatic

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)
inlinestatic

Registers a type that represents a type definition.

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

Validates the array dimensions.

Parameters
valueRankThe value rank.
arrayDimensionsThe array dimensions.
Returns

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