#include <hn/log.h>
#include <hn/utils.h>
#include "opcodes.h"
#include "packets.h"
#include "zutils.h"
#include "factories.h"
Go to the source code of this file.
Defines | |
| #define | DECLARE_PACKET_HANDLER(Target, Packet) static Factory_##Packet < Target > s_packetFactory##Packet |
| Declares a new packet handler within this parser. | |
| #define | DECLARE_PACKET_HANDLER2(Parent, Target, Packet) static Factory_##Packet < Parent, Target > s_packetFactory##Packet |
| Special version, allowing Parent and Target to differ. | |
| #define | FRIEND_PARSER(Class, Packet) friend class Factory_##Packet<Class> |
| Use this macro in your class's interface to allow parser factories to access the packet handler functions, if they are declared private. | |
| #define | DECLARE_PACKET_FACTORY(Proto, PacketType, Opcode) |
| This macro is used by the implementation to declare a new packet parser factory. | |
This is the main header for ED2KParser system, and should be included by user code. The support headers, "packets.h" and "opcodes.h" should generally not be included by user code.
Definition in file parser.h.
|
|
Declares a new packet handler within this parser.
|
|
|
Special version, allowing Parent and Target to differ.
|
|
|
Use this macro in your class's interface to allow parser factories to access the packet handler functions, if they are declared private.
|
|
|
Value: template<class Parent, class Target = Parent> \ class Factory_##PacketType : public ED2KParser<Parent>::PacketFactory { \ public: \ Factory_##PacketType() \ : ED2KParser<Parent>::PacketFactory(Proto, Opcode) {} \ virtual void create(Parent *parent, std::istringstream &i) { \ parent->onPacket(ED2KPacket::PacketType(i)); \ } \ } This should not be used by client code.
|