class DNeXusTree forms a tree like representation of the NeXus/Hdf5 header. More...
Public Member Functions | |
| def | DNeXusTree () |
| Construct empty tree with a single root node. More... | |
| def | DNeXusTree (other) |
| Copy constructor. More... | |
| def | contains (node) |
| Return true if node is part of the tree, else false. More... | |
| def | at (path) |
| Returns reference to NeXus node at given path. More... | |
| def | newPath (path, type) |
| Add a new absolute path (starting with '/') or relative to root(). More... | |
| def | root () |
| Access the root node. More... | |
| def | toXml () |
| Write to xml string. More... | |
| def | fromXml (xmlString) |
| Read from xml string. More... | |
class DNeXusTree forms a tree like representation of the NeXus/Hdf5 header.
Every node in that tree is represented by an instance of DNeXusNode. Possible issue: As soon as a DNeXusNode object goes out of scope, all its children are deleted. So references kept to a DNeXusNode child, whose parent object has been destroyed, become invalid. Consider the following simple example:
In the second line a new child is attached to n. By assigning a new value to n its old value goes out of scope and is destroyed together with its child. Hence n points now to an object that has already been destroyed.
| def dectris.albula.DNeXusTree.DNeXusTree | ( | ) |
Construct empty tree with a single root node.
The root node may be obtained by root().
| def dectris.albula.DNeXusTree.DNeXusTree | ( | other | ) |
Copy constructor.
In general very fast as copying of the underlying NeXus tree is postponed to the first non constant access
| def dectris.albula.DNeXusTree.at | ( | path | ) |
Returns reference to NeXus node at given path.
| path | String containing the NeXus path |
| def dectris.albula.DNeXusTree.contains | ( | node | ) |
Return true if node is part of the tree, else false.
| def dectris.albula.DNeXusTree.fromXml | ( | xmlString | ) |
Read from xml string.
| xmlString | String |
| def dectris.albula.DNeXusTree.newPath | ( | path, | |
| type | |||
| ) |
Add a new absolute path (starting with '/') or relative to root().
Depending on type returns a reference to DNeXusGroup (DNeXusNode.GROUP), DNeXusData (DNeXusNode.DATA) or DNeXusAttribute (DNeXusNode.ATTRIBUTE)
| path | String with path ot new NeXus node |
| type | DNeXusNode.GROUP (=0), DNeXusNode.DATA (=1) or DNeXusNode.ATTRIBUTE (=2) |
| def dectris.albula.DNeXusTree.root | ( | ) |
Access the root node.
| def dectris.albula.DNeXusTree.toXml | ( | ) |
Write to xml string.