DNA Calib 1.1
Project brief
Public Member Functions | Private Types | Private Attributes | List of all members
dnac::ConditionalCommand< TCommand, TCondition > Class Template Reference

ConditionalCommand is used to run a command if the specified condition is met. More...

#include <ConditionalCommand.h>

Inheritance diagram for dnac::ConditionalCommand< TCommand, TCondition >:
Inheritance graph
Collaboration diagram for dnac::ConditionalCommand< TCommand, TCondition >:
Collaboration graph

Public Member Functions

 ConditionalCommand ()
 
 ConditionalCommand (CommandType *command_, ConditionType condition_)
 
 ~ConditionalCommand ()=default
 
 ConditionalCommand (const ConditionalCommand &)=delete
 
ConditionalCommandoperator= (const ConditionalCommand &)=delete
 
 ConditionalCommand (ConditionalCommand &&)=default
 
ConditionalCommandoperator= (ConditionalCommand &&)=default
 
void setCommand (Command *command_)
 Method for setting the command to run. More...
 
void setCondition (ConditionType condition_)
 Method for setting the condition under which the command should run. More...
 
void run (DNACalibDNAReader *output) override
 
- Public Member Functions inherited from dnac::Command
virtual ~Command ()
 
virtual void run (DNACalibDNAReader *output)=0
 

Private Types

using CommandType = TCommand
 
using ConditionType = TCondition
 

Private Attributes

CommandTypecommand
 
ConditionType condition
 

Detailed Description

template<class TCommand, class TCondition>
class dnac::ConditionalCommand< TCommand, TCondition >

ConditionalCommand is used to run a command if the specified condition is met.

Member Typedef Documentation

◆ CommandType

template<class TCommand , class TCondition >
using dnac::ConditionalCommand< TCommand, TCondition >::CommandType = TCommand
private

◆ ConditionType

template<class TCommand , class TCondition >
using dnac::ConditionalCommand< TCommand, TCondition >::ConditionType = TCondition
private

Constructor & Destructor Documentation

◆ ConditionalCommand() [1/4]

template<class TCommand , class TCondition >
dnac::ConditionalCommand< TCommand, TCondition >::ConditionalCommand ( )
inline
21 :
22 command{nullptr},
23 condition{} {
24 }
ConditionType condition
Definition: ConditionalCommand.h:65
CommandType * command
Definition: ConditionalCommand.h:64

◆ ConditionalCommand() [2/4]

template<class TCommand , class TCondition >
dnac::ConditionalCommand< TCommand, TCondition >::ConditionalCommand ( CommandType command_,
ConditionType  condition_ 
)
inline
26 :
27 command{command_},
28 condition{condition_} {
29 }

◆ ~ConditionalCommand()

template<class TCommand , class TCondition >
dnac::ConditionalCommand< TCommand, TCondition >::~ConditionalCommand ( )
default

◆ ConditionalCommand() [3/4]

template<class TCommand , class TCondition >
dnac::ConditionalCommand< TCommand, TCondition >::ConditionalCommand ( const ConditionalCommand< TCommand, TCondition > &  )
delete

◆ ConditionalCommand() [4/4]

template<class TCommand , class TCondition >
dnac::ConditionalCommand< TCommand, TCondition >::ConditionalCommand ( ConditionalCommand< TCommand, TCondition > &&  )
default

Member Function Documentation

◆ operator=() [1/2]

template<class TCommand , class TCondition >
ConditionalCommand & dnac::ConditionalCommand< TCommand, TCondition >::operator= ( ConditionalCommand< TCommand, TCondition > &&  )
default

◆ operator=() [2/2]

template<class TCommand , class TCondition >
ConditionalCommand & dnac::ConditionalCommand< TCommand, TCondition >::operator= ( const ConditionalCommand< TCommand, TCondition > &  )
delete

◆ run()

template<class TCommand , class TCondition >
void dnac::ConditionalCommand< TCommand, TCondition >::run ( DNACalibDNAReader output)
inlineoverridevirtual

◆ setCommand()

template<class TCommand , class TCondition >
void dnac::ConditionalCommand< TCommand, TCondition >::setCommand ( Command command_)
inline

Method for setting the command to run.

Parameters
command_The command to run.
44 {
45 command = command_;
46 }

References dnac::ConditionalCommand< TCommand, TCondition >::command.

◆ setCondition()

template<class TCommand , class TCondition >
void dnac::ConditionalCommand< TCommand, TCondition >::setCondition ( ConditionType  condition_)
inline

Method for setting the condition under which the command should run.

Parameters
condition_The condition that should be met.
53 {
54 condition = condition_;
55 }

References dnac::ConditionalCommand< TCommand, TCondition >::condition.

Member Data Documentation

◆ command

template<class TCommand , class TCondition >
CommandType* dnac::ConditionalCommand< TCommand, TCondition >::command
private

◆ condition

template<class TCommand , class TCondition >
ConditionType dnac::ConditionalCommand< TCommand, TCondition >::condition
private

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