resonance 1.0.1
Loading...
Searching...
No Matches
gempacket.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "msg/gem.h"
7
8class IBStream;
9class OBStream;
10
38public:
46 }
47
58 GemPacket(const Gem &fields, int nTr) : mFields(fields), mTr(nTr) {
59 }
60
71 static Message *New();
72
80 virtual Message *Clone();
81
89 virtual int Type();
90
98 virtual const char *GetName() const;
99
109 virtual void PrintExtra(std::ostream &stream) const;
110
122 virtual void saveGuts(OBStream &stream) const;
123
133 virtual void restoreGuts(IBStream &stream);
134
141
147 int mTr;
148};
149
158extern int g_nGemPacketType;
virtual void restoreGuts(IBStream &stream)
Read the packet back from a stream.
Gem mFields
The gem.
Definition gempacket.h:140
GemPacket()
Construct a packet with the payload unset beyond the Packet words and the position.
Definition gempacket.h:45
int mTr
The track, labelled tr: by PrintExtra().
Definition gempacket.h:147
virtual void saveGuts(OBStream &stream) const
Write the packet to a stream.
virtual void PrintExtra(std::ostream &stream) const
Write a description of the packet to a diagnostic stream.
static Message * New()
Produce a default-constructed packet on the heap.
virtual Message * Clone()
Produce a heap copy of this packet.
virtual int Type()
Report this packet's registered identity.
virtual const char * GetName() const
Report this packet's class name.
GemPacket(const Gem &fields, int nTr)
Report one gem event.
Definition gempacket.h:58
Gem event a GemPacket reports.
Definition gem.h:24
Input half of the byte stream interface.
Definition ibstream.h:36
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Output half of the byte stream interface.
Definition obstream.h:25
ToAllOtherGameSystemsPacket()
Route the packet with the pair 2 and 3.
Definition toallothergamesystemspacket.h:21
int g_nGemPacketType
Identity that GemPacket::Type() reports.