Nebula
Loading...
Searching...
No Matches
tcpmessagecodec.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
22#include "io/memorystream.h"
23#include "io/binaryreader.h"
24
25//------------------------------------------------------------------------------
26namespace Net
27{
61//------------------------------------------------------------------------------
62} // namespace Net
Helperclass that provides function to encode and decode sreams into messages.
Definition tcpmessagecodec.h:29
TcpMessageCodec()
Constructor.
Definition tcpmessagecodec.cc:22
bool HasMessages()
Returns true, if there are messages in the internal message queue.
Definition tcpmessagecodec.cc:184
Util::Array< Ptr< IO::Stream > > DequeueMessages()
Gets the list of all created messages since the last call of this function.
Definition tcpmessagecodec.cc:195
ReceiveState receiveState
Definition tcpmessagecodec.h:53
Ptr< IO::Stream > messageStream
Definition tcpmessagecodec.h:55
SizeT messageSize
Definition tcpmessagecodec.h:56
void DecodeStream(const Ptr< IO::Stream > &stream)
Decodes a given Stream. Check for HasMessages() if this completes a message.
Definition tcpmessagecodec.cc:94
ReceiveState
what data is currently expected from the decoder
Definition tcpmessagecodec.h:48
@ MessageData
Definition tcpmessagecodec.h:50
@ HeaderData
Definition tcpmessagecodec.h:49
virtual ~TcpMessageCodec()
Destructor.
Definition tcpmessagecodec.cc:34
Ptr< IO::Stream > headerStream
Definition tcpmessagecodec.h:54
Util::Array< Ptr< IO::Stream > > completedMessages
Definition tcpmessagecodec.h:59
IndexT headerPosition
Definition tcpmessagecodec.h:57
void EncodeToMessage(const Ptr< IO::Stream > &stream, const Ptr< IO::Stream > &output)
Attachs header information to the stream and returns a copy with header.
Definition tcpmessagecodec.cc:61
IndexT messagePostition
Definition tcpmessagecodec.h:58
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
Definition debugmessage.h:20
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48