aboutsummaryrefslogtreecommitdiff
path: root/src/doc/feature/proxy.dox
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-18 14:00:54 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-18 14:00:54 +0100
commitd4a999a1b002f510103095c0cd139d7a2bead5f4 (patch)
tree033352f79f16e5dc17e7fbafd861ac28582d6f74 /src/doc/feature/proxy.dox
parentcd389129cc2ed73596251cb7c9cc606f6e6d74d8 (diff)
parent0e800c6857122436e7a766c6934991aa1d8d31ff (diff)
Merge branch 'master' into loek/audioloek/audio
Diffstat (limited to 'src/doc/feature/proxy.dox')
-rw-r--r--src/doc/feature/proxy.dox43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/doc/feature/proxy.dox b/src/doc/feature/proxy.dox
new file mode 100644
index 0000000..66bbd2f
--- /dev/null
+++ b/src/doc/feature/proxy.dox
@@ -0,0 +1,43 @@
+// vim:ft=doxygen
+namespace crepe {
+/**
+
+\defgroup feature_proxy Proxy utility
+\ingroup feature
+\brief Use ValueBroker as if it were a regular variable
+
+Proxy provides operators that allow you to use a ValueBroker instance as if it
+were a regular variable. Proxy implements a constructor that allows it to be
+used as a substitute return type for any function that returns ValueBroker.
+
+\see ValueBroker
+\see Proxy
+
+\par Example
+
+```cpp
+#include <crepe/util/Proxy.h>
+#include <crepe/ValueBroker.h>
+
+int calculation(int value) {
+ return 3 * value;
+}
+
+void anywhere() {
+ crepe::ValueBroker<int> foo_handle;
+ crepe::Proxy foo = foo_handle;
+
+ // implicitly calls .set()
+ foo += 10;
+
+ // implicitly calls .get()
+ int out = calculation(foo);
+
+ // explicitly cast (also calls .get())
+ int casted = int(foo);
+}
+
+```
+
+*/
+}