Definition of a scoped state. More...
#include <ScopedState.h>
Public Types | |
typedef T::StateType | StateType |
The type of the contained state. | |
Public Member Functions | |
double | distance (const State *state) const |
Compute the distance to another state. | |
template<class O > | |
double | distance (const ScopedState< O > &other) const |
Compute the distance to another state. | |
void | enforceBounds (void) |
Enforce the bounds on the maintained state. | |
const StateType * | get (void) const |
Returns a pointer to the contained state. | |
StateType * | get (void) |
Returns a pointer to the contained state. | |
const StateSpacePtr & | getSpace (void) const |
Get the state space that the state corresponds to. | |
template<class O > | |
bool | operator!= (const ScopedState< O > &other) const |
Checks equality of two states. | |
StateType * | operator() (void) const |
Returns a pointer to the contained state (used for Python bindings). | |
const StateType & | operator* (void) const |
De-references to the contained state. | |
StateType & | operator* (void) |
De-references to the contained state. | |
const StateType * | operator-> (void) const |
Returns a pointer to the contained state. | |
StateType * | operator-> (void) |
Returns a pointer to the contained state. | |
ScopedState< T > & | operator= (const double value) |
Partial assignment operator. Only sets the double values of the state to a fixed value. | |
ScopedState< T > & | operator= (const std::vector< double > &reals) |
Partial assignment operator. Only sets the double values of the state to specified real values. | |
template<class O > | |
ScopedState< T > & | operator= (const ScopedState< O > &other) |
Assignment operator that allows conversion of states. | |
ScopedState< T > & | operator= (const State &other) |
Assignment operator. | |
ScopedState< T > & | operator= (const State *other) |
Assignment operator. | |
ScopedState< T > & | operator= (const ScopedState< T > &other) |
Assignment operator. | |
template<class O > | |
bool | operator== (const ScopedState< O > &other) const |
Checks equality of two states. | |
double | operator[] (const unsigned int index) const |
Access the indexth double value this state contains. | |
double & | operator[] (const unsigned int index) |
Access the indexth double value this state contains. | |
ScopedState | operator[] (const StateSpacePtr &s) const |
Extract a state that corresponds to the components in state space s. Those components will have the same value as the current state (only the ones included in the current state; others will be uninitialised). | |
void | print (std::ostream &out=std::cout) const |
Print this state to a stream. | |
void | random (void) |
Set this state to a random value (uniform). | |
std::vector< double > | reals (void) const |
Return the real values corresponding to this state. If a conversion is not possible, an exception is thrown. | |
bool | satisfiesBounds (void) const |
Check if the maintained state satisfies bounds. | |
ScopedState (const StateSpacePtr &space, const State *state) | |
Given the state space that we are working with, allocate a state and fill that state with a given value. | |
template<class O > | |
ScopedState (const ScopedState< O > &other) | |
Copy constructor that allows instantiation from states of other type. | |
ScopedState (const ScopedState< T > &other) | |
Copy constructor. | |
ScopedState (const StateSpacePtr &space) | |
Given the state space that we are working with, allocate a state. | |
ScopedState (const SpaceInformationPtr &si) | |
Given the space that we are working with, allocate a state from the corresponding state space. | |
~ScopedState (void) | |
Free the memory of the internally allocated state. | |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((boost::Convertible< typename T::StateType *, State * >)) | |
Make sure the type we are allocating is indeed a state. | |
BOOST_CONCEPT_ASSERT ((boost::Convertible< T *, StateSpace * >)) | |
Make sure the type we are allocating is indeed from a state space. | |
Private Attributes | |
StateSamplerPtr | sampler_ |
StateSpacePtr | space_ |
StateType * | state_ |
Definition of a scoped state.
This class allocates a state of a desired type using the allocation mechanism of the corresponding state space. The state is then freed when the instance goes out of scope using the corresponding free mechanism.
Definition at line 56 of file ScopedState.h.
typedef T::StateType ompl::base::ScopedState< T >::StateType |
The type of the contained state.
Definition at line 67 of file ScopedState.h.
ompl::base::ScopedState< T >::ScopedState | ( | const SpaceInformationPtr & | si | ) | [inline, explicit] |
Given the space that we are working with, allocate a state from the corresponding state space.
Definition at line 73 of file ScopedState.h.
ompl::base::ScopedState< T >::ScopedState | ( | const StateSpacePtr & | space | ) | [inline, explicit] |
Given the state space that we are working with, allocate a state.
Definition at line 87 of file ScopedState.h.
ompl::base::ScopedState< T >::ScopedState | ( | const ScopedState< T > & | other | ) | [inline] |
Copy constructor.
Definition at line 99 of file ScopedState.h.
ompl::base::ScopedState< T >::ScopedState | ( | const ScopedState< O > & | other | ) | [inline] |
Copy constructor that allows instantiation from states of other type.
Definition at line 108 of file ScopedState.h.
ompl::base::ScopedState< T >::ScopedState | ( | const StateSpacePtr & | space, | |
const State * | state | |||
) | [inline] |
Given the state space that we are working with, allocate a state and fill that state with a given value.
Definition at line 126 of file ScopedState.h.
ompl::base::ScopedState< T >::~ScopedState | ( | void | ) | [inline] |
Free the memory of the internally allocated state.
Definition at line 139 of file ScopedState.h.
ompl::base::ScopedState< T >::BOOST_CONCEPT_ASSERT | ( | (boost::Convertible< typename T::StateType *, State * >) | ) | [private] |
Make sure the type we are allocating is indeed a state.
ompl::base::ScopedState< T >::BOOST_CONCEPT_ASSERT | ( | (boost::Convertible< T *, StateSpace * >) | ) | [private] |
Make sure the type we are allocating is indeed from a state space.
double ompl::base::ScopedState< T >::distance | ( | const State * | state | ) | const [inline] |
Compute the distance to another state.
Definition at line 300 of file ScopedState.h.
double ompl::base::ScopedState< T >::distance | ( | const ScopedState< O > & | other | ) | const [inline] |
Compute the distance to another state.
Definition at line 292 of file ScopedState.h.
void ompl::base::ScopedState< T >::enforceBounds | ( | void | ) | [inline] |
Enforce the bounds on the maintained state.
Definition at line 314 of file ScopedState.h.
const StateType* ompl::base::ScopedState< T >::get | ( | void | ) | const [inline] |
Returns a pointer to the contained state.
Definition at line 374 of file ScopedState.h.
StateType* ompl::base::ScopedState< T >::get | ( | void | ) | [inline] |
Returns a pointer to the contained state.
Definition at line 368 of file ScopedState.h.
const StateSpacePtr& ompl::base::ScopedState< T >::getSpace | ( | void | ) | const [inline] |
Get the state space that the state corresponds to.
Definition at line 145 of file ScopedState.h.
bool ompl::base::ScopedState< T >::operator!= | ( | const ScopedState< O > & | other | ) | const [inline] |
Checks equality of two states.
Definition at line 260 of file ScopedState.h.
StateType* ompl::base::ScopedState< T >::operator() | ( | void | ) | const [inline] |
Returns a pointer to the contained state (used for Python bindings).
Definition at line 380 of file ScopedState.h.
const StateType& ompl::base::ScopedState< T >::operator* | ( | void | ) | const [inline] |
De-references to the contained state.
Definition at line 350 of file ScopedState.h.
StateType& ompl::base::ScopedState< T >::operator* | ( | void | ) | [inline] |
De-references to the contained state.
Definition at line 344 of file ScopedState.h.
const StateType* ompl::base::ScopedState< T >::operator-> | ( | void | ) | const [inline] |
Returns a pointer to the contained state.
Definition at line 362 of file ScopedState.h.
StateType* ompl::base::ScopedState< T >::operator-> | ( | void | ) | [inline] |
Returns a pointer to the contained state.
Definition at line 356 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const double | value | ) | [inline] |
Partial assignment operator. Only sets the double values of the state to a fixed value.
Definition at line 234 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const std::vector< double > & | reals | ) | [inline] |
Partial assignment operator. Only sets the double values of the state to specified real values.
Definition at line 223 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const ScopedState< O > & | other | ) | [inline] |
Assignment operator that allows conversion of states.
Definition at line 199 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const State & | other | ) | [inline] |
Assignment operator.
Definition at line 182 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const State * | other | ) | [inline] |
Assignment operator.
Definition at line 166 of file ScopedState.h.
ScopedState<T>& ompl::base::ScopedState< T >::operator= | ( | const ScopedState< T > & | other | ) | [inline] |
Assignment operator.
Definition at line 151 of file ScopedState.h.
bool ompl::base::ScopedState< T >::operator== | ( | const ScopedState< O > & | other | ) | const [inline] |
Checks equality of two states.
Definition at line 244 of file ScopedState.h.
double ompl::base::ScopedState< T >::operator[] | ( | const unsigned int | index | ) | const [inline] |
Access the indexth double value this state contains.
Definition at line 282 of file ScopedState.h.
double& ompl::base::ScopedState< T >::operator[] | ( | const unsigned int | index | ) | [inline] |
Access the indexth double value this state contains.
Definition at line 273 of file ScopedState.h.
ScopedState ompl::base::ScopedState< T >::operator[] | ( | const StateSpacePtr & | s | ) | const [inline] |
Extract a state that corresponds to the components in state space s. Those components will have the same value as the current state (only the ones included in the current state; others will be uninitialised).
Definition at line 522 of file ScopedState.h.
void ompl::base::ScopedState< T >::print | ( | std::ostream & | out = std::cout |
) | const [inline] |
Print this state to a stream.
Definition at line 338 of file ScopedState.h.
void ompl::base::ScopedState< T >::random | ( | void | ) | [inline] |
Set this state to a random value (uniform).
Definition at line 306 of file ScopedState.h.
std::vector<double> ompl::base::ScopedState< T >::reals | ( | void | ) | const [inline] |
Return the real values corresponding to this state. If a conversion is not possible, an exception is thrown.
Definition at line 328 of file ScopedState.h.
bool ompl::base::ScopedState< T >::satisfiesBounds | ( | void | ) | const [inline] |
Check if the maintained state satisfies bounds.
Definition at line 320 of file ScopedState.h.
StateSamplerPtr ompl::base::ScopedState< T >::sampler_ [private] |
Definition at line 388 of file ScopedState.h.
StateSpacePtr ompl::base::ScopedState< T >::space_ [private] |
Definition at line 387 of file ScopedState.h.
StateType* ompl::base::ScopedState< T >::state_ [private] |
Definition at line 389 of file ScopedState.h.