mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Move presync callback functionality from SkyBrowserModule to ServerModule in order to expose the functionality to other topics as well
This commit is contained in:
@@ -49,6 +49,8 @@ struct Message {
|
||||
class ServerModule : public OpenSpaceModule {
|
||||
public:
|
||||
static constexpr const char* Name = "Server";
|
||||
using CallbackHandle = int;
|
||||
using CallbackFunction = std::function<void()>;
|
||||
|
||||
ServerModule();
|
||||
virtual ~ServerModule();
|
||||
@@ -57,6 +59,9 @@ public:
|
||||
|
||||
int skyBrowserUpdateTime() const;
|
||||
|
||||
CallbackHandle addPreSyncCallback(CallbackFunction cb);
|
||||
void removePreSyncCallback(CallbackHandle handle);
|
||||
|
||||
protected:
|
||||
void internalInitialize(const ghoul::Dictionary& configuration) override;
|
||||
|
||||
@@ -79,6 +84,10 @@ private:
|
||||
std::vector<std::unique_ptr<ServerInterface>> _interfaces;
|
||||
properties::PropertyOwner _interfaceOwner;
|
||||
int _skyBrowserUpdateTime = 100;
|
||||
|
||||
// Callbacks for tiggering topic
|
||||
int _nextCallbackHandle = 0;
|
||||
std::vector<std::pair<CallbackHandle, CallbackFunction>> _preSyncCallbacks;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user