Qore DataProvider Module Reference  1.2.1
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 
82 public:
83 
85 
87  constructor();
88 
89 
91 
93  constructor(string path, string name);
94 
95 
97  string getName();
98 
99 
101  string getPath();
102 
103 
105  bool hasType();
106 
107 
109 
115  bool lock();
116 
117 
119 
123  addChild(string child);
124 
125 
127 
135 
136 
138 
145 
146 
148 
152  hash<DataProviderTypeEntryInfo> getInfo(*bool rec_children_only);
153 
154 
156 
160  *list<string> listTypes();
161 
162 
164 
166  *list<string> getChildNames();
167 
168 
170 
173 
174 
176 
181 
182 
184 
186  *DataProviderTypeEntry getChild(string child);
187 
188 
190 
194  *DataProviderTypeEntry getChildEx(string child);
195 
196 
198 
200  removeChild(string child);
201 
202 
204  lockAll();
205 
206 
208  bool clear();
209 
210 
212 
215 
216 
218 private:
219  setTypeChildren();
220 public:
221 
222 
224 
226 private:
228 public:
229 
230 };
231 };
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.
*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.
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:88
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 > 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.