5#ifndef __pinocchio_python_serialization_serializable_hpp__
6#define __pinocchio_python_serialization_serializable_hpp__
8#include "pinocchio/serialization/serializable.hpp"
9#include "pinocchio/bindings/python/serialization/serialization.hpp"
16 namespace bp = boost::python;
18 template<
typename Derived>
19 struct SerializableVisitor :
public bp::def_visitor<SerializableVisitor<Derived>>
22 template<
class PyClass>
23 void visit(PyClass & cl)
const
25#ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
27 "saveToText", &Derived::saveToText, bp::args(
"self",
"filename"),
28 "Saves *this inside a text file.")
30 "loadFromText", &Derived::loadFromText, bp::args(
"self",
"filename"),
31 "Loads *this from a text file.")
34 "saveToString", &Derived::saveToString, bp::arg(
"self"),
35 "Parses the current object to a string.")
37 "loadFromString", &Derived::loadFromString, bp::args(
"self",
"string"),
38 "Parses from the input string the content of the current object.")
41 "saveToXML", &Derived::saveToXML, bp::args(
"filename",
"tag_name"),
42 "Saves *this inside a XML file.")
44 "loadFromXML", &Derived::loadFromXML, bp::args(
"self",
"filename",
"tag_name"),
45 "Loads *this from a XML file.")
48 "saveToBinary", (
void(Derived::*)(const std::string &) const) & Derived::saveToBinary,
49 bp::args(
"self",
"filename"),
"Saves *this inside a binary file.")
51 "loadFromBinary", (void(Derived::*)(const std::string &)) & Derived::loadFromBinary,
52 bp::args(
"self",
"filename"),
"Loads *this from a binary file.")
56 (void(Derived::*)(boost::asio::streambuf &) const) & Derived::saveToBinary,
57 bp::args(
"self",
"buffer"),
"Saves *this inside a binary buffer.")
60 (void(Derived::*)(boost::asio::streambuf &)) & Derived::loadFromBinary,
61 bp::args(
"self",
"buffer"),
"Loads *this from a binary buffer.")
65 (void(Derived::*)(serialization::StaticBuffer &) const) & Derived::saveToBinary,
66 bp::args(
"self",
"buffer"),
"Saves *this inside a static binary buffer.")
69 (void(Derived::*)(serialization::StaticBuffer &)) & Derived::loadFromBinary,
70 bp::args(
"self",
"buffer"),
"Loads *this from a static binary buffer.");
73 PINOCCHIO_UNUSED_VARIABLE(cl);
Main pinocchio namespace.