wavelength 1.0.0
Loading...
Searching...
No Matches
SerializableCommand< kId, T > Class Template Reference

Command that a recording saves and rebuilds through Factory<Command>. More...

#include <serializablecommand.h>

Inheritance diagram for SerializableCommand< kId, T >:
Collaboration diagram for SerializableCommand< kId, T >:

Public Member Functions

 SerializableCommand ()
 Construct the command.
bool IsSerializable () override
 Report that a recording saves the command.
int GetSerialId () override
 Report the identifier a recording rebuilds the command by.
Public Member Functions inherited from Command
 ~Command () override
 Release the command.
virtual void Execute ()=0
 Do the work.
virtual void Save (BinStream &stream) const
 Write the command to a recording.
virtual void Load (BinStream &stream)
 Read the command Save() writes.
Public Member Functions inherited from Attachment
 Attachment ()
 Construct an object with no reference.
virtual ~Attachment ()
 Release the object.
void AddRef ()
 Take one reference.
void Release ()
 Give back one reference and delete the object once the last one is gone.

Additional Inherited Members

Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.

Detailed Description

template<int kId, typename T>
class SerializableCommand< kId, T >

Command that a recording saves and rebuilds through Factory<Command>.

The RTTI includes the template with the identifier and the derived class as its arguments. Every member is inline. Each instance registers the derived class under the identifier during static initialisation.

Template Parameters
kIdThe identifier.
TThe derived class, which has a constructor that takes a BinStream.

Constructor & Destructor Documentation

◆ SerializableCommand()

template<int kId, typename T>
SerializableCommand< kId, T >::SerializableCommand ( )
inline

Construct the command.

Member Function Documentation

◆ IsSerializable()

template<int kId, typename T>
bool SerializableCommand< kId, T >::IsSerializable ( )
inlineoverridevirtual

Report that a recording saves the command.

Returns
True.

Reimplemented from Command.

◆ GetSerialId()

template<int kId, typename T>
int SerializableCommand< kId, T >::GetSerialId ( )
inlineoverridevirtual

Report the identifier a recording rebuilds the command by.

Returns
kId.

Reimplemented from Command.


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