Skip to content
Snippets Groups Projects
Commit de2a5b6b authored by Fabian Reister's avatar Fabian Reister
Browse files

ArvizDrawerBase: uses ScopedClient

parent 29650142
No related branches found
No related tags found
No related merge requests found
...@@ -6,21 +6,27 @@ ...@@ -6,21 +6,27 @@
namespace armarx namespace armarx
{ {
ArVizDrawerBase::ArVizDrawerBase(armarx::viz::Client &arviz) : arvizClient(arviz) {} ArVizDrawerBase::ArVizDrawerBase(armarx::viz::Client& arviz) : arvizClient(arviz) {}
ArVizDrawerBase::~ArVizDrawerBase() = default; ArVizDrawerBase::~ArVizDrawerBase() = default;
viz::Client &ArVizDrawerBase::arviz() { return arvizClient; } viz::ScopedClient& ArVizDrawerBase::arviz()
{
return arvizClient;
}
const viz::Client &ArVizDrawerBase::arviz() const { return arvizClient; } const viz::ScopedClient& ArVizDrawerBase::arviz() const
{
return arvizClient;
}
void ArVizDrawerBase::commit(const viz::Layer &layer) void ArVizDrawerBase::commit(const viz::Layer& layer)
{ {
std::lock_guard guard{layerMtx}; std::lock_guard guard{layerMtx};
arvizClient.commit(layer); arvizClient.commit(layer);
} }
void ArVizDrawerBase::commit(const std::vector<viz::Layer> &layers) void ArVizDrawerBase::commit(const std::vector<viz::Layer>& layers)
{ {
std::lock_guard guard{layerMtx}; std::lock_guard guard{layerMtx};
arvizClient.commit(layers); arvizClient.commit(layers);
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include "RobotAPI/components/ArViz/Client/ScopedClient.h"
namespace armarx namespace armarx
{ {
// forward declaration // forward declaration
...@@ -42,19 +44,19 @@ namespace armarx ...@@ -42,19 +44,19 @@ namespace armarx
*/ */
class ArVizDrawerBase class ArVizDrawerBase
{ {
public: public:
ArVizDrawerBase(armarx::viz::Client &arviz); ArVizDrawerBase(armarx::viz::Client& arviz);
virtual ~ArVizDrawerBase(); virtual ~ArVizDrawerBase();
protected: protected:
viz::Client &arviz(); viz::ScopedClient& arviz();
const viz::Client &arviz() const; const viz::ScopedClient& arviz() const;
void commit(const viz::Layer &layer); void commit(const viz::Layer& layer);
void commit(const std::vector<viz::Layer> &layers); void commit(const std::vector<viz::Layer>& layers);
private: private:
viz::Client &arvizClient; viz::ScopedClient arvizClient;
std::mutex layerMtx; std::mutex layerMtx;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment