WSF
WsfExtensionList Class Reference

#include <WsfExtensionList.hpp>

Classes

struct  Dependency

Public Types

using DependencyList = std::vector<std::pair<std::string, Dependency>>
using ExtensionMap = std::map<std::string, std::unique_ptr<WsfExtension>>
using iterator = ExtensionMap::iterator
using const_iterator = ExtensionMap::const_iterator

Public Member Functions

 WsfExtensionList ()=default
 WsfExtensionList (const WsfExtensionList &)=delete
WsfExtensionListoperator= (const WsfExtensionList &)=delete
 ~WsfExtensionList ()=default

Utility methods

void SortExtensions ()
 Sort the extensions while accounting for dependencies.

Extension list methods.

void AddExtension (const std::string &aName, std::unique_ptr< WsfExtension > aExtensionPtr)
WsfExtensionFindExtension (const std::string &aName) const
WsfExtensionGetExtension (const std::string &aName) const
const std::vector< std::string > & GetExtensionOrder () const
std::vector< WsfExtension * > GetExtensionsInOrder () const
 Returns a list of extensions in the order of initialization.
const ExtensionMapGetExtensions () const

Dependency list methods.

void AddDependency (const std::string &aExtensionName, const std::string &aDependsOnExtensionName, bool aRequired)
 Add a dependency between an extension and another extension.
const DependencyListGetDependencies () const

Iterators

const_iterator begin () const
const_iterator end () const

Detailed Description

A container maintains a list of extensions. Stores dependencies between extensions, and computes an initialization order to satisfy them using a topological sort.

Member Typedef Documentation

◆ const_iterator

using WsfExtensionList::const_iterator = ExtensionMap::const_iterator

◆ DependencyList

using WsfExtensionList::DependencyList = std::vector<std::pair<std::string, Dependency>>

◆ ExtensionMap

using WsfExtensionList::ExtensionMap = std::map<std::string, std::unique_ptr<WsfExtension>>

◆ iterator

using WsfExtensionList::iterator = ExtensionMap::iterator

Constructor & Destructor Documentation

◆ WsfExtensionList() [1/2]

WsfExtensionList::WsfExtensionList ( )
default

Referenced by operator=(), and WsfExtensionList().

◆ WsfExtensionList() [2/2]

WsfExtensionList::WsfExtensionList ( const WsfExtensionList & )
delete

References WsfExtensionList().

◆ ~WsfExtensionList()

WsfExtensionList::~WsfExtensionList ( )
default

Member Function Documentation

◆ AddDependency()

void WsfExtensionList::AddDependency ( const std::string & aExtensionName,
const std::string & aDependsOnExtensionName,
bool aRequired )

Add a dependency between an extension and another extension.

◆ AddExtension()

void WsfExtensionList::AddExtension ( const std::string & aName,
std::unique_ptr< WsfExtension > aExtensionPtr )

Adds an extension to the list. This class assumes ownership of aExtensionPtr.

Exceptions
WsfDuplicateExtensionif an extension with that name already exists.

◆ begin()

const_iterator WsfExtensionList::begin ( ) const
inline

◆ end()

const_iterator WsfExtensionList::end ( ) const
inline

◆ FindExtension()

WsfExtension * WsfExtensionList::FindExtension ( const std::string & aName) const

Return a pointer to the extension with the specified name.

Parameters
aNameThe name of the extension to be located.
Returns
The pointer to the extension, or nullptr if the extension could not be found.

Referenced by GetExtensionsInOrder().

◆ GetDependencies()

const DependencyList & WsfExtensionList::GetDependencies ( ) const
inline

◆ GetExtension()

WsfExtension & WsfExtensionList::GetExtension ( const std::string & aName) const

Return a reference to the extension with the specified name.

Parameters
aNameThe name of the extension to be located.
Returns
A reference to the extension.
Exceptions
WsfUnknownExtensionif the extension could not be found.

◆ GetExtensionOrder()

const std::vector< std::string > & WsfExtensionList::GetExtensionOrder ( ) const
inline

◆ GetExtensions()

const ExtensionMap & WsfExtensionList::GetExtensions ( ) const
inline

◆ GetExtensionsInOrder()

std::vector< WsfExtension * > WsfExtensionList::GetExtensionsInOrder ( ) const

Returns a list of extensions in the order of initialization.

References FindExtension().

◆ operator=()

WsfExtensionList & WsfExtensionList::operator= ( const WsfExtensionList & )
delete

References WsfExtensionList().

◆ SortExtensions()

void WsfExtensionList::SortExtensions ( )

Sort the extensions while accounting for dependencies.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved