Qore DataProvider Module Reference  2.1.2
DataProviderTypeEntry.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 // assume local scope for variables, do not use "$" signs
26 // require type definitions everywhere
27 // strict argument handling
28 // enable all warnings
29 
31 namespace DataProvider {
35  string name;
36 
38  string path;
39 
41 
43  bool has_type;
44 
46 
48  bool locked = False;
49 
51  *list<string> children;
52 };
53 
55 class DataProviderTypeEntry : public Serializable {
56 
57 public:
58 protected:
60  string path;
61 
63  string name;
64 
66  *hash<string, DataProviderTypeEntry> children;
67 
69  *hash<string, DataProviderTypeEntry> type_children;
70 
72  *hash<string, DataProviderTypeEntry> rec_children;
73 
76 
78 
80  bool locked = False;
81 
83  bool parent = False;
84 
85 public:
86 
88 
90  constructor();
91 
92 
94 
96  constructor(string path, string name);
97 
98 
100  string getName();
101 
102 
104  string getPath();
105 
106 
108  bool hasType();
109 
110 
112  bool isParent();
113 
114 
116 
122  bool lock();
123 
124 
126 
130  addChild(string child);
131 
132 
134 
142 
143 
145 
152 
153 
155 
159  hash<DataProviderTypeEntryInfo> getInfo(*bool rec_children_only);
160 
161 
163 
167  *list<string> listTypes();
168 
169 
171 
176  *list<string> listParentTypes();
177 
178 
180 
182  *list<string> getChildNames();
183 
184 
186 
189 
190 
192 
197 
198 
200 
202  *DataProviderTypeEntry getChild(string child);
203 
204 
206 
210  *DataProviderTypeEntry getChildEx(string child);
211 
212 
214 
216  removeChild(string child);
217 
218 
220  lockAll();
221 
222 
224  bool clear();
225 
226 
228 
231 
232 
234 private:
235  setTypeChildren();
236 public:
237 
238 
240 
242 private:
244 public:
245 
246 };
247 };
bool lock()
Locks the entry, so it can&#39;t be removed or changed.
bool setType(AbstractDataProviderType type, bool locked=False)
Sets the type for the entry.
string name
The name of this entry.
Definition: DataProviderTypeEntry.qc.dox.h:63
the DataProviderTypeEntry class
Definition: DataProviderTypeEntry.qc.dox.h:55
*AbstractDataProviderType setOrReplaceType(AbstractDataProviderType type)
Sets or replaces the type for the entry.
constructor()
Creates the entry as a root node.
*AbstractDataProviderType getType()
Returns the type at the entry level, if any.
bool isParent()
Returns True if the entry is a "parent" entry, meaning that all children were added with this entry...
*hash< string, DataProviderTypeEntry > children
Children of this entry.
Definition: DataProviderTypeEntry.qc.dox.h:66
*DataProviderTypeEntry getChild(string child)
Returns the given child, if any.
*AbstractDataProviderType getTypeEx()
Returns the type at the entry level, if any, otherwise throws an exception.
setTypeChildren()
Sets up attributes as children.
const False
string name
The name of the entry.
Definition: DataProviderTypeEntry.qc.dox.h:35
string path
The path to the entry including the name as the last element.
Definition: DataProviderTypeEntry.qc.dox.h:38
bool clear()
Clears the type hierarchy of all non-locked types.
bool locked
True if the entry is locked and therefore cannot be deleted or updated
Definition: DataProviderTypeEntry.qc.dox.h:80
lockAll()
Locks all types.
bool parent
True if this entry is a "parent" type; if the children were added atomically with this entry ...
Definition: DataProviderTypeEntry.qc.dox.h:83
string getName()
Returns the name of the entry.
bool hasType()
Returns True if the entry has a type.
*hash< string, DataProviderTypeEntry > type_children
Names of attributes that can be referenced as children.
Definition: DataProviderTypeEntry.qc.dox.h:69
*hash< string, DataProviderTypeEntry > rec_children
Names of attributes that can be referenced as children that have their own fields.
Definition: DataProviderTypeEntry.qc.dox.h:72
bool locked
True if the entry is locked and therefore cannot be deleted or updated
Definition: DataProviderTypeEntry.qc.dox.h:48
removeChild(string child)
Removes the given child, if it exists.
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:105
string getPath()
Returns the path of the entry.
*DataProviderTypeEntry getChildEx(string child)
Returns the given child, if any, otherwise throws an exception.
string path
The path to this entry.
Definition: DataProviderTypeEntry.qc.dox.h:60
*list< string > listParentTypes()
Returns a list of registered data provider type paths where each type listed is a "parent" type...
*list< string > getChildNames()
Returns a list of child entry names, if any.
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProviderTypeEntry getCreateChild(string child)
Returns the given child and creates it if necessary.
Data provider type entry info.
Definition: DataProviderTypeEntry.qc.dox.h:33
*AbstractDataProviderType type
The type at this location.
Definition: DataProviderTypeEntry.qc.dox.h:75
hash< DataProviderTypeEntryInfo > getInfo(*bool rec_children_only)
Returns information about this entry.
*list< string > listTypes()
Returns a list of registered data provider type paths.
*list< string > children
The names of any children.
Definition: DataProviderTypeEntry.qc.dox.h:51
bool has_type
True if the entry has a type
Definition: DataProviderTypeEntry.qc.dox.h:43
addChild(string child)
Adds a child node to the entry.