refactor get public data, to be slightly easier to use on callee side
[clinton/Smoothieware.git] / src / libs / PublicData.h
index 911b7a3..a888e9e 100644 (file)
 
 class PublicData {
     public:
+        // there are two ways to get data from a module
+        // 1. pass in a pointer to a data storage area that the caller creates, the callee module will put the returned data in that pointer
+        // 2. pass in a pointer to a pointer, the callee will set that pointer to some storage the callee has control over, with the requested data
+        // the version used is dependent on the target (callee) module
         static bool get_value(uint16_t csa, void *data) { return get_value(csa, 0, 0, data); }
         static bool get_value(uint16_t csa, uint16_t csb, void *data) { return get_value(csa, csb, 0, data); }
         static bool get_value(uint16_t cs[3], void *data) { return get_value(cs[0], cs[1], cs[2], data); };