Skip to content
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

Merged
merged 1 commit into from
Mar 6, 2018

Conversation

karjonas
Copy link
Contributor

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.

Copy link
Member

@favreau favreau left a 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>
Copy link

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;
Copy link

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};
Copy link

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);
Copy link

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

@karjonas
Copy link
Contributor Author

karjonas commented Mar 5, 2018

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.

@karjonas karjonas merged commit 628acdc into BlueBrain:master Mar 6, 2018
@karjonas karjonas deleted the topology_viewer_cmake branch March 6, 2018 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants