C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
XmlUaNodeFactoryManager Class Reference

The manager of the factories for creating instances. More...

#include <instancefactory.h>

Public Member Functions

 XmlUaNodeFactoryManager ()
 Creates an instance of the XmlUaNodeFactoryManager. More...
 
virtual ~XmlUaNodeFactoryManager ()
 Destroys the XmlUaNodeFactoryManager object.
 
UaStatus startUp (ServerManager *pServerManager)
 Start up the XmlUaNodeFactoryManager object during server startup.
 
void addNamespace (XmlUaNodeFactoryNamespace *pFactoryNamespace, bool deleteAtShutdown=false)
 Adds an additional XmlUaNodeFactoryNamespace to be managed by this instance. More...
 
UaVariablecreateVariable (UaBase::Variable *pVariable, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates a Variable with all components. More...
 
UaObjectcreateObject (UaBase::Object *pObject, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates an Object with all components. More...
 
virtual UaMethodcreateMethod (UaBase::Method *pMethod, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates a Method with all variables. More...
 
virtual UaDataTypecreateDataType (UaBase::DataType *pDataType, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates a DataType node and all properties of the node. More...
 
virtual UaReferenceTypecreateReferenceType (UaBase::ReferenceType *pReferenceType, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates a ReferenceType node. More...
 
virtual UaObjectTypecreateObjectType (UaBase::ObjectType *pObjectType, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates an ObjectType node including all children. More...
 
virtual UaVariableTypecreateVariableType (UaBase::VariableType *pVariableType, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 Creates a VariableType node including all children. More...
 
UaVariant defaultValue (const UaNodeId &dataTypeId, OpcUa_Int32 valueRank) const
 Returns the default value for a DataType with ValueRank valueRank. More...
 
virtual void createType (const UaNodeId &typeId)
 Tries to create a type with a factory. More...
 

Protected Member Functions

virtual OpcUa::BaseMethodcreateBaseMethod (UaBase::Method *pMethod, UaMutexRefCounted *pSharedMutex)
 Creates an instance of OpcUa::BaseMethod. More...
 

Detailed Description

The manager of the factories for creating instances.

The main use case for this class is to parse a NodeSet XML file using NodeManagerNodeSetXml and to create instances of toolkit classes using the resulting UaBase::BaseNodes.

Constructor & Destructor Documentation

XmlUaNodeFactoryManager::XmlUaNodeFactoryManager ( )

Creates an instance of the XmlUaNodeFactoryManager.

The default XmlUaNodeFactoryNamespace0 for namespace 0 is added by this constructor. It can be overwritten with XmlUaNodeFactoryManager::addNamespace().

Member Function Documentation

void XmlUaNodeFactoryManager::addNamespace ( XmlUaNodeFactoryNamespace pFactoryNamespace,
bool  deleteAtShutdown = false 
)

Adds an additional XmlUaNodeFactoryNamespace to be managed by this instance.

The caller has to delete the XmlUaNodeFactoryNamespace.

OpcUa::BaseMethod * XmlUaNodeFactoryManager::createBaseMethod ( UaBase::Method pMethod,
UaMutexRefCounted pSharedMutex 
)
protectedvirtual

Creates an instance of OpcUa::BaseMethod.

A derived class can overwrite this method to return application specific classes derived from OpcUa::BaseMethod

UaDataType * XmlUaNodeFactoryManager::createDataType ( UaBase::DataType pDataType,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)
virtual

Creates a DataType node and all properties of the node.

UaMethod * XmlUaNodeFactoryManager::createMethod ( UaBase::Method pMethod,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)
virtual

Creates a Method with all variables.

Parameters
pMethodThe temporary data representation of the method to create.
pNodeConfigIf pNodeConfig can be casted to NodeManagerNodeSetXml, the callback NodeManagerNodeSetXml::methodCreated is called for each child.
pSharedMutexAn optional mutex that is used across different objects.
UaObject * XmlUaNodeFactoryManager::createObject ( UaBase::Object pObject,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)

Creates an Object with all components.

The Object is created using the corresponding ObjectType namespace factory. The factory is implemented with XmlUaNodeFactoryNamespace and provided for the namespace with XmlUaNodeFactoryManager::addNamespace().

If you want to influence the Object creation, you need to implement the interface XmlUaNodeFactoryNamespace for the related ObjectType namespace. For the OPC UA namespace you should derive your own implementation from XmlUaNodeFactoryNamespace0 if you want to modify the creation of Objects based on OPCU defined ObjectTypes.

If the namespace of the type definition is not managed by this instance, a generic object with generic children is created.

Parameters
pObjectThe temporary data representation of the object to create.
pNodeConfigThe NodeManager to add the children of pObject.
pSharedMutexAn optional mutex that is used across different objects.
UaObjectType * XmlUaNodeFactoryManager::createObjectType ( UaBase::ObjectType pObjectType,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)
virtual

Creates an ObjectType node including all children.

UaReferenceType * XmlUaNodeFactoryManager::createReferenceType ( UaBase::ReferenceType pReferenceType,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)
virtual

Creates a ReferenceType node.

void XmlUaNodeFactoryManager::createType ( const UaNodeId typeId)
virtual

Tries to create a type with a factory.

UaVariable * XmlUaNodeFactoryManager::createVariable ( UaBase::Variable pVariable,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)

Creates a Variable with all components.

The Variable is created using the corresponding VariableType namespace factory. The factory is implemented with XmlUaNodeFactoryNamespace and provided for the namespace with XmlUaNodeFactoryManager::addNamespace().

If you want to influence the Variable creation, you need to implement the interface XmlUaNodeFactoryNamespace for the related VariableType namespace. For the OPC UA namespace you should derive your own implementation from XmlUaNodeFactoryNamespace0 if you want to modify the creation of Objects based on OPCU defined VariableTypes.

If the namespace of the type definition is not managed by this instance, a generic variable with generic children is created.

Parameters
pVariableThe temporary data representation of the variable to create.
pNodeConfigThe NodeManager to add the children of pVariable.
pSharedMutexAn optional mutex that is used across different variables.
UaVariableType * XmlUaNodeFactoryManager::createVariableType ( UaBase::VariableType pVariableType,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)
virtual

Creates a VariableType node including all children.

UaVariant XmlUaNodeFactoryManager::defaultValue ( const UaNodeId dataTypeId,
OpcUa_Int32  valueRank 
) const

Returns the default value for a DataType with ValueRank valueRank.

If the DataType is unknown, a null value is returned.


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