PLaSK library
Loading...
Searching...
No Matches
plask::CombinedProviderBase< BaseProviderT > Struct Template Reference

Template of base class of combine provider. More...

#include <plask/provider/combined_provider.hpp>

Inheritance diagram for plask::CombinedProviderBase< BaseProviderT >:
[legend]
Collaboration diagram for plask::CombinedProviderBase< BaseProviderT >:
[legend]

Public Types

typedef BaseProviderT BaseType
 
typedef boost::indirect_iterator< typename std::set< BaseProviderT * >::iterator > iterator
 Type of iterator over BaseProviderT.
 
typedef boost::indirect_iterator< typename std::set< BaseProviderT * >::const_iterator > const_iterator
 Type of const iterator over BaseProviderT.
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void add (BaseProviderT *to_add, bool providerIsPrivate=false)
 Append new provider to set of the held providers.
 
void add (std::unique_ptr< BaseProviderT > &&to_add)
 Append new provider to the set of the held providers.
 
void remove (BaseProviderT *to_remove)
 Remove specified provider from the set of the held providers.
 
void clear ()
 Remove all providers from the set of the held providers.
 
 ~CombinedProviderBase ()
 Delete all private providers.
 
bool empty () const
 Check if the providers set of this is empty.
 
std::size_t size () const
 Get number of providers in the set.
 
void ensureHasProviders () const
 Throw exception if the providers set of this is empty.
 

Protected Attributes

std::set< BaseProviderT * > providers
 Set of providers which values are combinating.
 

Detailed Description

template<typename BaseProviderT>
struct plask::CombinedProviderBase< BaseProviderT >

Template of base class of combine provider.

Subclass should define operator() which should combine values from providers (which are available by begin() and end() iterators).

Definition at line 36 of file combined_provider.hpp.

Member Typedef Documentation

◆ BaseType

template<typename BaseProviderT >
typedef BaseProviderT plask::CombinedProviderBase< BaseProviderT >::BaseType

Definition at line 38 of file combined_provider.hpp.

◆ const_iterator

template<typename BaseProviderT >
typedef boost::indirect_iterator<typename std::set<BaseProviderT*>::const_iterator> plask::CombinedProviderBase< BaseProviderT >::const_iterator

Type of const iterator over BaseProviderT.

Definition at line 63 of file combined_provider.hpp.

◆ iterator

template<typename BaseProviderT >
typedef boost::indirect_iterator<typename std::set<BaseProviderT*>::iterator> plask::CombinedProviderBase< BaseProviderT >::iterator

Type of iterator over BaseProviderT.

Definition at line 60 of file combined_provider.hpp.

Constructor & Destructor Documentation

◆ ~CombinedProviderBase()

template<typename BaseProviderT >
plask::CombinedProviderBase< BaseProviderT >::~CombinedProviderBase ( )
inline

Delete all private providers.

Definition at line 116 of file combined_provider.hpp.

Member Function Documentation

◆ add() [1/2]

template<typename BaseProviderT >
void plask::CombinedProviderBase< BaseProviderT >::add ( BaseProviderT *  to_add,
bool  providerIsPrivate = false 
)
inline

Append new provider to set of the held providers.

Parameters
to_addprovider to append, can't be nullptr
providerIsPrivatetrue only if provider is private for this and will be deleted by destructor of this

Definition at line 82 of file combined_provider.hpp.

◆ add() [2/2]

template<typename BaseProviderT >
void plask::CombinedProviderBase< BaseProviderT >::add ( std::unique_ptr< BaseProviderT > &&  to_add)
inline

Append new provider to the set of the held providers.

Parameters
to_addprovider to append, can't be nullptr, will be deleted by destructor of this

Definition at line 93 of file combined_provider.hpp.

◆ begin() [1/2]

template<typename BaseProviderT >
iterator plask::CombinedProviderBase< BaseProviderT >::begin ( )
inline
Returns
begin iterator over BaseProviderT

Definition at line 66 of file combined_provider.hpp.

◆ begin() [2/2]

template<typename BaseProviderT >
const_iterator plask::CombinedProviderBase< BaseProviderT >::begin ( ) const
inline
Returns
const begin iterator over BaseProviderT

Definition at line 72 of file combined_provider.hpp.

◆ clear()

template<typename BaseProviderT >
void plask::CombinedProviderBase< BaseProviderT >::clear ( )
inline

Remove all providers from the set of the held providers.

Delete private providers.

Definition at line 111 of file combined_provider.hpp.

◆ empty()

template<typename BaseProviderT >
bool plask::CombinedProviderBase< BaseProviderT >::empty ( ) const
inline

Check if the providers set of this is empty.

Returns
true if this not contains any provider

Definition at line 124 of file combined_provider.hpp.

◆ end() [1/2]

template<typename BaseProviderT >
iterator plask::CombinedProviderBase< BaseProviderT >::end ( )
inline
Returns
past-the-end iterator over BaseProviderT

Definition at line 69 of file combined_provider.hpp.

◆ end() [2/2]

template<typename BaseProviderT >
const_iterator plask::CombinedProviderBase< BaseProviderT >::end ( ) const
inline
Returns
const past-the-end iterator over BaseProviderT

Definition at line 75 of file combined_provider.hpp.

◆ ensureHasProviders()

template<typename BaseProviderT >
void plask::CombinedProviderBase< BaseProviderT >::ensureHasProviders ( ) const
inline

Throw exception if the providers set of this is empty.

Definition at line 135 of file combined_provider.hpp.

◆ remove()

template<typename BaseProviderT >
void plask::CombinedProviderBase< BaseProviderT >::remove ( BaseProviderT *  to_remove)
inline

Remove specified provider from the set of the held providers.

Parameters
to_removeprovider to remove, it will be deleted if it is private

Definition at line 101 of file combined_provider.hpp.

◆ size()

template<typename BaseProviderT >
std::size_t plask::CombinedProviderBase< BaseProviderT >::size ( ) const
inline

Get number of providers in the set.

Returns
number of providers

Definition at line 130 of file combined_provider.hpp.

Member Data Documentation

◆ providers

template<typename BaseProviderT >
std::set<BaseProviderT*> plask::CombinedProviderBase< BaseProviderT >::providers
protected

Set of providers which values are combinating.

Definition at line 55 of file combined_provider.hpp.


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