resonance 1.0.1
Loading...
Searching...
No Matches
command.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "app/attachment.h"
6
7class IBStream;
8class OBStream;
9
10namespace Sch {
11
60class Command : public Attachment {
61public:
69 }
70
80 virtual ~Command();
81
90 virtual int CmdID() = 0;
91
98 virtual void Execute() = 0;
99
109 virtual void Print(std::ostream &stream);
110
120 virtual void saveGuts(OBStream &stream) const;
121
131 virtual void restoreGuts(IBStream &stream);
132
145 static Command *NewCommand(int nCmdID);
146
161};
162
176OBStream &operator<<(OBStream &stream, Command *pCommand);
177
190IBStream &operator>>(IBStream &stream, Command *&pCommand);
191
205
220
221} // namespace Sch
Attachment()
Definition attachment.h:26
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25
Base of every action the scheduler performs on behalf of another subsystem.
Definition command.h:60
virtual void Execute()=0
Perform the action this command stands for.
virtual void saveGuts(OBStream &stream) const
Write this command's payload.
virtual ~Command()
Release the command.
int mQueued
Non-zero while the command sits in the scheduler's queue.
Definition command.h:160
virtual void restoreGuts(IBStream &stream)
Read this command's payload back.
static Command * NewCommand(int nCmdID)
Produce a command of the identified class through the factory list.
virtual int CmdID()=0
Report the identifier this class streams itself under.
virtual void Print(std::ostream &stream)
Write a description of this command to a diagnostic stream.
Command()
Construct a command that the scheduler has not queued.
Definition command.h:68
Scheduling of timed commands.
Definition activefilter.h:9
IBStream & operator>>(IBStream &stream, Command *&pCommand)
Read a command back through the stream and construct it from the factory list.
OBStream & operator<<(OBStream &stream, Command *pCommand)
Write a command through the stream, preceded by a presence byte.