|
| ScriptNode (XnNodeHandle hNode=NULL) |
|
| ScriptNode (const NodeWrapper &other) |
|
XnStatus | Create (Context &context, const XnChar *strFormat) |
|
const XnChar * | GetSupportedFormat () |
|
XnStatus | LoadScriptFromFile (const XnChar *strFileName) |
|
XnStatus | LoadScriptFromString (const XnChar *strScript) |
|
XnStatus | Run (EnumerationErrors *pErrors) |
|
| ProductionNode (XnNodeHandle hNode=NULL) |
|
| ProductionNode (const NodeWrapper &other) |
|
NodeInfo | GetInfo () const |
|
XnStatus | AddNeededNode (ProductionNode &needed) |
|
XnStatus | RemoveNeededNode (ProductionNode &needed) |
|
void | GetContext (Context &context) const |
|
Context | GetContext () const |
|
XnBool | IsCapabilitySupported (const XnChar *strCapabilityName) const |
|
XnStatus | SetIntProperty (const XnChar *strName, XnUInt64 nValue) |
|
XnStatus | SetRealProperty (const XnChar *strName, XnDouble dValue) |
|
XnStatus | SetStringProperty (const XnChar *strName, const XnChar *strValue) |
|
XnStatus | SetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer) |
|
XnStatus | GetIntProperty (const XnChar *strName, XnUInt64 &nValue) const |
|
XnStatus | GetRealProperty (const XnChar *strName, XnDouble &dValue) const |
|
XnStatus | GetStringProperty (const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const |
|
XnStatus | GetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const |
|
XnStatus | LockForChanges (XnLockHandle *phLock) |
|
void | UnlockForChanges (XnLockHandle hLock) |
|
XnStatus | LockedNodeStartChanges (XnLockHandle hLock) |
|
void | LockedNodeEndChanges (XnLockHandle hLock) |
|
const ErrorStateCapability | GetErrorStateCap () const |
|
ErrorStateCapability | GetErrorStateCap () |
|
GeneralIntCapability | GetGeneralIntCap (const XnChar *strCapability) |
|
| NodeWrapper (XnNodeHandle hNode) |
|
| NodeWrapper (const NodeWrapper &other) |
|
NodeWrapper & | operator= (const NodeWrapper &other) |
|
| ~NodeWrapper () |
|
| operator XnNodeHandle () const |
|
XnNodeHandle | GetHandle () const |
|
XnBool | operator== (const NodeWrapper &other) |
|
XnBool | operator!= (const NodeWrapper &other) |
|
XnBool | IsValid () const |
|
const XnChar * | GetName () const |
|
XnStatus | AddRef () |
|
void | Release () |
|
void | SetHandle (XnNodeHandle hNode) |
|
void | TakeOwnership (XnNodeHandle hNode) |
|
Purpose: The ScriptNode object loads an XML script from a file or string, and then runs the XML script to build a production graph. It also references every node created from that script, so it wouldn't be destroyed.
Remarks:
A typical usage of a script node is:
Note that the context's RunXmlScriptFromFile() or RunXmlScript() methods can be used to perform all above steps.
All production nodes in the production graph use reference count to determine their life time, but if an application executed a script, it can't know upfront which nodes will be created by this script, and so, can't take reference to them, so those nodes might be destroyed immediately. The script node, apart from executing the script, also keeps reference to all the nodes created by the script. This means that if the script node is destroyed, every production node that was created by the script, and is unreferenced by the application will also be destroyed. For this reason, it is recommended for application using XML scripts to keep a reference to the script node as long as they keep a reference to the context itself.
A single ScriptNode object is responsible for building the entire production graph, irrespective of however many node definitions there are in the XML script and how many production nodes are created.
For additional information about XML scripts, see Xml Scripts.