summaryrefslogtreecommitdiff
path: root/include/extension.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-08 21:27:18 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-08 21:27:18 +0100
commit5b25b7b7d2ba6d7daee0a8920278dcb000896a76 (patch)
tree0d0c4f0d13d8486cf01838d9084396676c8deeb8 /include/extension.h
parent25e162cbf64763245def4d11b4be40ced11ee330 (diff)
the extension callback functions are no lambdas, and can no longer be passed to the constructor, but have to be set with special callback functions, documentation updated too
Diffstat (limited to 'include/extension.h')
-rw-r--r--include/extension.h55
1 files changed, 38 insertions, 17 deletions
diff --git a/include/extension.h b/include/extension.h
index 42bbff2..ca7e807 100644
--- a/include/extension.h
+++ b/include/extension.h
@@ -69,10 +69,10 @@ public:
*
* @param callback
*/
- void onReady(const Callback &callback)
+ void onStartup(const Callback &callback)
{
// copy callback
- _onReady = callback;
+ _onStartup = callback;
}
/**
@@ -83,10 +83,10 @@ public:
*
* @param callback
*/
- void onFinalize(const Callback &callback)
+ void onShutdown(const Callback &callback)
{
// copy callback
- _onFinalize = callback;
+ _onShutdown = callback;
}
/**
@@ -110,13 +110,15 @@ public:
*
* The callback will be called after _each_ request, so that you can clean up
* certain things and make your extension ready to handle the next request.
+ * This method is called onIdle because the extension is idle in between
+ * requests.
*
* @param callback
*/
- void onCleanup(const Callback &callback)
+ void onIdle(const Callback &callback)
{
// copy callback
- _onCleanup = callback;
+ _onIdle = callback;
}
/**
@@ -155,7 +157,7 @@ private:
* pageviews are going to be handled
* @var Callback
*/
- Callback _onReady;
+ Callback _onStartup;
/**
* Callback that is called in front of each request
@@ -167,26 +169,45 @@ private:
* Callback that is called right after each request
* @var Callback
*/
- Callback _onCleanup;
+ Callback _onIdle;
/**
* Callback that is called right before the engine is closing down
* @var Callback
*/
- Callback _onFinalize;
-
+ Callback _onShutdown;
+
/**
- * Callback that is called before each request
- * @var request_callback
+ * Function that is called when the extension initializes
+ * @param type Module type
+ * @param number Module number
+ * @return int 0 on success
*/
- request_callback _start;
-
+ static int onStartup(int type, int module_number);
+
/**
- * Callback that is called after each request
- * @var request_callback
+ * Function that is called when the extension is about to be stopped
+ * @param type Module type
+ * @param number Module number
+ * @return int
*/
- request_callback _stop;
+ static int onShutdown(int type, int module_number);
+ /**
+ * Function that is called when a request starts
+ * @param type Module type
+ * @param number Module number
+ * @return int 0 on success
+ */
+ static int onRequest(int type, int module_number);
+
+ /**
+ * Function that is called when a request is ended
+ * @param type Module type
+ * @param number Module number
+ * @return int 0 on success
+ */
+ static int onIdle(int type, int module_number);
};
/**