Parasol Planning Library (PPL)
TMPMethodSet< TMPMethod > Class Template Reference

#include <TMPMethodSet.h>

Public Types

Local Types
typedef std::shared_ptr< TMPMethod > TMPMethodPointer
 
typedef std::map< std::string, TMPMethodPointerTMPMethodMap
 
typedef std::function< TMPMethodPointer(XMLNode &)> FactoryType
 
typedef std::map< std::string, FactoryTypeFactoryMap
 
typedef TMPMethodMap::iterator iterator
 
typedef TMPMethodMap::const_iterator const_iterator
 

Public Member Functions

Construction
template<typename TMPMethodTypeList >
 TMPMethodSet (TMPLibrary *const _p, const TMPMethodTypeList &_mtl, const std::string &_name)
 
TMPMethod Accessors
void ParseXML (XMLNode &_node)
 Add the appropriate TMPMethods from an XML node. More...
 
void AddMethod (XMLNode &_node)
 
void AddMethod (TMPMethodPointer _e, const std::string &_label)
 
TMPMethodPointer GetMethod (const std::string &_label)
 
iterator FindMethod (std::string _label)
 
void Initialize ()
 
void Print (std::ostream &_os) const
 Display the instantiated TMPMethods. More...
 
Iteration

Iterate over the instantiated TMPMethods.

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

Detailed Description

template<typename TMPMethod>
class TMPMethodSet< TMPMethod >

Defines basic TMPMethod container class to hold TMPMethods (for classes like DistanceMetricTMPMethod, LocalPlannerTMPMethod, etc).

TMPMethodTypeList must be defined within templated class of MPTraits e.g., TMPMethod = NeighborhoodFinderTMPMethod TMPMethodTypeList = boost::mpl::list<BruteForceNF, BandsNF, ...> e.g., TMPMethod = LocalPlannerTMPMethod TMPMethodTypeList = boost::mpl::list<Straightline, RotateAtS, ...>

TMPMethodSet first parses the TMPMethodTypeList and adds all enumerated TMPMethods to its universe of TMPMethod types. Then, specific instantiations of those types can be added to its map of available TMPMethods by calling 'AddTMPMethod'.

Member Typedef Documentation

◆ const_iterator

template<typename TMPMethod >
typedef TMPMethodMap::const_iterator TMPMethodSet< TMPMethod >::const_iterator

◆ FactoryMap

template<typename TMPMethod >
typedef std::map<std::string, FactoryType> TMPMethodSet< TMPMethod >::FactoryMap

◆ FactoryType

template<typename TMPMethod >
typedef std::function<TMPMethodPointer(XMLNode&)> TMPMethodSet< TMPMethod >::FactoryType

◆ iterator

template<typename TMPMethod >
typedef TMPMethodMap::iterator TMPMethodSet< TMPMethod >::iterator

◆ TMPMethodMap

template<typename TMPMethod >
typedef std::map<std::string, TMPMethodPointer> TMPMethodSet< TMPMethod >::TMPMethodMap

◆ TMPMethodPointer

template<typename TMPMethod >
typedef std::shared_ptr<TMPMethod> TMPMethodSet< TMPMethod >::TMPMethodPointer

Constructor & Destructor Documentation

◆ TMPMethodSet()

template<typename TMPMethod >
template<typename TMPMethodTypeList >
TMPMethodSet< TMPMethod >::TMPMethodSet ( TMPLibrary *const  _p,
const TMPMethodTypeList &  _mtl,
const std::string &  _name 
)

Construct a TMPMethodSet from a TMPMethodTypeList defined in the MPTraits class.

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

Member Function Documentation

◆ AddMethod() [1/2]

template<typename TMPMethod >
void TMPMethodSet< TMPMethod >::AddMethod ( TMPMethodPointer  _e,
const std::string &  _label 
)

◆ AddMethod() [2/2]

template<typename TMPMethod >
void TMPMethodSet< TMPMethod >::AddMethod ( XMLNode _node)

◆ begin() [1/2]

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::const_iterator TMPMethodSet< TMPMethod >::begin
noexcept

◆ begin() [2/2]

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::iterator TMPMethodSet< TMPMethod >::begin
noexcept

◆ end() [1/2]

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::const_iterator TMPMethodSet< TMPMethod >::end
noexcept

◆ end() [2/2]

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::iterator TMPMethodSet< TMPMethod >::end
noexcept

◆ FindMethod()

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::iterator TMPMethodSet< TMPMethod >::FindMethod ( std::string  _label)

Find a TMPMethod iterator.

Parameters
_labelThe TMPMethod label.
Returns
The iterator to that TMPMethod, or nullptr if it is not found.

◆ GetMethod()

template<typename TMPMethod >
TMPMethodSet< TMPMethod >::TMPMethodPointer TMPMethodSet< TMPMethod >::GetMethod ( const std::string &  _label)

Get a TMPMethod by label.

Parameters
_labelThe TMPMethod label.
Returns
The corresponding TMPMethod pointer.

◆ Initialize()

template<typename TMPMethod >
void TMPMethodSet< TMPMethod >::Initialize

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

◆ ParseXML()

template<typename TMPMethod >
void TMPMethodSet< TMPMethod >::ParseXML ( XMLNode _node)

Add the appropriate TMPMethods from an XML node.

◆ Print()

template<typename TMPMethod >
void TMPMethodSet< TMPMethod >::Print ( std::ostream &  _os) const

Display the instantiated TMPMethods.


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