22namespace learningmachine {
23namespace serialization {
40yarp::os::Bottle&
operator<<(yarp::os::Bottle &
out,
const yarp::sig::Vector& v) {
41 for(
size_t i = 0; i < v.size(); i++) {
48yarp::os::Bottle&
operator<<(yarp::os::Bottle &
out,
const yarp::sig::Matrix& M) {
49 for(
int r = 0; r < M.rows(); r++) {
50 for(
int c = 0; c < M.cols(); c++) {
54 out << M.rows() << M.cols();
58yarp::os::Bottle&
operator>>(yarp::os::Bottle &in,
int& val) {
59 val = in.pop().asInt32();
63yarp::os::Bottle&
operator>>(yarp::os::Bottle &in,
double& val) {
64 val = in.pop().asFloat64();
68yarp::os::Bottle&
operator>>(yarp::os::Bottle &in, yarp::sig::Vector& v) {
72 for(
int i = v.size() - 1; i >= 0; i--) {
78yarp::os::Bottle&
operator>>(yarp::os::Bottle &in, yarp::sig::Matrix& M) {
82 for(
int r = M.rows() - 1; r >= 0; r--) {
83 for(
int c = M.cols() - 1; c >= 0; c--) {
yarp::os::Bottle & operator>>(yarp::os::Bottle &in, int &val)
Pops an integer from the end of a Bottle using the extraction operator.
yarp::os::Bottle & operator<<(yarp::os::Bottle &out, int val)
Helper functions for serialization in bottles for use in the learningMachine library.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.