C++ UA Server SDK  1.5.0.318
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
UaNodeSetXmlParserUaNode Class Reference

Helper class for loading UANodeSet XML files and managing the required NodeManagers. More...

#include <nodemanagernodesetxml.h>

Inherits UaBase::UaNodesetXmlParser, and UaServerApplicationModule.

Public Member Functions

 UaNodeSetXmlParserUaNode (const UaString &sFilename, NodeManagerNodeSetXmlCreator *pNodeManagerXmlCreator, UaBase::BaseNodeFactory *pBaseNodeFactory, XmlUaNodeFactoryManager *pUaNodeFactory)
 Constructs a parser for reading UANodeSet XML files. More...
 
virtual ~UaNodeSetXmlParserUaNode ()
 Calls the shutDown() method for each created NodeManger and deletes it. More...
 
virtual UaStatus startUp (ServerManager *pServerManager)
 Reads the NodeSet XML file that matches the schema http://opcfoundation.org/UA/2011/03/UANodeSet.xsd. More...
 
virtual UaStatus shutDown ()
 Shuts all created NodeManagers down. More...
 
- Public Member Functions inherited from UaBase::UaNodesetXmlParser
 UaNodesetXmlParser (UaXmlDocument *pXmlDoc)
 Creates and initializes a UaNodesetXmlParser object. More...
 
virtual ~UaNodesetXmlParser ()
 Destroys the UaNodesetXmlParser object. More...
 
void setDictionary (UaDataTypeDictionary *pDictionary)
 Sets a UaDataTypeDictionary for structured DataTypes defined outside of the current XML document. More...
 

Additional Inherited Members

- Protected Member Functions inherited from UaBase::UaNodesetXmlParser
virtual UaStatus loadXmlFile (const UaString &sFilename, UaString &sErrorText)
 Loads the XML file and reads namespaces and aliases.
 
virtual OpcUa_StatusCode readUris ()
 Parses the NamespaceUris node. More...
 
void readAliases ()
 Parses the Aliases node. More...
 
void readExtensions ()
 Parses the Extensions node at document level. More...
 
virtual UaStatus readXmlFile (std::map< UaNodeId, UaBase::BaseNode * > &mapNodes, UaString &sErrorText)
 Read the nodes and references from the XML file.
 
virtual void evaluateModelParents (std::map< UaNodeId, UaBase::BaseNode * > &mapNodes)
 Adds the nodes to their parent if a ParentNodeId is set. More...
 
