Complete the generated C++ code docs to mention globals

But there's an entire section still missing with an example.
This commit is contained in:
Simon Hausmann 2021-08-27 14:28:04 +02:00
parent fe94f93755
commit 6d05959c93

View file

@ -23,6 +23,7 @@ This class will have the following public member functions:
* `invoke_<callback_name>` function which takes the callback argument as parameter and call the callback. * `invoke_<callback_name>` function which takes the callback argument as parameter and call the callback.
* `on_<callback_name>` function which takes a functor as an argument and sets the callback handler * `on_<callback_name>` function which takes a functor as an argument and sets the callback handler
for this callback. the functor must accept the type parameter of the callback for this callback. the functor must accept the type parameter of the callback
* A `global` function, to provide access to any exported global singletons.
## Example ## Example
@ -77,6 +78,10 @@ public:
/// Sets the callback handler for the `hello` callback. /// Sets the callback handler for the `hello` callback.
template<typename Functor> inline void on_hello (Functor && callback_handler) const; template<typename Functor> inline void on_hello (Functor && callback_handler) const;
// Returns a reference to a global singleton that's exported.
inline template<typename T>
const T &global() const;
private: private:
/// private fields omitted /// private fields omitted
}; };