Class PlannerDataStorage
Defined in File PlannerDataStorage.h
Nested Relationships
Nested Types
Inheritance Relationships
Derived Type
public ompl::control::PlannerDataStorage
(Class PlannerDataStorage)
Class Documentation
-
class PlannerDataStorage
Object that handles loading/storing a PlannerData object to/from a binary stream. Serialization of vertices and edges is performed using the Boost archive method serialize. Derived vertex/edge classes are handled, presuming those classes implement the serialize method.
Remark
Since the serialize method for vertices and edges is templated, it cannot be virtual. To serialize a derived class AND the base class data, a special call can be invoked inside of serialize that instructs the serializer to also serialize the base class. The derived class must also have a GUID exposed to the serializer for proper deserialization at runtime. This is performed with the BOOST_CLASS_EXPORT macro. An example of these items is given below:
#include <boost/serialization/export.hpp> class MyVertexClass : public ompl::base::PlannerDataVertex { // ---SNIP--- template <class Archive> void serialize(Archive & ar, const unsigned int version) { ar & boost::serialization::base_object<ompl::base::PlannerDataVertex>(*this); // ... (The other members of MyVertexClass) } }; BOOST_CLASS_EXPORT(MyVertexClass);
Subclassed by ompl::control::PlannerDataStorage
Public Functions
-
PlannerDataStorage()
Default constructor.
-
virtual ~PlannerDataStorage()
Destructor.
-
virtual bool store(const PlannerData &pd, const char *filename)
Store (serialize) the PlannerData structure to the given filename.
- Returns:
True on success, false on failure.
-
virtual bool store(const PlannerData &pd, std::ostream &out)
Store (serialize) the PlannerData structure to the given stream.
- Returns:
True on success, false on failure.
-
virtual bool load(const char *filename, PlannerData &pd)
Load the PlannerData structure from the given stream. The StateSpace that was used to store the data must match the StateSpace inside of the argument PlannerData.
- Returns:
True on success, false on failure.
-
virtual bool load(std::istream &in, PlannerData &pd)
Load the PlannerData structure from the given stream. The StateSpace that was used to store the data must match the StateSpace inside of the argument PlannerData.
- Returns:
True on success, false on failure.
Protected Functions
-
inline virtual void loadVertices(PlannerData &pd, unsigned int numVertices, boost::archive::binary_iarchive &ia)
Read numVertices from the binary input ia and store them as PlannerData.
-
inline virtual void storeVertices(const PlannerData &pd, boost::archive::binary_oarchive &oa)
Serialize and store all vertices in pd to the binary archive.
-
inline virtual void loadEdges(PlannerData &pd, unsigned int numEdges, boost::archive::binary_iarchive &ia)
Read numEdges from the binary input ia and store them as PlannerData.
-
inline virtual void storeEdges(const PlannerData &pd, boost::archive::binary_oarchive &oa)
Serialize and store all edges in pd to the binary archive.
-
struct Header
Information stored at the beginning of the PlannerData archive.
Public Functions
Public Members
-
std::uint_fast32_t marker
OMPL PlannerData specific marker (fixed value)
-
std::size_t vertex_count
Number of vertices stored in the archive.
-
std::size_t edge_count
Number of edges stored in the archive.
-
std::vector<int> signature
Signature of state space that allocated the saved states in the vertices (see ompl::base::StateSpace::computeSignature()) */.
-
std::uint_fast32_t marker
-
struct PlannerDataEdgeData
The object containing all edge data that will be stored.
Public Members
-
const PlannerDataEdge *e_
-
std::pair<unsigned int, unsigned int> endpoints_
-
double weight_
-
const PlannerDataEdge *e_
-
struct PlannerDataVertexData
The object containing all vertex data that will be stored.
-
PlannerDataStorage()