CommandSequence is used to run a sequence of commands on the same DNA.
More...
#include <CommandSequence.h>
CommandSequence is used to run a sequence of commands on the same DNA.
- Note
- Commands will be run in the order in which they were added to the sequence.
-
CommandSequence holds pointers to commands, but does not own them.
◆ CommandSequence() [1/3]
dnac::CommandSequence::CommandSequence |
( |
MemoryResource * |
memRes = nullptr | ) |
|
|
explicit |
49 :
50 pImpl{makeScoped<Impl>(memRes)} {
51}
ScopedPtr< Impl > pImpl
Definition: CommandSequence.h:94
◆ ~CommandSequence()
dnac::CommandSequence::~CommandSequence |
( |
| ) |
|
|
default |
◆ CommandSequence() [2/3]
◆ CommandSequence() [3/3]
◆ add() [1/3]
Method for adding multiple commands to a sequence of commands to run.
- Parameters
-
commands | The commands to add. |
65 {
66 for (auto& cmd : commands) {
68 }
69}
References pImpl.
◆ add() [2/3]
void dnac::CommandSequence::add |
( |
Command * |
command | ) |
|
Method for adding a command to a sequence of commands to run.
- Parameters
-
command | The command to add. |
References pImpl.
Referenced by add(), and main().
◆ add() [3/3]
template<class ... Commands>
void dnac::CommandSequence::add |
( |
Commands... |
commands | ) |
|
|
inline |
49 {
50 static_assert(sizeof...(commands) > 0, "At least one command must be passed.");
51 Command* commandList[] = {commands ...};
52 for (auto cmd : commandList) {
54 }
55 }
DNACAPI void add(Command *command)
Method for adding a command to a sequence of commands to run.
Definition: src/dnacalib/commands/CommandSequence.cpp:61
References add().
◆ contains()
bool dnac::CommandSequence::contains |
( |
Command * |
command | ) |
const |
Method for checking if the provided command is part of the command sequence.
- Parameters
-
command | The command to check. |
81 {
82 return pImpl->contains(command);
83}
References pImpl.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ remove() [1/3]
Method for removing an array of commands from the sequence of commands to run.
- Parameters
-
commands | The commands to remove. |
75 {
76 for (auto& cmd : commands) {
78 }
79}
References pImpl.
◆ remove() [2/3]
void dnac::CommandSequence::remove |
( |
Command * |
command | ) |
|
Method for removing a command from the sequence of commands to run.
- Parameters
-
command | The command to remove. |
71 {
72 pImpl->remove(command);
73}
References pImpl.
Referenced by main(), and remove().
◆ remove() [3/3]
template<class ... Commands>
void dnac::CommandSequence::remove |
( |
Commands... |
commands | ) |
|
|
inline |
72 {
73 static_assert(sizeof...(commands) > 0, "At least one command must be passed.");
74 Command* commandList[] = {commands ...};
75 for (auto cmd : commandList) {
77 }
78 }
DNACAPI void remove(Command *command)
Method for removing a command from the sequence of commands to run.
Definition: src/dnacalib/commands/CommandSequence.cpp:71
References remove().
◆ run()
◆ size()
std::size_t dnac::CommandSequence::size |
( |
| ) |
const |
Number of commands in command sequence.
References pImpl.
◆ pImpl
The documentation for this class was generated from the following files: