le_cfg_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_cfg_common.h
12  *
13  * Type definitions for le_cfg.
14  *
15  */
16 #ifndef LE_CFG_COMMON_H_INCLUDE_GUARD
17 #define LE_CFG_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_CFG_PROTOCOL_ID "4db45ee4887ce0305738f97e9c15d721"
23 #define IFGEN_LE_CFG_MSG_SIZE 9241
24 /** @addtogroup le_cfg
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Length of the strings used by this API.
31  */
32 //--------------------------------------------------------------------------------------------------
33 #define LE_CFG_STR_LEN 511
34 
35 //--------------------------------------------------------------------------------------------------
36 /**
37  * Length of the strings used by this API, including the trailing NULL.
38  */
39 //--------------------------------------------------------------------------------------------------
40 #define LE_CFG_STR_LEN_BYTES 512
41 
42 //--------------------------------------------------------------------------------------------------
43 /**
44  * Length of the binary data used by this API.
45  */
46 //--------------------------------------------------------------------------------------------------
47 #define LE_CFG_BINARY_LEN 8704
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  * Allowed length of a node name.
52  */
53 //--------------------------------------------------------------------------------------------------
54 #define LE_CFG_NAME_LEN 255
55 
56 //--------------------------------------------------------------------------------------------------
57 /**
58  * The node name length, including a trailing NULL.
59  */
60 //--------------------------------------------------------------------------------------------------
61 #define LE_CFG_NAME_LEN_BYTES 256
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  * Reference to a tree iterator object.
66  */
67 //--------------------------------------------------------------------------------------------------
68 typedef struct le_cfg_Iterator* le_cfg_IteratorRef_t;
69 
70 
71 //--------------------------------------------------------------------------------------------------
72 /**
73  * Identifies the data type of node.
74  */
75 //--------------------------------------------------------------------------------------------------
76 typedef enum
77 {
79  ///< A node with no value.
81  ///< A string encoded as utf8.
83  ///< Boolean value.
85  ///< Signed 32-bit.
87  ///< 64-bit floating point value.
89  ///< Non-leaf node, this node is the parent of other nodes.
91  ///< Node doesn't exist.
92 }
94 
95 
96 //--------------------------------------------------------------------------------------------------
97 /**
98  * Reference type used by Add/Remove functions for EVENT 'le_cfg_Change'
99  */
100 //--------------------------------------------------------------------------------------------------
101 typedef struct le_cfg_ChangeHandler* le_cfg_ChangeHandlerRef_t;
102 
103 
104 //--------------------------------------------------------------------------------------------------
105 /**
106  * Handler for node change notifications.
107  */
108 //--------------------------------------------------------------------------------------------------
109 typedef void (*le_cfg_ChangeHandlerFunc_t)
110 (
111  void* contextPtr
112  ///<
113 );
114 
115 
116 //--------------------------------------------------------------------------------------------------
117 /**
118  * Get if this client bound locally.
119  */
120 //--------------------------------------------------------------------------------------------------
121 LE_SHARED bool ifgen_le_cfg_HasLocalBinding
122 (
123  void
124 );
125 
126 
127 //--------------------------------------------------------------------------------------------------
128 /**
129  * Init data that is common across all threads
130  */
131 //--------------------------------------------------------------------------------------------------
132 LE_SHARED void ifgen_le_cfg_InitCommonData
133 (
134  void
135 );
136 
137 
138 //--------------------------------------------------------------------------------------------------
139 /**
140  * Perform common initialization and open a session
141  */
142 //--------------------------------------------------------------------------------------------------
143 LE_SHARED le_result_t ifgen_le_cfg_OpenSession
144 (
145  le_msg_SessionRef_t _ifgen_sessionRef,
146  bool isBlocking
147 );
148 
149 //--------------------------------------------------------------------------------------------------
150 /**
151  * Create a read transaction and open a new iterator for traversing the config tree.
152  *
153  * This action creates a read lock on the given tree, which will start a read-timeout.
154  * Once the read timeout expires, all active read iterators on that tree will be
155  * expired and their clients will be killed.
156  *
157  * @note A tree transaction is global to that tree; a long-held read transaction will block other
158  * user's write transactions from being committed.
159  *
160  * @return This will return the newly created iterator reference.
161  */
162 //--------------------------------------------------------------------------------------------------
163 LE_SHARED le_cfg_IteratorRef_t ifgen_le_cfg_CreateReadTxn
164 (
165  le_msg_SessionRef_t _ifgen_sessionRef,
166  const char* LE_NONNULL basePath
167  ///< [IN] Path to the location to create the new iterator.
168 );
169 
170 //--------------------------------------------------------------------------------------------------
171 /**
172  * Create a write transaction and open a new iterator for both reading and writing.
173  *
174  * This action creates a write transaction. If the app holds the iterator for
175  * longer than the configured write transaction timeout, the iterator will cancel the
176  * transaction. Other reads will fail to return data, and all writes will be thrown away.
177  *
178  * @note A tree transaction is global to that tree; a long-held write transaction will block
179  * other user's write transactions from being started. Other trees in the system
180  * won't be affected.
181  *
182  * @return This will return a newly created iterator reference.
183  */
184 //--------------------------------------------------------------------------------------------------
185 LE_SHARED le_cfg_IteratorRef_t ifgen_le_cfg_CreateWriteTxn
186 (
187  le_msg_SessionRef_t _ifgen_sessionRef,
188  const char* LE_NONNULL basePath
189  ///< [IN] Path to the location to create the new iterator.
190 );
191 
192 //--------------------------------------------------------------------------------------------------
193 /**
194  * Closes the write iterator and commits the write transaction. This updates the config tree
195  * with all of the writes that occurred within the iterator.
196  *
197  * @note This operation will also delete the iterator object.
198  */
199 //--------------------------------------------------------------------------------------------------
200 LE_SHARED void ifgen_le_cfg_CommitTxn
201 (
202  le_msg_SessionRef_t _ifgen_sessionRef,
203  le_cfg_IteratorRef_t iteratorRef
204  ///< [IN] Iterator object to commit.
205 );
206 
207 //--------------------------------------------------------------------------------------------------
208 /**
209  * Closes and frees the given iterator object. If the iterator is a write iterator, the transaction
210  * will be canceled. If the iterator is a read iterator, the transaction will be closed. No data is
211  * written to the tree
212  *
213  * @note This operation will also delete the iterator object.
214  */
215 //--------------------------------------------------------------------------------------------------
216 LE_SHARED void ifgen_le_cfg_CancelTxn
217 (
218  le_msg_SessionRef_t _ifgen_sessionRef,
219  le_cfg_IteratorRef_t iteratorRef
220  ///< [IN] Iterator object to close.
221 );
222 
223 //--------------------------------------------------------------------------------------------------
224 /**
225  * Changes the location of iterator. The path passed can be an absolute or a
226  * relative path from the iterators current location.
227  *
228  * The target node does not need to exist. Writing a value to a non-existent node will
229  * automatically create that node and any ancestor nodes (parent, parent's parent, etc.) that
230  * also don't exist.
231  */
232 //--------------------------------------------------------------------------------------------------
233 LE_SHARED void ifgen_le_cfg_GoToNode
234 (
235  le_msg_SessionRef_t _ifgen_sessionRef,
236  le_cfg_IteratorRef_t iteratorRef,
237  ///< [IN] Iterator to move.
238  const char* LE_NONNULL newPath
239  ///< [IN] Absolute or relative path from the current location.
240 );
241 
242 //--------------------------------------------------------------------------------------------------
243 /**
244  * Move the iterator to the parent of the current node (moves up the tree).
245  *
246  * @return Return code will be one of the following values:
247  *
248  * - LE_OK - Commit was completed successfully.
249  * - LE_NOT_FOUND - Current node is the root node: has no parent.
250  */
251 //--------------------------------------------------------------------------------------------------
252 LE_SHARED le_result_t ifgen_le_cfg_GoToParent
253 (
254  le_msg_SessionRef_t _ifgen_sessionRef,
255  le_cfg_IteratorRef_t iteratorRef
256  ///< [IN] Iterator to move.
257 );
258 
259 //--------------------------------------------------------------------------------------------------
260 /**
261  * Moves the iterator to the the first child of the node from the current location.
262  *
263  * For read iterators without children, this function will fail. If the iterator is a write
264  * iterator, then a new node is automatically created. If this node or newly created
265  * children of this node are not written to, then this node will not persist even if the iterator is
266  * committed.
267  *
268  * @return Return code will be one of the following values:
269  *
270  * - LE_OK - Move was completed successfully.
271  * - LE_NOT_FOUND - The given node has no children.
272  */
273 //--------------------------------------------------------------------------------------------------
274 LE_SHARED le_result_t ifgen_le_cfg_GoToFirstChild
275 (
276  le_msg_SessionRef_t _ifgen_sessionRef,
277  le_cfg_IteratorRef_t iteratorRef
278  ///< [IN] Iterator object to move.
279 );
280 
281 //--------------------------------------------------------------------------------------------------
282 /**
283  * Jumps the iterator to the next child node of the current node. Assuming the following tree:
284  *
285  * @code
286  * baseNode
287  * |
288  * +childA
289  * |
290  * +valueA
291  * |
292  * +valueB
293  * @endcode
294  *
295  * If the iterator is moved to the path, "/baseNode/childA/valueA". After the first
296  * GoToNextSibling the iterator will be pointing at valueB. A second call to GoToNextSibling
297  * will cause the function to return LE_NOT_FOUND.
298  *
299  * @return Returns one of the following values:
300  *
301  * - LE_OK - Commit was completed successfully.
302  * - LE_NOT_FOUND - Iterator has reached the end of the current list of siblings.
303  * Also returned if the the current node has no siblings.
304  */
305 //--------------------------------------------------------------------------------------------------
306 LE_SHARED le_result_t ifgen_le_cfg_GoToNextSibling
307 (
308  le_msg_SessionRef_t _ifgen_sessionRef,
309  le_cfg_IteratorRef_t iteratorRef
310  ///< [IN] Iterator to iterate.
311 );
312 
313 //--------------------------------------------------------------------------------------------------
314 /**
315  * Get path to the node where the iterator is currently pointed.
316  *
317  * Assuming the following tree:
318  *
319  * @code
320  * baseNode
321  * |
322  * +childA
323  * |
324  * +valueA
325  * |
326  * +valueB
327  * @endcode
328  *
329  * If the iterator was currently pointing at valueA, GetPath would return the following path:
330  *
331  * @code
332  * /baseNode/childA/valueA
333  * @endcode
334  *
335  * Optionally, a path to another node can be supplied to this function. So, if the iterator is
336  * again on valueA and the relative path ".." is supplied then this function will return the
337  * the path relative to the node given:
338  *
339  * @code
340  * /baseNode/childA/
341  * @endcode
342  *
343  * @return - LE_OK - The write was completed successfully.
344  * - LE_OVERFLOW - The supplied string buffer was not large enough to hold the value.
345  */
346 //--------------------------------------------------------------------------------------------------
347 LE_SHARED le_result_t ifgen_le_cfg_GetPath
348 (
349  le_msg_SessionRef_t _ifgen_sessionRef,
350  le_cfg_IteratorRef_t iteratorRef,
351  ///< [IN] Iterator to move.
352  const char* LE_NONNULL path,
353  ///< [IN] Path to the target node. Can be an absolute path, or
354  ///< a path relative from the iterator's current position.
355  char* pathBuffer,
356  ///< [OUT] Absolute path to the iterator's current node.
357  size_t pathBufferSize
358  ///< [IN]
359 );
360 
361 //--------------------------------------------------------------------------------------------------
362 /**
363  * Get the data type of node where the iterator is currently pointing.
364  *
365  * @return le_cfg_nodeType_t value indicating the stored value.
366  */
367 //--------------------------------------------------------------------------------------------------
368 LE_SHARED le_cfg_nodeType_t ifgen_le_cfg_GetNodeType
369 (
370  le_msg_SessionRef_t _ifgen_sessionRef,
371  le_cfg_IteratorRef_t iteratorRef,
372  ///< [IN] Iterator object to use to read from the tree.
373  const char* LE_NONNULL path
374  ///< [IN] Path to the target node. Can be an absolute path, or
375  ///< a path relative from the iterator's current position.
376 );
377 
378 //--------------------------------------------------------------------------------------------------
379 /**
380  * Get the name of the node where the iterator is currently pointing.
381  *
382  * @return - LE_OK Read was completed successfully.
383  * - LE_OVERFLOW Supplied string buffer was not large enough to hold the value.
384  */
385 //--------------------------------------------------------------------------------------------------
386 LE_SHARED le_result_t ifgen_le_cfg_GetNodeName
387 (
388  le_msg_SessionRef_t _ifgen_sessionRef,
389  le_cfg_IteratorRef_t iteratorRef,
390  ///< [IN] Iterator object to use to read from the tree.
391  const char* LE_NONNULL path,
392  ///< [IN] Path to the target node. Can be an absolute path, or
393  ///< a path relative from the iterator's current position.
394  char* name,
395  ///< [OUT] Read the name of the node object.
396  size_t nameSize
397  ///< [IN]
398 );
399 
400 //--------------------------------------------------------------------------------------------------
401 /**
402  * Add handler function for EVENT 'le_cfg_Change'
403  *
404  * This event provides information on changes to the given node object, or any of it's children,
405  * where a change could be either a read, write, create or delete operation.
406  */
407 //--------------------------------------------------------------------------------------------------
408 LE_SHARED le_cfg_ChangeHandlerRef_t ifgen_le_cfg_AddChangeHandler
409 (
410  le_msg_SessionRef_t _ifgen_sessionRef,
411  const char* LE_NONNULL newPath,
412  ///< [IN] Path to the object to watch.
413  le_cfg_ChangeHandlerFunc_t handlerPtr,
414  ///< [IN] Handler to receive change notification
415  void* contextPtr
416  ///< [IN]
417 );
418 
419 //--------------------------------------------------------------------------------------------------
420 /**
421  * Remove handler function for EVENT 'le_cfg_Change'
422  */
423 //--------------------------------------------------------------------------------------------------
424 LE_SHARED void ifgen_le_cfg_RemoveChangeHandler
425 (
426  le_msg_SessionRef_t _ifgen_sessionRef,
427  le_cfg_ChangeHandlerRef_t handlerRef
428  ///< [IN]
429 );
430 
431 //--------------------------------------------------------------------------------------------------
432 /**
433  * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child
434  * nodes are also deleted.
435  *
436  * If the path is empty, the iterator's current node is deleted.
437  *
438  * This function is only valid during a write transaction.
439  */
440 //--------------------------------------------------------------------------------------------------
441 LE_SHARED void ifgen_le_cfg_DeleteNode
442 (
443  le_msg_SessionRef_t _ifgen_sessionRef,
444  le_cfg_IteratorRef_t iteratorRef,
445  ///< [IN] Iterator to use as a basis for the transaction.
446  const char* LE_NONNULL path
447  ///< [IN] Path to the target node. Can be an absolute path, or
448  ///< a path relative from the iterator's current position.
449 );
450 
451 //--------------------------------------------------------------------------------------------------
452 /**
453  * Check if the given node is empty. A node is also considered empty if it doesn't yet exist. A
454  * node is also considered empty if it has no value or is a stem with no children.
455  *
456  * If the path is empty, the iterator's current node is queried for emptiness.
457  *
458  * Valid for both read and write transactions.
459  *
460  * @return A true if the node is considered empty, false if not.
461  */
462 //--------------------------------------------------------------------------------------------------
463 LE_SHARED bool ifgen_le_cfg_IsEmpty
464 (
465  le_msg_SessionRef_t _ifgen_sessionRef,
466  le_cfg_IteratorRef_t iteratorRef,
467  ///< [IN] Iterator to use as a basis for the transaction.
468  const char* LE_NONNULL path
469  ///< [IN] Path to the target node. Can be an absolute path, or
470  ///< a path relative from the iterator's current position.
471 );
472 
473 //--------------------------------------------------------------------------------------------------
474 /**
475  * Clears out the node's value. If the node doesn't exist it will be created, and have no value.
476  *
477  * If the path is empty, the iterator's current node will be cleared. If the node is a stem
478  * then all children will be removed from the tree.
479  *
480  * Only valid during a write transaction.
481  */
482 //--------------------------------------------------------------------------------------------------
483 LE_SHARED void ifgen_le_cfg_SetEmpty
484 (
485  le_msg_SessionRef_t _ifgen_sessionRef,
486  le_cfg_IteratorRef_t iteratorRef,
487  ///< [IN] Iterator to use as a basis for the transaction.
488  const char* LE_NONNULL path
489  ///< [IN] Path to the target node. Can be an absolute path, or
490  ///< a path relative from the iterator's current position.
491 );
492 
493 //--------------------------------------------------------------------------------------------------
494 /**
495  * Checks to see if a given node in the config tree exists.
496  *
497  * @return True if the specified node exists in the tree. False if not.
498  */
499 //--------------------------------------------------------------------------------------------------
500 LE_SHARED bool ifgen_le_cfg_NodeExists
501 (
502  le_msg_SessionRef_t _ifgen_sessionRef,
503  le_cfg_IteratorRef_t iteratorRef,
504  ///< [IN] Iterator to use as a basis for the transaction.
505  const char* LE_NONNULL path
506  ///< [IN] Path to the target node. Can be an absolute path, or
507  ///< a path relative from the iterator's current position.
508 );
509 
510 //--------------------------------------------------------------------------------------------------
511 /**
512  * Reads a string value from the config tree. If the value isn't a string, or if the node is
513  * empty or doesn't exist, the default value will be returned.
514  *
515  * Valid for both read and write transactions.
516  *
517  * If the path is empty, the iterator's current node will be read.
518  *
519  * @return - LE_OK - Read was completed successfully.
520  * - LE_OVERFLOW - Supplied string buffer was not large enough to hold the value.
521  */
522 //--------------------------------------------------------------------------------------------------
523 LE_SHARED le_result_t ifgen_le_cfg_GetString
524 (
525  le_msg_SessionRef_t _ifgen_sessionRef,
526  le_cfg_IteratorRef_t iteratorRef,
527  ///< [IN] Iterator to use as a basis for the transaction.
528  const char* LE_NONNULL path,
529  ///< [IN] Path to the target node. Can be an absolute path,
530  ///< or a path relative from the iterator's current
531  ///< position.
532  char* value,
533  ///< [OUT] Buffer to write the value into.
534  size_t valueSize,
535  ///< [IN]
536  const char* LE_NONNULL defaultValue
537  ///< [IN] Default value to use if the original can't be
538  ///< read.
539 );
540 
541 //--------------------------------------------------------------------------------------------------
542 /**
543  * Writes a string value to the config tree. Only valid during a write
544  * transaction.
545  *
546  * If the path is empty, the iterator's current node will be set.
547  */
548 //--------------------------------------------------------------------------------------------------
549 LE_SHARED void ifgen_le_cfg_SetString
550 (
551  le_msg_SessionRef_t _ifgen_sessionRef,
552  le_cfg_IteratorRef_t iteratorRef,
553  ///< [IN] Iterator to use as a basis for the transaction.
554  const char* LE_NONNULL path,
555  ///< [IN] Path to the target node. Can be an absolute path, or
556  ///< a path relative from the iterator's current position.
557  const char* LE_NONNULL value
558  ///< [IN] Value to write.
559 );
560 
561 //--------------------------------------------------------------------------------------------------
562 /**
563  * Read a binary data from the config tree. If the the node has a wrong type, is
564  * empty or doesn't exist, the default value will be returned.
565  *
566  * Valid for both read and write transactions.
567  *
568  * If the path is empty, the iterator's current node will be read.
569  *
570  * \b Responds \b With:
571  *
572  * This function will respond with one of the following values:
573  *
574  * - LE_OK - Read was completed successfully.
575  * - LE_FORMAT_ERROR - if data can't be decoded.
576  * - LE_OVERFLOW - Supplied buffer was not large enough to hold the value.
577  */
578 //--------------------------------------------------------------------------------------------------
579 LE_SHARED le_result_t ifgen_le_cfg_GetBinary
580 (
581  le_msg_SessionRef_t _ifgen_sessionRef,
582  le_cfg_IteratorRef_t iteratorRef,
583  ///< [IN] Iterator to use as a basis for the transaction.
584  const char* LE_NONNULL path,
585  ///< [IN] Path to the target node. Can be an absolute path,
586  ///< or a path relative from the iterator's current
587  ///< position.
588  uint8_t* valuePtr,
589  ///< [OUT] Buffer to write the value into.
590  size_t* valueSizePtr,
591  ///< [INOUT]
592  const uint8_t* defaultValuePtr,
593  ///< [IN] Default value to use if the original can't be
594  ///< read.
595  size_t defaultValueSize
596  ///< [IN]
597 );
598 
599 //--------------------------------------------------------------------------------------------------
600 /**
601  * Write a binary data to the config tree. Only valid during a write
602  * transaction.
603  *
604  * If the path is empty, the iterator's current node will be set.
605  *
606  * @note Binary data cannot be written to the 'system' tree.
607  */
608 //--------------------------------------------------------------------------------------------------
609 LE_SHARED void ifgen_le_cfg_SetBinary
610 (
611  le_msg_SessionRef_t _ifgen_sessionRef,
612  le_cfg_IteratorRef_t iteratorRef,
613  ///< [IN] Iterator to use as a basis for the transaction.
614  const char* LE_NONNULL path,
615  ///< [IN] Path to the target node. Can be an absolute path, or
616  ///< a path relative from the iterator's current position.
617  const uint8_t* valuePtr,
618  ///< [IN] Value to write.
619  size_t valueSize
620  ///< [IN]
621 );
622 
623 //--------------------------------------------------------------------------------------------------
624 /**
625  * Reads a signed integer value from the config tree.
626  *
627  * If the underlying value is not an integer, the default value will be returned instead. The
628  * default value is also returned if the node does not exist or if it's empty.
629  *
630  * If the value is a floating point value, then it will be rounded and returned as an integer.
631  *
632  * Valid for both read and write transactions.
633  *
634  * If the path is empty, the iterator's current node will be read.
635  */
636 //--------------------------------------------------------------------------------------------------
637 LE_SHARED int32_t ifgen_le_cfg_GetInt
638 (
639  le_msg_SessionRef_t _ifgen_sessionRef,
640  le_cfg_IteratorRef_t iteratorRef,
641  ///< [IN] Iterator to use as a basis for the transaction.
642  const char* LE_NONNULL path,
643  ///< [IN] Path to the target node. Can be an absolute path, or
644  ///< a path relative from the iterator's current position.
645  int32_t defaultValue
646  ///< [IN] Default value to use if the original can't be
647  ///< read.
648 );
649 
650 //--------------------------------------------------------------------------------------------------
651 /**
652  * Writes a signed integer value to the config tree. Only valid during a
653  * write transaction.
654  *
655  * If the path is empty, the iterator's current node will be set.
656  */
657 //--------------------------------------------------------------------------------------------------
658 LE_SHARED void ifgen_le_cfg_SetInt
659 (
660  le_msg_SessionRef_t _ifgen_sessionRef,
661  le_cfg_IteratorRef_t iteratorRef,
662  ///< [IN] Iterator to use as a basis for the transaction.
663  const char* LE_NONNULL path,
664  ///< [IN] Path to the target node. Can be an absolute path, or
665  ///< a path relative from the iterator's current position.
666  int32_t value
667  ///< [IN] Value to write.
668 );
669 
670 //--------------------------------------------------------------------------------------------------
671 /**
672  * Reads a 64-bit floating point value from the config tree.
673  *
674  * If the value is an integer then the value will be promoted to a float. Otherwise, if the
675  * underlying value is not a float or integer, the default value will be returned.
676  *
677  * If the path is empty, the iterator's current node will be read.
678  *
679  * @note Floating point values will only be stored up to 6 digits of precision.
680  */
681 //--------------------------------------------------------------------------------------------------
682 LE_SHARED double ifgen_le_cfg_GetFloat
683 (
684  le_msg_SessionRef_t _ifgen_sessionRef,
685  le_cfg_IteratorRef_t iteratorRef,
686  ///< [IN] Iterator to use as a basis for the transaction.
687  const char* LE_NONNULL path,
688  ///< [IN] Path to the target node. Can be an absolute path, or
689  ///< a path relative from the iterator's current position.
690  double defaultValue
691  ///< [IN] Default value to use if the original can't be
692  ///< read.
693 );
694 
695 //--------------------------------------------------------------------------------------------------
696 /**
697  * Writes a 64-bit floating point value to the config tree. Only valid
698  * during a write transaction.
699  *
700  * If the path is empty, the iterator's current node will be set.
701  *
702  * @note Floating point values will only be stored up to 6 digits of precision.
703  */
704 //--------------------------------------------------------------------------------------------------
705 LE_SHARED void ifgen_le_cfg_SetFloat
706 (
707  le_msg_SessionRef_t _ifgen_sessionRef,
708  le_cfg_IteratorRef_t iteratorRef,
709  ///< [IN] Iterator to use as a basis for the transaction.
710  const char* LE_NONNULL path,
711  ///< [IN] Path to the target node. Can be an absolute path, or
712  ///< a path relative from the iterator's current position.
713  double value
714  ///< [IN] Value to write.
715 );
716 
717 //--------------------------------------------------------------------------------------------------
718 /**
719  * Reads a value from the tree as a boolean. If the node is empty or doesn't exist, the default
720  * value is returned. Default value is also returned if the node is a different type than
721  * expected.
722  *
723  * Valid for both read and write transactions.
724  *
725  * If the path is empty, the iterator's current node will be read.
726  */
727 //--------------------------------------------------------------------------------------------------
728 LE_SHARED bool ifgen_le_cfg_GetBool
729 (
730  le_msg_SessionRef_t _ifgen_sessionRef,
731  le_cfg_IteratorRef_t iteratorRef,
732  ///< [IN] Iterator to use as a basis for the transaction.
733  const char* LE_NONNULL path,
734  ///< [IN] Path to the target node. Can be an absolute path, or
735  ///< a path relative from the iterator's current position.
736  bool defaultValue
737  ///< [IN] Default value to use if the original can't be
738  ///< read.
739 );
740 
741 //--------------------------------------------------------------------------------------------------
742 /**
743  * Writes a boolean value to the config tree. Only valid during a write
744  * transaction.
745  *
746  * If the path is empty, the iterator's current node will be set.
747  */
748 //--------------------------------------------------------------------------------------------------
749 LE_SHARED void ifgen_le_cfg_SetBool
750 (
751  le_msg_SessionRef_t _ifgen_sessionRef,
752  le_cfg_IteratorRef_t iteratorRef,
753  ///< [IN] Iterator to use as a basis for the transaction.
754  const char* LE_NONNULL path,
755  ///< [IN] Path to the target node. Can be an absolute path, or
756  ///< a path relative from the iterator's current position.
757  bool value
758  ///< [IN] Value to write.
759 );
760 
761 //--------------------------------------------------------------------------------------------------
762 /**
763  * Deletes the node specified by the path. If the node doesn't exist, nothing happens. All child
764  * nodes are also deleted.
765  */
766 //--------------------------------------------------------------------------------------------------
767 LE_SHARED void ifgen_le_cfg_QuickDeleteNode
768 (
769  le_msg_SessionRef_t _ifgen_sessionRef,
770  const char* LE_NONNULL path
771  ///< [IN] Path to the node to delete.
772 );
773 
774 //--------------------------------------------------------------------------------------------------
775 /**
776  * Clears the current value of a node. If the node doesn't currently exist then it is created as a
777  * new empty node.
778  */
779 //--------------------------------------------------------------------------------------------------
780 LE_SHARED void ifgen_le_cfg_QuickSetEmpty
781 (
782  le_msg_SessionRef_t _ifgen_sessionRef,
783  const char* LE_NONNULL path
784  ///< [IN] Absolute or relative path to read from.
785 );
786 
787 //--------------------------------------------------------------------------------------------------
788 /**
789  * Reads a string value from the config tree. If the value isn't a string, or if the node is
790  * empty or doesn't exist, the default value will be returned.
791  *
792  * @return - LE_OK - Commit was completed successfully.
793  * - LE_OVERFLOW - Supplied string buffer was not large enough to hold the value.
794  */
795 //--------------------------------------------------------------------------------------------------
796 LE_SHARED le_result_t ifgen_le_cfg_QuickGetString
797 (
798  le_msg_SessionRef_t _ifgen_sessionRef,
799  const char* LE_NONNULL path,
800  ///< [IN] Path to read from.
801  char* value,
802  ///< [OUT] Value read from the requested node.
803  size_t valueSize,
804  ///< [IN]
805  const char* LE_NONNULL defaultValue
806  ///< [IN] Default value to use if the original can't be read.
807 );
808 
809 //--------------------------------------------------------------------------------------------------
810 /**
811  * Writes a string value to the config tree.
812  */
813 //--------------------------------------------------------------------------------------------------
814 LE_SHARED void ifgen_le_cfg_QuickSetString
815 (
816  le_msg_SessionRef_t _ifgen_sessionRef,
817  const char* LE_NONNULL path,
818  ///< [IN] Path to the value to write.
819  const char* LE_NONNULL value
820  ///< [IN] Value to write.
821 );
822 
823 //--------------------------------------------------------------------------------------------------
824 /**
825  * Reads a binary data from the config tree. If the node type is different, or if the node is
826  * empty or doesn't exist, the default value will be returned.
827  *
828  * @return - LE_OK - Commit was completed successfully.
829  * - LE_FORMAT_ERROR - if data can't be decoded.
830  * - LE_OVERFLOW - Supplied buffer was not large enough to hold the value.
831  */
832 //--------------------------------------------------------------------------------------------------
833 LE_SHARED le_result_t ifgen_le_cfg_QuickGetBinary
834 (
835  le_msg_SessionRef_t _ifgen_sessionRef,
836  const char* LE_NONNULL path,
837  ///< [IN] Path to the target node.
838  uint8_t* valuePtr,
839  ///< [OUT] Buffer to write the value into.
840  size_t* valueSizePtr,
841  ///< [INOUT]
842  const uint8_t* defaultValuePtr,
843  ///< [IN] Default value to use if the original can't be
844  ///< read.
845  size_t defaultValueSize
846  ///< [IN]
847 );
848 
849 //--------------------------------------------------------------------------------------------------
850 /**
851  * Writes a binary data to the config tree.
852  */
853 //--------------------------------------------------------------------------------------------------
854 LE_SHARED void ifgen_le_cfg_QuickSetBinary
855 (
856  le_msg_SessionRef_t _ifgen_sessionRef,
857  const char* LE_NONNULL path,
858  ///< [IN] Path to the target node.
859  const uint8_t* valuePtr,
860  ///< [IN] Value to write.
861  size_t valueSize
862  ///< [IN]
863 );
864 
865 //--------------------------------------------------------------------------------------------------
866 /**
867  * Reads a signed integer value from the config tree. If the value is a floating point
868  * value, then it will be rounded and returned as an integer. Otherwise If the underlying value is
869  * not an integer or a float, the default value will be returned instead.
870  *
871  * If the value is empty or the node doesn't exist, the default value is returned instead.
872  */
873 //--------------------------------------------------------------------------------------------------
874 LE_SHARED int32_t ifgen_le_cfg_QuickGetInt
875 (
876  le_msg_SessionRef_t _ifgen_sessionRef,
877  const char* LE_NONNULL path,
878  ///< [IN] Path to the value to write.
879  int32_t defaultValue
880  ///< [IN] Default value to use if the original can't be read.
881 );
882 
883 //--------------------------------------------------------------------------------------------------
884 /**
885  * Writes a signed integer value to the config tree.
886  */
887 //--------------------------------------------------------------------------------------------------
888 LE_SHARED void ifgen_le_cfg_QuickSetInt
889 (
890  le_msg_SessionRef_t _ifgen_sessionRef,
891  const char* LE_NONNULL path,
892  ///< [IN] Path to the value to write.
893  int32_t value
894  ///< [IN] Value to write.
895 );
896 
897 //--------------------------------------------------------------------------------------------------
898 /**
899  * Reads a 64-bit floating point value from the config tree. If the value is an integer,
900  * then it is promoted to a float. Otherwise, if the underlying value is not a float, or an
901  * integer the default value will be returned.
902  *
903  * If the value is empty or the node doesn't exist, the default value is returned.
904  *
905  * @note Floating point values will only be stored up to 6 digits of precision.
906  */
907 //--------------------------------------------------------------------------------------------------
908 LE_SHARED double ifgen_le_cfg_QuickGetFloat
909 (
910  le_msg_SessionRef_t _ifgen_sessionRef,
911  const char* LE_NONNULL path,
912  ///< [IN] Path to the value to write.
913  double defaultValue
914  ///< [IN] Default value to use if the original can't be read.
915 );
916 
917 //--------------------------------------------------------------------------------------------------
918 /**
919  * Writes a 64-bit floating point value to the config tree.
920  *
921  * @note Floating point values will only be stored up to 6 digits of precision.
922  */
923 //--------------------------------------------------------------------------------------------------
924 LE_SHARED void ifgen_le_cfg_QuickSetFloat
925 (
926  le_msg_SessionRef_t _ifgen_sessionRef,
927  const char* LE_NONNULL path,
928  ///< [IN] Path to the value to write.
929  double value
930  ///< [IN] Value to write.
931 );
932 
933 //--------------------------------------------------------------------------------------------------
934 /**
935  * Reads a value from the tree as a boolean. If the node is empty or doesn't exist, the default
936  * value is returned. This is also true if the node is a different type than expected.
937  *
938  * If the value is empty or the node doesn't exist, the default value is returned instead.
939  */
940 //--------------------------------------------------------------------------------------------------
941 LE_SHARED bool ifgen_le_cfg_QuickGetBool
942 (
943  le_msg_SessionRef_t _ifgen_sessionRef,
944  const char* LE_NONNULL path,
945  ///< [IN] Path to the value to write.
946  bool defaultValue
947  ///< [IN] Default value to use if the original can't be read.
948 );
949 
950 //--------------------------------------------------------------------------------------------------
951 /**
952  * Writes a boolean value to the config tree.
953  */
954 //--------------------------------------------------------------------------------------------------
955 LE_SHARED void ifgen_le_cfg_QuickSetBool
956 (
957  le_msg_SessionRef_t _ifgen_sessionRef,
958  const char* LE_NONNULL path,
959  ///< [IN] Path to the value to write.
960  bool value
961  ///< [IN] Value to write.
962 );
963 /** @} **/
964 #endif // LE_CFG_COMMON_H_INCLUDE_GUARD
Boolean value.
Definition: le_cfg_common.h:82
#define LE_SHARED
Definition: le_basics.h:287
le_cfg_nodeType_t
Definition: le_cfg_common.h:76
le_result_t
Definition: le_basics.h:46
struct le_cfg_ChangeHandler * le_cfg_ChangeHandlerRef_t
Definition: le_cfg_common.h:101
void(* le_cfg_ChangeHandlerFunc_t)(void *contextPtr)
Definition: le_cfg_common.h:110
A string encoded as utf8.
Definition: le_cfg_common.h:80
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
struct le_cfg_Iterator * le_cfg_IteratorRef_t
Definition: le_cfg_common.h:68
Non-leaf node, this node is the parent of other nodes.
Definition: le_cfg_common.h:88
64-bit floating point value.
Definition: le_cfg_common.h:86
Node doesn&#39;t exist.
Definition: le_cfg_common.h:90
Signed 32-bit.
Definition: le_cfg_common.h:84
A node with no value.
Definition: le_cfg_common.h:78