-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logic for adding Topology Viewer as a usecase plugin #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me, but @rdumusc's input will be valuable.
@@ -32,6 +32,8 @@ | |||
|
|||
#include <deflect/SizeHints.h> | |||
|
|||
#include <plugins/extensions/plugins/RocketsPlugin.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why included, I don't see it being used in this file..?
|
||
ImageGenerator _imageGenerator; | ||
|
||
Timer _timer; | ||
|
||
public: | ||
std::unique_ptr<JsonRpcServer> _jsonrpcServer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style:
- please keep a single public / protect / private section, in this order
- _ prefix is used by convention for private variables and methods (only)
@@ -89,11 +89,13 @@ std::string hyphenatedToCamelCase(const std::string& hyphenated) | |||
|
|||
namespace brayns | |||
{ | |||
RocketsPlugin* RocketsPlugin::_instance{nullptr}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global variables are evil! ;-) Please find a cleaner way to pass the RocketsPlugin to whoever needs it.
inline void registerAction(const std::string& name, | ||
std::function<void()> action) | ||
{ | ||
RocketsPlugin::instance()->_jsonrpcServer->connect(name, action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if that's where the instance is needed, then the free functions should be made class functions
9a85b5d
to
74af030
Compare
I cleared out the rpc-related code from this PR since it is not proper anyway. So now it is only the CMake part to merge. |
If CMake finds a folder named TopologyViewer in the usecases directory it will include the plugin. There is also some logic for adding custom rpc callbacks to Rockets plugin. This makes it possible to do custom communication between jupyter and the brayns plugin.