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

Make more clear example of BufferManager #43

Closed
Nicogene opened this issue Jan 22, 2021 · 2 comments
Closed

Make more clear example of BufferManager #43

Nicogene opened this issue Jan 22, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Nicogene
Copy link
Member

We should extend the examples about the BufferManager and make them more clear(e.g. less modern c++ black magic)

@Nicogene Nicogene added the enhancement New feature or request label Jan 22, 2021
@Nicogene Nicogene self-assigned this Jan 22, 2021
@traversaro
Copy link
Member

A step in both solving this issue and solving #39 would be to move the configuration of the BufferManager from being done in the constructor, to be done via appropriate configuration methods.

@pattacini
Copy link
Member

pattacini commented Jan 22, 2021

It's not black magic 😏
It's more about making the example clearer.

Replacing

yarp::telemetry::BufferManager<double> bm_v({ {"one",{4,1}}, {"two",{4,1}} }, 3);

with

// configure telemetry to log 3 samples of 2 variables of vector type whose size is 4 double each
// the channels are called "one" and "two"
size_t n_samples = 3;
std::vector<BufferInfo> channels{ {"one", {4,1}}, {"two", {4,1}} };
yarp::telemetry::BufferManager<double> bm_v(channels, n_samples);

enhances readability.

In my opinion, it's important to introduce the concept of channel, which is not the variable per se to be logged but rather refers to the infrastructure employed to transfer the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants