This class adapts a domain structure, which shall be doubled for supporting download-changes.
More...
#include <DualDomain.hxx>
|
template<class ... Args> |
| DualDomain (Args &&... args) |
| Constructs an DualDomain instance. More...
|
|
T & | Get (bool backgroundDomain) |
| Gets a reference to one of the domain instances. More...
|
|
const T & | Get (bool backgroundDomain) const |
| Gets a reference of one of the domain instances. More...
|
|
void | SwapDomains (bool simulate) |
| Swaps the domains, so that the foreground domain becomes the background domain and vice versa. More...
|
|
template<class T>
class Arp::Plc::Domain::Commons::DualDomain< T >
This class adapts a domain structure, which shall be doubled for supporting download-changes.
- Template Parameters
-
T | The type of the domain to be doubled. This type shall derive from DomainBase. |
◆ DualDomain()
template<class T >
template<class ... Args>
Constructs an DualDomain instance.
- Parameters
-
...args | The constructor arguments, which shall be passed to the adapted domain. |
The arguments are passed to the foreground domain as well as to the background domain.
There is no perfect forwarding of the arguments here. They have to be passed to both domains. Using std::forward on both would to lead to pass moved-from objects to domain2. Using std::forward only on domain2 might call different constructors on domain1 and domain2. So no std::forward ist used and only lvalues are passed to both domains.
◆ Get() [1/2]
Gets a reference to one of the domain instances.
- Parameters
-
backgroundDomain | true if the background domain shall be returned, otherwise false . |
- Returns
- One of the domain instances depending on the boolean parameter.
◆ Get() [2/2]
Gets a reference of one of the domain instances.
- Parameters
-
backgroundDomain | true if the background domain shall be returned, otherwise false . |
- Returns
- One of the domain instances depending on the boolean parameter.
◆ SwapDomains()
Swaps the domains, so that the foreground domain becomes the background domain and vice versa.
- Parameters
-
simulate | If true the swap is just simulated to measure the duration. |
The documentation for this class was generated from the following file: