.NET Based OPC UA Client/Server SDK  2.6.1.422
UnifiedAutomation.UaBase.GenericUnionDataType Class Reference

A type description for a structured which is also a simple union. More...

Inherits UnifiedAutomation.UaBase.GenericStructureDataType.

Public Member Functions

 GenericUnionDataType ()
 Initializes a new instance of the GenericUnionDataType class. More...
 
bool TryGetSwitchValue (string fieldName, out uint value)
 Tries the get switch value. More...
 
bool TryGetSwitchField (uint value, out string fieldName)
 Trys to get the fieldName for a value. More...
 
void SetSwitchValue (string fieldName, uint value)
 Sets the switch value for a field. More...
 
override void Add (GenericStructureDataTypeField value)
 Adds the field for the specified field name. More...
 
override string ToString (string format, IFormatProvider formatProvider)
 Returns a System.String that represents this instance. More...
 
override DataTypeDefinitionSettings DataTypeDefinition (NamespaceTable namespaceUris)
 Returns the DataTypeDefinitionSettings for the union. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaBase.GenericStructureDataType
 GenericStructureDataType ()
 Initializes a new instance of the GenericStructureDataType class. More...
 
bool TryGetValue (string name, out GenericStructureDataTypeField value)
 Checks whether the specified field exists and returns it if it does. More...
 
bool Remove (string name)
 Removes the field with the specified name. More...
 
void RemoveAt (int ii)
 Removes the field at the specified index. More...
 
IEnumerator< KeyValuePair
< string,
GenericStructureDataTypeField > > 
GetEnumerator ()
 Returns an enumerator that iterates through the collection. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaBase.GenericDataType
override string ToString ()
 Returns a System.String that represents this instance. More...
 

Properties

override GenericDataTypeClass TypeClass [get]
 Gets the type class for the object. More...
 
string SwitchField [get, set]
 The name of switch field which specifies the field stored in the union. More...
 
- Properties inherited from UnifiedAutomation.UaBase.GenericStructureDataType
ExpandedNodeId XmlEncodingNodeId [get, set]
 The NodeId for the DefaultXML encoding node. More...
 
ExpandedNodeId BinaryEncodingNodeId [get, set]
 The NodeId for the DefaultBinary encoding node. More...
 
override GenericDataTypeClass TypeClass [get]
 Gets the type class for the object. More...
 
int Count [get]
 Gets the number of fields in the structure. More...
 
IList< string > Fields [get]
 Gets list of field names. More...
 
GenericStructureDataTypeField this[string key] [get, set]
 Gets or sets the field with the specified field name. More...
 
GenericStructureDataTypeField this[int index] [get, set]
 Gets or sets the field at the specified index. More...
 
- Properties inherited from UnifiedAutomation.UaBase.GenericDataType
XmlQualifiedName Name [get, set]
 Gets or sets the qualified name for the type. More...
 
abstract GenericDataTypeClass TypeClass [get]
 Gets the type class for the object. More...
 
virtual ExpandedNodeId DataTypeId [get, set]
 Gets or sets the DataTypeId More...
 

Additional Inherited Members

- Protected Member Functions inherited from UnifiedAutomation.UaBase.GenericStructureDataType
void Rename (string oldName, string newName)
 Renames the specified field. More...
 

Detailed Description

A type description for a structured which is also a simple union.

Constructor & Destructor Documentation

UnifiedAutomation.UaBase.GenericUnionDataType.GenericUnionDataType ( )
inline

Initializes a new instance of the GenericUnionDataType class.

Member Function Documentation

override void UnifiedAutomation.UaBase.GenericUnionDataType.Add ( GenericStructureDataTypeField  value)
inlinevirtual

Adds the field for the specified field name.

Set the SwitchTable entry implicitly.

Parameters
valueA description for the field.

Reimplemented from UnifiedAutomation.UaBase.GenericStructureDataType.

override DataTypeDefinitionSettings UnifiedAutomation.UaBase.GenericUnionDataType.DataTypeDefinition ( NamespaceTable  namespaceUris)
inlinevirtual

Returns the DataTypeDefinitionSettings for the union.

Parameters
namespaceUrisThe NamespaceTable to resolve the DataTypeIds of the fields.
Returns
The StructureDefinitionSettings of the DataType.

Reimplemented from UnifiedAutomation.UaBase.GenericStructureDataType.

void UnifiedAutomation.UaBase.GenericUnionDataType.SetSwitchValue ( string  fieldName,
uint  value 
)
inline

Sets the switch value for a field.

If a switch value is already set for the field, the existing assignment is removed.

Parameters
fieldName
value
override string UnifiedAutomation.UaBase.GenericUnionDataType.ToString ( string  format,
IFormatProvider  formatProvider 
)
inlinevirtual

Returns a System.String that represents this instance.

Parameters
formatThe format.
formatProviderThe format provider.
Returns
A System.String that represents this instance.

Reimplemented from UnifiedAutomation.UaBase.GenericStructureDataType.

bool UnifiedAutomation.UaBase.GenericUnionDataType.TryGetSwitchField ( uint  value,
out string  fieldName 
)
inline

Trys to get the fieldName for a value.

Parameters
valueThe value that is used as the 'selector' of a union.
fieldNameThe name of the field that is valid if the switch field has the value value.
Returns
'true' if there is a valid field for value.
bool UnifiedAutomation.UaBase.GenericUnionDataType.TryGetSwitchValue ( string  fieldName,
out uint  value 
)
inline

Tries the get switch value.

Parameters
fieldNameName of the field.
valueThe value.
Returns
TRUE if the field was found. FALSE otherwise.

This method uses a linear search and could perform poorly in some contexts.

Exceptions
System.ArgumentNullExceptionfieldName

Property Documentation

string UnifiedAutomation.UaBase.GenericUnionDataType.SwitchField
getset

The name of switch field which specifies the field stored in the union.

override GenericDataTypeClass UnifiedAutomation.UaBase.GenericUnionDataType.TypeClass
get

Gets the type class for the object.

The type class.


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