|
WSF
|
#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 | |
| WsfExtensionList & | operator= (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) |
| WsfExtension * | FindExtension (const std::string &aName) const |
| WsfExtension & | GetExtension (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 ExtensionMap & | GetExtensions () 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 DependencyList & | GetDependencies () const |
Iterators | |
| const_iterator | begin () const |
| const_iterator | end () const |
A container maintains a list of extensions. Stores dependencies between extensions, and computes an initialization order to satisfy them using a topological sort.
| using WsfExtensionList::const_iterator = ExtensionMap::const_iterator |
| using WsfExtensionList::DependencyList = std::vector<std::pair<std::string, Dependency>> |
| using WsfExtensionList::ExtensionMap = std::map<std::string, std::unique_ptr<WsfExtension>> |
| using WsfExtensionList::iterator = ExtensionMap::iterator |
|
default |
Referenced by operator=(), and WsfExtensionList().
|
delete |
References WsfExtensionList().
|
default |
| void WsfExtensionList::AddDependency | ( | const std::string & | aExtensionName, |
| const std::string & | aDependsOnExtensionName, | ||
| bool | aRequired ) |
Add a dependency between an extension and another extension.
| void WsfExtensionList::AddExtension | ( | const std::string & | aName, |
| std::unique_ptr< WsfExtension > | aExtensionPtr ) |
Adds an extension to the list. This class assumes ownership of aExtensionPtr.
| WsfDuplicateExtension | if an extension with that name already exists. |
|
inline |
|
inline |
| WsfExtension * WsfExtensionList::FindExtension | ( | const std::string & | aName | ) | const |
Return a pointer to the extension with the specified name.
| aName | The name of the extension to be located. |
Referenced by GetExtensionsInOrder().
|
inline |
| WsfExtension & WsfExtensionList::GetExtension | ( | const std::string & | aName | ) | const |
Return a reference to the extension with the specified name.
| aName | The name of the extension to be located. |
| WsfUnknownExtension | if the extension could not be found. |
|
inline |
|
inline |
| std::vector< WsfExtension * > WsfExtensionList::GetExtensionsInOrder | ( | ) | const |
Returns a list of extensions in the order of initialization.
References FindExtension().
|
delete |
References WsfExtensionList().
| void WsfExtensionList::SortExtensions | ( | ) |
Sort the extensions while accounting for dependencies.