PLaSK library

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
plask::FiltersFactory Struct Reference

Construct filters using data from XML. More...

`#include <plask/filters/factory.hpp>`

## Classes
struct | Register
| Helper which calls getDefault().add(typeName, filterCreator) in constructor. More...
struct | RegisterStandard
| Helper which calls getDefault().addStandard<PropertyTag>() in constructor. More...

## Public Types
typedef std::function< shared_ptr< Solver >(XMLReader &reader, Manager &manager)> | FilterCreator

## Public Member Functions
shared_ptr< Solver > | get (XMLReader &reader, Manager &manager)
| Try to get filter from tag which is pointed by `reader`.
void | add (const std::string typeName, FilterCreator filterCreator)
template<typename PropertyTag >
void | addStandard ()

## Static Public Member Functions
static FiltersFactory & | getDefault ()
| Get default register of filters factories.
template<typename PropertyTag >
static shared_ptr< Solver > | standard (XMLReader &reader, Manager &manager)
| Standard filter factory.

## Detailed Description

Construct filters using data from XML.

Definition at line 30 of file factory.hpp.

## Member Typedef Documentation

## ◆ FilterCreator

typedef std::function<shared_ptr<Solver>(XMLReader& reader, Manager& manager)> plask::FiltersFactory::FilterCreator

Definition at line 33 of file factory.hpp.

## Member Function Documentation

## ◆ add()

void plask::FiltersFactory::add | ( | const std::string | typeName,
|  | FiltersFactory::FilterCreator | filterCreator
| ) |  |

Definition at line 34 of file factory.cpp.

## ◆ addStandard()

template<typename PropertyTag >

void plask::FiltersFactory::addStandard | ( |  | ) |
| inline

Definition at line 85 of file factory.hpp.

## ◆ get()

shared_ptr< Solver > plask::FiltersFactory::get | ( | XMLReader & | reader,
|  | Manager & | manager
| ) |  |

Try to get filter from tag which is pointed by `reader`.

Throw exception if reader points to filter tag, but this tag can't be parsed.

Parameters

  reader | source of filter configuration, should point to begin of tag
  manager |

Returns
  One of:
  - filter - in such case reader point to end of filter tag,
  - nullptr - if reader doesn't point to filter tag, in such case, reader is not changed.

Definition at line 24 of file factory.cpp.

## ◆ getDefault()

FiltersFactory & plask::FiltersFactory::getDefault | ( |  | ) |
| static

Get default register of filters factories.

Returns
  default register of filters factories

Definition at line 19 of file factory.cpp.

## ◆ standard()

template<typename PropertyTag >

shared_ptr< Solver > plask::FiltersFactory::standard | ( | XMLReader & | reader,
|  | Manager & | manager
| ) |  |
| inline static

Standard filter factory.

Definition at line 90 of file factory.hpp.

The documentation for this struct was generated from the following files:

- plask/filters/factory.hpp
- plask/filters/factory.cpp