Skip to content

raisim::Chart ​

abstract class · #include <raisim/server/Charts.hpp>

Derived by: raisim::BarChart, raisim::TimeSeriesGraph

Base class of the charts streamed by RaisimServer (TimeSeriesGraph, BarChart). Charts are created and owned by the server (RaisimServer::addTimeSeriesGraph(), addBarChart()).

Public member functions ​

initialize ​

cpp
virtual server::BoundedWriter initialize(server::BoundedWriter data) = 0

Internal: write the chart metadata (title, labels) to a server frame. Sent once per client.

Parameters

ParameterDescription
data (in)Output position; throws server::SerializationError if the metadata does not fit.

Returns The next write position.

serialize ​

cpp
virtual server::BoundedWriter serialize(server::BoundedWriter data) = 0

Internal: write the chart data to a server frame.

Parameters

ParameterDescription
data (in)Output position; throws server::SerializationError if the data does not fit.

Returns The next write position.

lockMutex ​

cpp
void lockMutex()

locks chart mutex. The server holds it while serializing the chart. The data setters (TimeSeriesGraph::addDataPoints(), BarChart::setData()) are already thread-safe on their own.

lock ​

cpp
void lock()

Lock the chart mutex (BasicLockable interface for std::lock_guard / std::unique_lock).

try_lock ​

cpp
bool try_lock()

Returns true if the mutex was acquired without blocking (Lockable interface).

unlockMutex ​

cpp
void unlockMutex()

unlock chart mutex. This can be used if you use raisim in a multi-threaded environment.

unlock ​

cpp
void unlock()

Unlock the chart mutex (BasicLockable interface).

getType ​

cpp
Type getType()

Returns Chart type.

RaiSim — physics for robotics and AI.