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
virtual server::BoundedWriter initialize(server::BoundedWriter data) = 0Internal: write the chart metadata (title, labels) to a server frame. Sent once per client.
Parameters
| Parameter | Description |
|---|---|
data (in) | Output position; throws server::SerializationError if the metadata does not fit. |
Returns The next write position.
serialize
virtual server::BoundedWriter serialize(server::BoundedWriter data) = 0Internal: write the chart data to a server frame.
Parameters
| Parameter | Description |
|---|---|
data (in) | Output position; throws server::SerializationError if the data does not fit. |
Returns The next write position.
lockMutex
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
void lock()Lock the chart mutex (BasicLockable interface for std::lock_guard / std::unique_lock).
try_lock
bool try_lock()Returns true if the mutex was acquired without blocking (Lockable interface).
unlockMutex
void unlockMutex()unlock chart mutex. This can be used if you use raisim in a multi-threaded environment.
unlock
void unlock()Unlock the chart mutex (BasicLockable interface).
getType
Type getType()Returns Chart type.