virtual UaStatus parseVariable (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "Variable" and adds the resulting UaBase::Variable* to rMapNodes. More...
 
virtual UaStatus parseObject (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "Object" and adds the resulting UaBase::Object* to rMapNodes. More...
 
virtual UaStatus parseMethod (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 P arses a node with the tagname "Method" and adds the resulting UaBase::Method* to rMapNodes. More...
 
virtual UaStatus parseDataType (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "DataType" and adds the resulting UaBase::DataType* to rMapNodes. More...
 
virtual UaStatus parseReferenceType (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "ReferenceType" and adds the resulting UaBase::ReferenceType* to rMapNodes. More...
 
virtual UaStatus parseObjectType (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "ObjectType" and adds the resulting UaBase::ObjectType* to rMapNodes. More...
 
virtual UaStatus parseVariableType (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "VariableType" and adds the resulting UaBase::VariableType* to rMapNodes. More...
 
virtual UaStatus parseView (std::map< UaNodeId, UaBase::BaseNode * > &rMapNodes)
 Parses a node with the tagname "View" and adds the resulting UaBase::View* to rMapNodes. More...
 
virtual UaStatus parseReferences (UaBase::BaseNode *pBaseNode)
 Parses a node with tagname "References". More...
 
virtual UaStatus parseExtensions (UaBase::BaseNode *pBaseNode)
 Parses a node with tagname "Extensions". More...
 
virtual UaStatus parseDefinition (UaBase::DataType *pDataType)
 Checks if a Definition atg is available and creates a UaEumdefinition or a UaStructureDefinition. More...
 
UaNodeId parseNodeId (const UaUniString &sNodeId) const
 Parses the sNodeId. More...
 
UaQualifiedName parseQualifiedName (const UaUniString &sQualifiedName) const
 Parses the sQualifiedName. More...
 
UaLocalizedText parseLocalizedText () const
 Returns the UaLocalizedText of the current node. More...
 
void parseBooleanAttribute (const char *szAttributeName, OpcUa_Boolean bDefaultValue, OpcUa_Boolean &rbValue)
 Looks for an attribute of the current node. More...
 
void parseByteAttribute (const char *szAttributeName, OpcUa_Byte defaultValue, OpcUa_Byte &rbValue)
 Parses an attribute of the type OpcUa_Byte. More...
 
void parseInt32Attribute (const char *szAttributeName, OpcUa_Int32 defaultValue, OpcUa_Int32 &rbValue)
 Parses an attribute of the type OpcUa_Int32. More...
 
void parseUInt32Attribute (const char *szAttributeName, OpcUa_UInt32 defaultValue, OpcUa_UInt32 &rValue)
 Parses an attribute of the type UInt32. More...
 
void parseNodeIdAttribute (const char *szAttributeName, const UaNodeId &defaultValue, UaNodeId &rbValue)
 Parses an attribute of the type UaNodeId. More...
 
void parseDoubleAttribute (const char *szAttributeName, OpcUa_Double defaultValue, OpcUa_Double &rbValue)
 Parses an attribute of the type OpcUa_Double. More...
 
UaVariant parseValue ()
 Parses the Value of a Variable or a VariableType. More...
 
void parseTypesValue (UaVariant &rValue)
 Parses a node with the tagname "Value". More...
 
OpcUa_Boolean getBooleanValue () const
 Parses a Boolean value. More...
 
OpcUa_Byte getByteValue () const
 Parses a value of DataType OpcUa_Byte. More...
 
UaByteString getByteStringValue () const
 Parses a value of DataType UaByteString. More...
 
UaDateTime getDateTimeValue () const
 Parses a value of DataType OpcUa_DateTimeDouble. More...
 
OpcUa_Double getDoubleValue () const
 Parses a value of DataType OpcUa_Double. More...
 
UaExtensionObject getExtensionObjectValue ()
 Parses a value of DataType UaExtensionObject. More...
 
OpcUa_Float getFloatValue () const
 Parses a value of DataType OpcUa_Float. More...
 
UaGuid getGuidValue () const
 Parses a value of DataType UaGuid. More...
 
OpcUa_Int16 getInt16Value () const
 Parses a value of DataType OpcUa_Int16. More...
 
OpcUa_Int32 getInt32Value () const
 Parses a value of DataType OpcUa_Int32. More...
 
OpcUa_Int64 getInt64Value () const
 Parses a value of DataType OpcUa_Int64. More...
 
UaLocalizedText getLocalizedTextValue () const
 Parses a value of DataType UaLocalizedText. More...
 
UaNodeId getNodeIdValue () const
 Parses a value of DataType UaNodeId. More...
 
UaQualifiedName getQualifiedNameValue () const
 Parses a value of DataType UaQualifiedName. More...
 
UaString getStringValue () const
 Parses a value of DataType UaString. More...
 
OpcUa_SByte getSByteValue () const
 Parses a value of DataType OpcUa_SByte. More...
 
OpcUa_UInt16 getUInt16Value () const
 Parses a value of DataType OpcUa_UInt16. More...
 
OpcUa_UInt32 getUInt32Value () const
 Parses a value of DataType OpcUa_UInt32. More...
 
OpcUa_UInt64 getUInt64Value () const
 Parses a value of DataType OpcUa_UInt64. More...
 
void getBoolArray (UaBooleanArray &ret)
 Parses a value of DataType UaBoolArray. More...
 
void getByteArray (UaByteArray &ret)
 Parses a value of DataType UaByteArray. More...
 
void getByteStringArray (UaByteStringArray &ret)
 Parses a value of DataType UaByteStringArray. More...
 
void getDateTimeArray (UaDateTimeArray &ret)
 Parses a value of DataType UaDateTimeArray. More...
 
void getDoubleArray (UaDoubleArray &ret)
 Parses a value of DataType UaDoubleArray. More...
 
void getFloatArray (UaFloatArray &ret)
 Parses a value of DataType UaFloatArray. More...
 
void getGuidArray (UaGuidArray &ret)
 Parses a value of DataType UaGuidArray. More...
 
void getInt16Array (UaInt16Array &ret)
 Parses a value of DataType UaInt16Array. More...
 
void getInt32Array (UaInt32Array &ret)
 Parses a value of DataType UaInt32Array. More...
 
void getInt64Array (UaInt64Array &ret)
 Parses a value of DataType UaInt64Array. More...
 
void getLocalizedTextArray (UaLocalizedTextArray &ret)
 Parses a value of DataType UaLocalizedTextArray. More...
 
void getNodeIdArray (UaNodeIdArray &ret)
 Parses a value of DataType UaNodeIdArray. More...
 
void getQualifiedNameArray (UaQualifiedNameArray &ret)
 Parses a value of DataType UaQualifiedNameArray. More...
 
void getStringArray (UaStringArray &ret)
 Parses a value of DataType UaStringArray. More...
 
void getSByteArray (UaSByteArray &ret)
 Parses a value of DataType UaSByteArray. More...
 
void getUInt16Array (UaUInt16Array &ret)
 Parses a value of DataType UaUInt16Array. More...
 
void getUInt32Array (UaUInt32Array &ret)
 Parses a value of DataType UaUInt32Array. More...
 
void getUInt64Array (UaUInt64Array &ret)
 Parses a value of DataType UaUInt64Array. More...
 
void getVariantArray (UaVariantArray &ret)
 Parses a value of DataType UaVariantArray. More...
 
void getExtensionObjectArray (UaExtensionObjectArray &ret)
 Parses a value of DataType UaExtensionObjectArray. More...
 
UaArgument getArgumentValue ()
 Parses a value of DataType UaArgument. More...
 
UaEnumValueType getEnumValueTypeValue ()
 Parses a value of DataType UaEnumValueType. More...
 
UaEUInformation getEUInformationValue ()
 Parses a value of DataType UaEUInformation. More...
 
UaRange getRangeValue ()
 Parses a value of DataType UaRange. More...
 
UaStatus parseNode (UaNodeId &rNodeId, UaQualifiedName &rBrowseName, UaLocalizedText &rDisplayName, UaLocalizedText &rDescription, OpcUa_UInt32 &riWriteMask, OpcUa_UInt32 &riUserWriteMask)
 Parses the standard attributes for each NodeClass. More...
 
UaStatus parseReference (const UaXmlElementListIterator &it, UaNodeId &rReferenceTypeId, bool &rbIsForward, UaNodeId &rTargetNodeId)
 Parses a reference of a node. More...
 
UaStatus parseExtension (UaString &rsName, UaByteString &rbsValue)
 Parses a Extension for a node. More...
 
bool getReferenceTarget (const UaNodeId &referenceType, bool bIsForward, UaNodeId &targetId)
 Tries to find a reference with the specified referenceType. More...
 
- Static Protected Member Functions inherited from UaBase::UaNodesetXmlParser
static bool contains (const std::list< UaNodeId > &lstNodeIds, const UaNodeId &nodeId)
 Checks if nodeId is in lstNodeIds. More...
 

Detailed Description

Helper class for loading UANodeSet XML files and managing the required NodeManagers.

The parser can read UANodeSet XML files that match the schema http://opcfoundation.org/UA/2011/03/UANodeSet.xsd.

This class implements the UaServerApplicationModule interface which allows to plug in the parsing and NodeManager startup into the normal startup process handled by the UaServerApplication class and the OpcServer class derived from it.

Constructor & Destructor Documentation

UaNodeSetXmlParserUaNode::UaNodeSetXmlParserUaNode ( const UaString sFilename,
NodeManagerNodeSetXmlCreator pNodeManagerXmlCreator,
UaBase::BaseNodeFactory pBaseNodeFactory,
XmlUaNodeFactoryManager pUaNodeFactory 
)

Constructs a parser for reading UANodeSet XML files.

The parser stores the nodes and references in an internal format based on UaBase::BaseNode and derived classes, uses them to create UaNodes and adds them to the NodeManagers.

Parameters
sFilenameThe filename of the UANodeSet XML file to import.
pNodeManagerXmlCreatorThe factory to create the NodeManagers for the new NamespaceUris declared in the XML document. If NULL, a standard creator is used.
pUaNodeFactoryThe XmlUaNodeFactoryManager to create UaNodes to be added to the NodeManager. You can add your own factories of the type XmlUaNodeFactoryNamespace to this manager to instantiate your own UaNode implementation classes. If NULL, a standard factory is used.
pBaseNodeFactoryThe factory to create the UaBase::BaseNode in the internal format. You can use a subtype of UaBase::BaseNodeFactory to implement your own logic of creating UserData from the XML Extensions. If NULL, a standard factory is used.
UaNodeSetXmlParserUaNode::~UaNodeSetXmlParserUaNode ( )
virtual

Calls the shutDown() method for each created NodeManger and deletes it.

Member Function Documentation

UaStatus UaNodeSetXmlParserUaNode::shutDown ( )
virtual

Shuts all created NodeManagers down.

Implements UaServerApplicationModule.

UaStatus UaNodeSetXmlParserUaNode::startUp ( ServerManager pServerManager)
virtual

Reads the NodeSet XML file that matches the schema http://opcfoundation.org/UA/2011/03/UANodeSet.xsd.

For each NamespaceUri that is declared in sFile but is not known by the Server, a new NodeManager is created. The parser stores the nodes and references in an internal format and uses them to create instances of the Type classes.

Implements UaServerApplicationModule.


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