Parasol Planning Library (PPL)
MethodSet< Method > Class Template Referencefinal

#include <MethodSet.h>

Public Types

Local Types
typedef Method * MethodPointer
 
typedef std::shared_ptr< Method > OwningPointer
 
typedef std::map< std::string, OwningPointerMethodMap
 
typedef std::function< OwningPointer(XMLNode &)> FactoryType
 
typedef std::map< std::string, FactoryTypeFactoryMap
 
typedef MethodMap::iterator iterator
 
typedef MethodMap::const_iterator const_iterator
 

Public Member Functions

Construction
template<typename MethodTypeList >
 MethodSet (MPLibrary *const _p, const MethodTypeList &_mtl, const std::string &_name)
 
Method Accessors
void ParseXML (XMLNode &_node)
 Add the appropriate methods from an XML node. More...
 
void AddMethod (XMLNode &_node)
 
void AddMethod (MethodPointer _e, const std::string &_label)
 
void AddMethod (OwningPointer _e, const std::string &_label)
 
MethodPointer GetMethod (const std::string &_label)
 
void Initialize ()
 
void Print (std::ostream &_os) const
 Display the instantiated methods. More...
 
Iteration

Iterate over the instantiated methods.

iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 

Detailed Description

template<typename Method>
class MethodSet< Method >

Defines basic method container class to hold methods (for classes like DistanceMetricMethod, LocalPlannerMethod, etc).

MethodTypeList must be defined within templated class of MPTraits e.g., Method = NeighborhoodFinderMethod MethodTypeList = boost::mpl::list<BruteForceNF, BandsNF, ...> e.g., Method = LocalPlannerMethod MethodTypeList = boost::mpl::list<Straightline, RotateAtS, ...>

MethodSet first parses the MethodTypeList and adds all enumerated methods to its universe of method types. Then, specific instantiations of those types can be added to its map of available methods by calling 'AddMethod'.

Member Typedef Documentation

◆ const_iterator

template<typename Method >
typedef MethodMap::const_iterator MethodSet< Method >::const_iterator

◆ FactoryMap

template<typename Method >
typedef std::map<std::string, FactoryType> MethodSet< Method >::FactoryMap

◆ FactoryType

template<typename Method >
typedef std::function<OwningPointer(XMLNode&)> MethodSet< Method >::FactoryType

◆ iterator

template<typename Method >
typedef MethodMap::iterator MethodSet< Method >::iterator

◆ MethodMap

template<typename Method >
typedef std::map<std::string, OwningPointer> MethodSet< Method >::MethodMap

◆ MethodPointer

template<typename Method >
typedef Method* MethodSet< Method >::MethodPointer

◆ OwningPointer

template<typename Method >
typedef std::shared_ptr<Method> MethodSet< Method >::OwningPointer

Constructor & Destructor Documentation

◆ MethodSet()

template<typename Method >
template<typename MethodTypeList >
MethodSet< Method >::MethodSet ( MPLibrary *const  _p,
const MethodTypeList &  _mtl,
const std::string &  _name 
)

Construct a MethodSet from a MethodTypeList defined in the MPTraits class.

Parameters
_mtlAn instance of the method type list.
_nameThe name of this method set.

Member Function Documentation

◆ AddMethod() [1/3]

template<typename Method >
void MethodSet< Method >::AddMethod ( MethodPointer  _e,
const std::string &  _label 
)

◆ AddMethod() [2/3]

template<typename Method >
void MethodSet< Method >::AddMethod ( OwningPointer  _e,
const std::string &  _label 
)

◆ AddMethod() [3/3]

template<typename Method >
void MethodSet< Method >::AddMethod ( XMLNode _node)

◆ begin() [1/2]

template<typename Method >
MethodSet< Method >::const_iterator MethodSet< Method >::begin
inlinenoexcept

◆ begin() [2/2]

template<typename Method >
MethodSet< Method >::iterator MethodSet< Method >::begin
inlinenoexcept

◆ end() [1/2]

template<typename Method >
MethodSet< Method >::const_iterator MethodSet< Method >::end
inlinenoexcept

◆ end() [2/2]

template<typename Method >
MethodSet< Method >::iterator MethodSet< Method >::end
inlinenoexcept

◆ GetMethod()

template<typename Method >
MethodSet< Method >::MethodPointer MethodSet< Method >::GetMethod ( const std::string &  _label)

Get a method by label.

Parameters
_labelThe method label.
Returns
The corresponding method pointer.

◆ Initialize()

template<typename Method >
void MethodSet< Method >::Initialize

Prepare all methods in this set for execution on the owning MPLibrary's current MPProblem.

◆ ParseXML()

template<typename Method >
void MethodSet< Method >::ParseXML ( XMLNode _node)

Add the appropriate methods from an XML node.

◆ Print()

template<typename Method >
void MethodSet< Method >::Print ( std::ostream &  _os) const

Display the instantiated methods.


The documentation for this class was generated from the following file: