wavelength 1.0.0
Loading...
Searching...
No Matches
serializablecommand.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/command.h"
4#include "os/factory.h"
5
16template <int kId, typename T>
18public:
21 (void)sRegistration; // Referenced so that the registration of T is instantiated.
22 }
23
29 bool IsSerializable() override {
30 return true;
31 }
32
38 int GetSerialId() override {
39 return kId;
40 }
41
42private:
44 class Registration {
45 public:
47 Registration() {
48 Factory<Command>::template Register<T>(kId);
49 }
50 };
51
52 static Registration sRegistration;
53};
54
55template <int kId, typename T>
56typename SerializableCommand<kId, T>::Registration SerializableCommand<kId, T>::sRegistration;
Unit of work a Scheduler runs at a set time.
Definition command.h:13
Registry of the classes derived from a base that a stream can rebuild, by identifier.
Definition factory.h:16
bool IsSerializable() override
Report that a recording saves the command.
Definition serializablecommand.h:29
SerializableCommand()
Construct the command.
Definition serializablecommand.h:20
int GetSerialId() override
Report the identifier a recording rebuilds the command by.
Definition serializablecommand.h:38