Aikido
aikido::statespace::ScopedState< _Handle > Class Template Reference

CRTP RAII wrapper for a StateHandle. More...

#include <aikido/statespace/ScopedState.hpp>

Inheritance diagram for aikido::statespace::ScopedState< _Handle >:

Public Types

using Handle = _Handle
 

Public Member Functions

 ScopedState (const StateSpace *_space)
 Construct a ScopedState by allocating a new state in _space. More...
 
virtual ~ScopedState ()
 
 ScopedState (const ScopedState &)=delete
 
ScopedStateoperator= (const ScopedState &)=delete
 
 ScopedState (ScopedState &&)=default
 
ScopedStateoperator= (ScopedState &&)=default
 
ScopedState clone () const
 Creates an identical clone of the state this ScopedState handles. More...
 

Private Attributes

std::unique_ptr< char[]> mBuffer
 

Detailed Description

template<class _Handle>
class aikido::statespace::ScopedState< _Handle >

CRTP RAII wrapper for a StateHandle.

The constructor of ScopedState allocates a state and the destructor destroys it.

Template Parameters
_HandleStateHandle class being wrapped.

Member Typedef Documentation

◆ Handle

template<class _Handle >
using aikido::statespace::ScopedState< _Handle >::Handle = _Handle

Constructor & Destructor Documentation

◆ ScopedState() [1/3]

template<class Handle >
aikido::statespace::ScopedState< Handle >::ScopedState ( const StateSpace _space)
explicit

Construct a ScopedState by allocating a new state in _space.

This state will be freed when ScopedState is destructed.

Parameters
_spacestate

◆ ~ScopedState()

template<class Handle >
aikido::statespace::ScopedState< Handle >::~ScopedState
virtual

◆ ScopedState() [2/3]

template<class _Handle >
aikido::statespace::ScopedState< _Handle >::ScopedState ( const ScopedState< _Handle > &  )
delete

◆ ScopedState() [3/3]

template<class _Handle >
aikido::statespace::ScopedState< _Handle >::ScopedState ( ScopedState< _Handle > &&  )
default

Member Function Documentation

◆ clone()

template<class Handle >
ScopedState< Handle > aikido::statespace::ScopedState< Handle >::clone

Creates an identical clone of the state this ScopedState handles.

◆ operator=() [1/2]

template<class _Handle >
ScopedState& aikido::statespace::ScopedState< _Handle >::operator= ( const ScopedState< _Handle > &  )
delete

◆ operator=() [2/2]

template<class _Handle >
ScopedState& aikido::statespace::ScopedState< _Handle >::operator= ( ScopedState< _Handle > &&  )
default

Member Data Documentation

◆ mBuffer

template<class _Handle >
std::unique_ptr<char[]> aikido::statespace::ScopedState< _Handle >::mBuffer
private