DABC (Data Acquisition Backbone Core)
2.9.9
|
Represents objects hierarchy of remote (or local) DABC process. More...
#include <dabc/Hierarchy.h>
Private Member Functions | |
void | BuildNew (Reference top) |
Build objects hierarchy, referenced by top. More... | |
void | Create (const std::string &name, bool withmutex=false) |
Create top-level object with specified name. More... | |
Hierarchy | CreateFolder (const std::string &name) |
Create folder in hierarchy, one could use it to add new childs to it. More... | |
Hierarchy | CreateHChild (const std::string &name, bool allowslahes=false, bool sortorder=false) |
Create child item in hierarchy with specified name If allowslahes enabled, instead of subfolders item with coded name will be created. More... | |
bool | DettachFromParent () |
Detach from parent object. More... | |
void | DisableReading (bool withchlds=true) |
Mark all elements that non of data will be read. More... | |
void | DisableReadingAsChild () |
Disable reading of element when it appears as child in the structure. More... | |
bool | Duplicate (const Hierarchy &src) |
Duplicate hierarchy from the source. More... | |
void | EnableHistory (unsigned length=100, bool withchilds=false) |
Activate history production for selected element and its childs. More... | |
void | EnableReading (const Hierarchy &upto=nullptr) |
Enable element and all its parents to read data. More... | |
void | EnableTimeRecording (bool withchilds=true) |
Enable time recording for hierarchy element every time when item is changed. More... | |
const RecordField & | Field (const std::string &name) const |
bool | FillBinHeader (const std::string &itemname, dabc::Command &cmd, uint64_t mhash=0, const std::string &dflt_master_name="") |
Fill binary header with item and master versions. More... | |
std::string | FindBinaryProducer (std::string &request_name, bool topmost=true) |
Search for parent element, where binary_producer property is specified Returns name of binary producer and item name, which should be requested (relative to producer itself) More... | |
Hierarchy | FindChild (const char *name) |
Return child element from hierarchy. More... | |
Hierarchy | FindMaster () const |
Find master item It is used in ROOT to specify position of streamer info. More... | |
Hierarchy | GetHChild (const std::string &name, bool allowslahes=false, bool force=false, bool sortorder=false) |
Return child, if necessary creates with full subfolder If force specified, missing childs and folders will be recreated If allowslahes enabled, instead of subfolders item with coded name will be created. More... | |
Mutex * | GetHMutex () const |
Hierarchy | GetTop () const |
Returns reference on the top element of the hierarchy. More... | |
uint64_t | GetVersion () const |
Returns actual version of hierarchy entry. More... | |
bool | HasActualRemoteHistory () const |
Returns true if remote history is recorded and it is up-to-date. More... | |
bool | HasLocalHistory () const |
Returns true if item records history local, no need to request any other sources. More... | |
bool | IsAnyFieldChanged () const |
bool | IsBinItemChanged (const std::string &itemname, uint64_t hash, uint64_t last_version=0) |
Return true if one could suppose that binary item is changed and binary data must be regenerated. More... | |
std::string | ItemName () const |
Name which is used as item name in hierarchy. More... | |
HistoryIter | MakeHistoryIter () |
Produce history iterator. More... | |
void | MarkChangedItems (uint64_t tm=0) |
If any field was modified, item will be marked with new version. More... | |
bool | ReadFromBuffer (const dabc::Buffer &buf) |
Read hierarchy from buffer. More... | |
bool | RemoveEmptyFolders (const std::string &path) |
Removes folder and its parents as long as no other childs are present. More... | |
bool | RemoveHChild (const std::string &name, bool allowslahes=false) |
Delete H item, including all empty parent folders. More... | |
dabc::Buffer | SaveToBuffer (unsigned kind=stream_Full, uint64_t version=0, unsigned hlimit=0) |
Save hierarchy in binary form, relative to specified version. More... | |
void | SetPermanent (bool on=true) |
Mark item as permanent - it will not be touched when update from other places will be done. More... | |
void | SetVersion (uint64_t v) |
Change version of the item, only for advanced usage. More... | |
bool | Update (Hierarchy &src) |
Reconstruct complete hierarchy, setting node/structure modifications fields correctly. More... | |
bool | UpdateFromBuffer (const dabc::Buffer &buf, HierarchyStreamKind kind=stream_Full) |
Apply modification to hierarchy, using stored binary data More... | |
Additional Inherited Members | |
Public Member Functions inherited from dabc::Reference | |
bool | AddChild (Object *obj) |
Add child to list of object children. More... | |
const char * | ClassName () const |
Return class name of referenced object, if object not assigned, returns "---". More... | |
void | Destroy () throw () |
Release reference and starts destroyment of referenced object. More... | |
Reference | FindChild (const char *name) const |
Searches for child in referenced object. More... | |
bool | GetAllChildRef (ReferencesVector *vect) const |
Return references for all childs. More... | |
Reference | GetChild (unsigned n) const |
Return reference on child n. More... | |
Reference | GetFolder (const std::string &name, bool force=false) throw () |
Return folder of specified name, no special symbols are allowed. More... | |
const char * | GetName () const |
Return name of referenced object, if object not assigned, returns "---". More... | |
Object * | GetObject () const |
Return pointer on the object. More... | |
Object * | GetParent () const |
Returns pointer on parent object. More... | |
Reference | GetParentRef () const |
Returns reference on parent object. More... | |
bool | IsName (const char *name) const |
Returns true if object name is the same as specified one. More... | |
std::string | ItemName (bool compact=true) const |
Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call. More... | |
bool | null () const |
Returns true if reference contains nullptr. More... | |
unsigned | NumChilds () const |
Return number of childs in referenced object. More... | |
unsigned | NumReferences () const |
Returns number of references on the object. More... | |
bool | operator! () const |
Returns true if reference contains nullptr. More... | |
bool | operator!= (const Reference &src) const |
Compare operator - return true if references refer to different object. More... | |
bool | operator!= (Object *obj) const |
Compare operator - return true if reference refer to different objects. More... | |
Object * | operator() () const |
Return pointer on the object. More... | |
Reference & | operator<< (Reference &src) throw () |
Move operator - reference moved from source to target. More... | |
Reference & | operator= (const Reference &src) throw () |
Assignment operator - copy reference. More... | |
Reference & | operator= (Object *obj) throw () |
Assignment operator - copy reference. More... | |
bool | operator== (const Reference &src) const |
Compare operator - return true if references refer to same object. More... | |
bool | operator== (Object *obj) const |
Compare operator - return true if reference refer to same object. More... | |
void | Print (int lvl=0, const char *from=0) const |
Show on debug output content of reference. More... | |
Reference (const Reference &src) throw () | |
Copy constructor, if source is transient than source reference will be emptied. More... | |
Reference (Object *obj=nullptr) | |
Constructor, creates reference on the object. More... | |
std::string | RelativeName (const dabc::Reference &topitem) |
Produce name, which can be used to find item, calling topitem.FindChild(). More... | |
void | Release () throw () |
Releases reference on the object. More... | |
bool | RemoveChild (const char *name, bool cleanup=true) |
Remove child with given name and return reference on that child. More... | |
bool | RemoveChilds (bool cleanup=true) |
Remove all childs in referenced object If cleanup true (default) and object is owner, all objects will be destroyed. More... | |
void | SetAutoDestroy (bool on=true) |
Set autodestroy flag for the object Once enabled, object will be destroyed when last reference will be cleared. More... | |
void | SetObject (Object *obj, bool withmutex=true) |
Direct set of object to reference. More... | |
Reference | Take () |
Copy reference to output object. More... | |
virtual | ~Reference () |
Destructor, releases reference on the object. More... | |
Protected Member Functions inherited from dabc::Reference | |
bool | AcquireRefWithoutMutex (Reference &ref) |
Special method, which allows to generate new reference when object mutex is locked. More... | |
void | Assign (const Reference &src) |
Method used in copy constructor and assigned operations. More... | |
Mutex * | ObjectMutex () const |
template<class T > | |
bool | verify_object (Object *src, T *&tgt) |
Method used in reference constructor/assignments to verify is object is suitable. More... | |
Protected Attributes inherited from dabc::Reference | |
Object * | fObj |
pointer on the object More... | |
Represents objects hierarchy of remote (or local) DABC process.
Idea to completely replicate folder structure with many attributes, which are stored into HierarchyContainer class. One should be able to convert such hierarchy to/from xml file. Idea to create such hierarchy is to able provide different clients to monitor and control DABC process.
Definition at line 285 of file Hierarchy.h.
|
private |
Create top-level object with specified name.
Definition at line 934 of file Hierarchy.cxx.
|
inlineprivate |
Definition at line 292 of file Hierarchy.h.
|
private |
Find master item It is used in ROOT to specify position of streamer info.
Definition at line 1035 of file Hierarchy.cxx.
|
private |
Search for parent element, where binary_producer property is specified Returns name of binary producer and item name, which should be requested (relative to producer itself)
Definition at line 1098 of file Hierarchy.cxx.
|
inlineprivate |
Definition at line 304 of file Hierarchy.h.
|
inlineprivate |
Definition at line 306 of file Hierarchy.h.
|
private |
Build objects hierarchy, referenced by top.
Definition at line 795 of file Hierarchy.cxx.
|
inlineprivate |
Mark item as permanent - it will not be touched when update from other places will be done.
Definition at line 312 of file Hierarchy.h.
|
private |
Reconstruct complete hierarchy, setting node/structure modifications fields correctly.
source hierarchy can be modified to reuse fields inside
Definition at line 802 of file Hierarchy.cxx.
|
private |
Duplicate hierarchy from the source.
Existing items are preserved
Definition at line 821 of file Hierarchy.cxx.
|
private |
Activate history production for selected element and its childs.
Definition at line 837 of file Hierarchy.cxx.
|
inlineprivate |
Enable time recording for hierarchy element every time when item is changed.
Definition at line 326 of file Hierarchy.h.
|
inlineprivate |
If any field was modified, item will be marked with new version.
Definition at line 330 of file Hierarchy.h.
|
private |
Returns true if item records history local, no need to request any other sources.
Definition at line 857 of file Hierarchy.cxx.
|
private |
Returns true if remote history is recorded and it is up-to-date.
Definition at line 863 of file Hierarchy.cxx.
|
private |
Save hierarchy in binary form, relative to specified version.
Definition at line 873 of file Hierarchy.cxx.
|
private |
Read hierarchy from buffer.
Definition at line 896 of file Hierarchy.cxx.
|
private |
Apply modification to hierarchy, using stored binary data
Definition at line 912 of file Hierarchy.cxx.
|
inlineprivate |
Returns actual version of hierarchy entry.
Definition at line 349 of file Hierarchy.h.
|
inlineprivate |
Change version of the item, only for advanced usage.
Definition at line 352 of file Hierarchy.h.
|
private |
Return true if one could suppose that binary item is changed and binary data must be regenerated.
First of all version is proved and than hash (if available)
Definition at line 1047 of file Hierarchy.cxx.
|
private |
Fill binary header with item and master versions.
Definition at line 1070 of file Hierarchy.cxx.
|
inlineprivate |
Return child element from hierarchy.
Definition at line 362 of file Hierarchy.h.
|
private |
Removes folder and its parents as long as no other childs are present.
Definition at line 1117 of file Hierarchy.cxx.
|
private |
Name which is used as item name in hierarchy.
Name of top object is not included
Definition at line 1133 of file Hierarchy.cxx.
|
private |
Returns reference on the top element of the hierarchy.
Definition at line 1139 of file Hierarchy.cxx.
|
private |
Detach from parent object.
Definition at line 1150 of file Hierarchy.cxx.
|
private |
Mark all elements that non of data will be read.
Definition at line 1157 of file Hierarchy.cxx.
|
private |
Disable reading of element when it appears as child in the structure.
Definition at line 1162 of file Hierarchy.cxx.
|
private |
Enable element and all its parents to read data.
Definition at line 1167 of file Hierarchy.cxx.
|
private |
Return child, if necessary creates with full subfolder If force specified, missing childs and folders will be recreated If allowslahes enabled, instead of subfolders item with coded name will be created.
Definition at line 944 of file Hierarchy.cxx.
|
inlineprivate |
Create child item in hierarchy with specified name If allowslahes enabled, instead of subfolders item with coded name will be created.
Definition at line 392 of file Hierarchy.h.
|
private |
Delete H item, including all empty parent folders.
Definition at line 1018 of file Hierarchy.cxx.
|
inlineprivate |
Create folder in hierarchy, one could use it to add new childs to it.
Definition at line 399 of file Hierarchy.h.
|
private |
Produce history iterator.
Definition at line 1236 of file Hierarchy.cxx.