Qore DataProvider Module Reference  2.0
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 
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 
203 
204 
206 
211 
212 
214 
216  removeChild(string child);
217 
218 
221 
222 
224  bool clear();
225 
226 
228 
231 
232 
234 private:
236 public:
237 
238 
240 
242 private:
244 public:
245 
246 };
247 };
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:91
the DataProviderTypeEntry class
Definition: DataProviderTypeEntry.qc.dox.h:55
bool setType(AbstractDataProviderType type, bool locked=False)
Sets the type for the entry.
bool isParent()
Returns True if the entry is a "parent" entry, meaning that all children were added with this entry.
bool clear()
Clears the type hierarchy of all non-locked types.
constructor()
Creates the entry as a root node.
string getPath()
Returns the path of the entry.
*AbstractDataProviderType getType()
Returns the type at the entry level, if any.
setTypeChildren()
Sets up attributes as children.
constructor(string path, string name)
Creates the entry as a child node.
*list< string > listTypes()
Returns a list of registered data provider type paths.
*AbstractDataProviderType getTypeEx()
Returns the type at the entry level, if any, otherwise throws an exception.
*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
constructor(string path, string name, AbstractDataProviderType type)
Creates the entry as a child node.
*hash< string, DataProviderTypeEntry > type_children
Names of attributes that can be referenced as children.
Definition: DataProviderTypeEntry.qc.dox.h:69
bool hasType()
Returns True if the entry has a type.
string path
The path to this entry.
Definition: DataProviderTypeEntry.qc.dox.h:60
lockAll()
Locks all types.
bool locked
True if the entry is locked and therefore cannot be deleted or updated
Definition: DataProviderTypeEntry.qc.dox.h:80
*DataProviderTypeEntry getChildEx(string child)
Returns the given child, if any, otherwise throws an exception.
string getName()
Returns the name of the entry.
addChild(string child)
Adds a child node to the entry.
*list< string > getChildNames()
Returns a list of child entry names, if any.
removeChild(string child)
Removes the given child, if it exists.
hash< DataProviderTypeEntryInfo > getInfo(*bool rec_children_only)
Returns information about this entry.
bool lock()
Locks the entry, so it can't be removed or changed.
*AbstractDataProviderType type
The type at this location.
Definition: DataProviderTypeEntry.qc.dox.h:75
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
*list< string > listParentTypes()
Returns a list of registered data provider type paths where each type listed is a "parent" type.
string name
The name of this entry.
Definition: DataProviderTypeEntry.qc.dox.h:63
DataProviderTypeEntry getCreateChild(string child)
Returns the given child and creates it if necessary.
*AbstractDataProviderType setOrReplaceType(AbstractDataProviderType type)
Sets or replaces the type for the entry.
*DataProviderTypeEntry getChild(string child)
Returns the given child, if any.
*hash< string, DataProviderTypeEntry > children
Children of this entry.
Definition: DataProviderTypeEntry.qc.dox.h:66
const False
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
Data provider type entry info.
Definition: DataProviderTypeEntry.qc.dox.h:33
*list< string > children
The names of any children.
Definition: DataProviderTypeEntry.qc.dox.h:51
string name
The name of the entry.
Definition: DataProviderTypeEntry.qc.dox.h:35
bool locked
True if the entry is locked and therefore cannot be deleted or updated
Definition: DataProviderTypeEntry.qc.dox.h:48
bool has_type
True if the entry has a type
Definition: DataProviderTypeEntry.qc.dox.h:43
string path
The path to the entry including the name as the last element.
Definition: DataProviderTypeEntry.qc.dox.h:38