Template Class StateStorageWithMetadata

Inheritance Relationships

Base Type

Class Documentation

template<typename M>
class StateStorageWithMetadata : public ompl::base::StateStorage

State storage that allows storing state metadata as well.

Template Parameters:

M – the datatype for the stored metadata. boost::serialization operation needs to be defined

Public Types

using MetadataType = M

the datatype of the metadata

Public Functions

inline StateStorageWithMetadata(const StateSpacePtr &space)

The state space to store states for is specified as argument.

inline virtual void addState(const State *state) override

Add a state to the set of states maintained by this storage structure. The state is copied to internal storage and metadata with default values is stored as well.

inline virtual void addState(const State *state, const M &metadata)

Add a state to the set of states maintained by this storage structure. The state is copied to internal storage. Corresponding metadata is stored too.

inline virtual void clear() override

Clear the stored states. This frees all the memory.

inline const M &getMetadata(unsigned int index) const

Get const access to the metadata of a state at a particular index.

inline M &getMetadata(unsigned int index)

Get write access to the metadata of a state at a particular index.

Protected Functions

inline virtual void loadMetadata(const Header&, boost::archive::binary_iarchive &ia) override

Load the state metadata from a binary archive ia, given the loaded header is h. No metadata is actually loaded unless the StateStorageWithMetadata class is used.

inline virtual void storeMetadata(const Header&, boost::archive::binary_oarchive &oa) override

Save the state metadata to a binary archive oa, given the stored header is h. No metadata is actually saved unless the StateStorageWithMetadata class is used.

Protected Attributes

std::vector<M> metadata_

The metadata for each state.