ompl::base::ScopedState< T > Class Template Reference

Definition of a scoped state. More...

#include <ScopedState.h>

List of all members.

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 StateTypeget (void) const
 Returns a pointer to the contained state.
StateTypeget (void)
 Returns a pointer to the contained state.
const StateSpacePtrgetSpace (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.
StateTypeoperator() (void) const
 Returns a pointer to the contained state (used for Python bindings).
const StateTypeoperator* (void) const
 De-references to the contained state.
StateTypeoperator* (void)
 De-references to the contained state.
const StateTypeoperator-> (void) const
 Returns a pointer to the contained state.
StateTypeoperator-> (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_
StateTypestate_

Detailed Description

template<class T = StateSpace>
class ompl::base::ScopedState< T >

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.


Member Typedef Documentation

template<class T = StateSpace>
typedef T::StateType ompl::base::ScopedState< T >::StateType

The type of the contained state.

Definition at line 67 of file ScopedState.h.


Constructor & Destructor Documentation

template<class T = StateSpace>
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
ompl::base::ScopedState< T >::ScopedState ( const ScopedState< T > &  other  )  [inline]

Copy constructor.

Definition at line 99 of file ScopedState.h.

template<class T = StateSpace>
template<class O >
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
ompl::base::ScopedState< T >::~ScopedState ( void   )  [inline]

Free the memory of the internally allocated state.

Definition at line 139 of file ScopedState.h.


Member Function Documentation

template<class T = StateSpace>
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
template<class O >
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.

template<class T = StateSpace>
void ompl::base::ScopedState< T >::enforceBounds ( void   )  [inline]

Enforce the bounds on the maintained state.

Definition at line 314 of file ScopedState.h.

template<class T = StateSpace>
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.

template<class T = StateSpace>
StateType* ompl::base::ScopedState< T >::get ( void   )  [inline]

Returns a pointer to the contained state.

Definition at line 368 of file ScopedState.h.

template<class T = StateSpace>
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.

template<class T = StateSpace>
template<class O >
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
const StateType& ompl::base::ScopedState< T >::operator* ( void   )  const [inline]

De-references to the contained state.

Definition at line 350 of file ScopedState.h.

template<class T = StateSpace>
StateType& ompl::base::ScopedState< T >::operator* ( void   )  [inline]

De-references to the contained state.

Definition at line 344 of file ScopedState.h.

template<class T = StateSpace>
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.

template<class T = StateSpace>
StateType* ompl::base::ScopedState< T >::operator-> ( void   )  [inline]

Returns a pointer to the contained state.

Definition at line 356 of file ScopedState.h.

template<class T = StateSpace>
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
template<class O >
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.

template<class T = StateSpace>
ScopedState<T>& ompl::base::ScopedState< T >::operator= ( const State other  )  [inline]

Assignment operator.

Definition at line 182 of file ScopedState.h.

template<class T = StateSpace>
ScopedState<T>& ompl::base::ScopedState< T >::operator= ( const State other  )  [inline]

Assignment operator.

Definition at line 166 of file ScopedState.h.

template<class T = StateSpace>
ScopedState<T>& ompl::base::ScopedState< T >::operator= ( const ScopedState< T > &  other  )  [inline]

Assignment operator.

Definition at line 151 of file ScopedState.h.

template<class T = StateSpace>
template<class O >
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
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.

template<class T >
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.

template<class T = StateSpace>
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.

template<class T = StateSpace>
void ompl::base::ScopedState< T >::random ( void   )  [inline]

Set this state to a random value (uniform).

Definition at line 306 of file ScopedState.h.

template<class T = StateSpace>
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.

template<class T = StateSpace>
bool ompl::base::ScopedState< T >::satisfiesBounds ( void   )  const [inline]

Check if the maintained state satisfies bounds.

Definition at line 320 of file ScopedState.h.


Member Data Documentation

template<class T = StateSpace>
StateSamplerPtr ompl::base::ScopedState< T >::sampler_ [private]

Definition at line 388 of file ScopedState.h.

template<class T = StateSpace>
StateSpacePtr ompl::base::ScopedState< T >::space_ [private]

Definition at line 387 of file ScopedState.h.

template<class T = StateSpace>
StateType* ompl::base::ScopedState< T >::state_ [private]

Definition at line 389 of file ScopedState.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


ompl
Author(s): Ioan Sucan/isucan@rice.edu, Mark Moll/mmoll@rice.edu, Lydia Kavraki/kavraki@rice.edu
autogenerated on Fri Jan 11 09:34:00 2013