Nebula
Loading...
Searching...
No Matches
Messaging::BatchMessage Class Reference

#include <batchmessage.h>

Detailed Description

A batch of messages which is itself a message.

Use batch messaging if you want to reduce thread synchronization when sending many messages through an AsyncPort. Instead batch many messages into a single batch message (which doesn't require thread synchronization), then send the batch message as one into the AsyncPort.

Note that the following features don't work on batched messages:

  • waiting for the message to become handled
  • cancelling the message

Inherits Messaging::Message.

Public Member Functions

 BatchMessage ()
 constructor
void AddMessage (const Ptr< Message > &msg)
 add a message
const Util::Array< Ptr< Message > > & GetMessages () const
 read access to message array
Public Member Functions inherited from Messaging::Message
 Message ()
 constructor
bool CheckId (const Messaging::Id &id) const
 return true if message is of the given id
virtual void Encode (const Ptr< IO::BinaryWriter > &writer)
 encode message into a stream
virtual void Decode (const Ptr< IO::BinaryReader > &reader)
 decode message from a stream
void SetHandled (bool b)
 set the handled flag
bool Handled () const
 return true if the message has been handled
void SetDeferred (bool b)
 set deferred flag
bool IsDeferred () const
 get deferred flag
void SetDeferredHandled (bool b)
 set the deferred handled flag
bool DeferredHandled () const
 get the deferred handled flag
bool GetDistribute () const
 should this message be distributed over the network
void SetDistribute (bool b)
 enable distribution over network
Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Private Member Functions

 __DeclareClass (BatchMessage)

Private Attributes

 __DeclareMsgId
Util::Array< Ptr< Message > > messages

Additional Inherited Members

Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
Protected Attributes inherited from Messaging::Message
volatile int handled
bool deferred
bool deferredHandled
bool distribute

Constructor & Destructor Documentation

◆ BatchMessage()

Messaging::BatchMessage::BatchMessage ( )

constructor

Member Function Documentation

◆ __DeclareClass()

Messaging::BatchMessage::__DeclareClass ( BatchMessage )
private

◆ AddMessage()

void Messaging::BatchMessage::AddMessage ( const Ptr< Message > & msg)

add a message

◆ GetMessages()

const Array< Ptr< Message > > & Messaging::BatchMessage::GetMessages ( ) const

read access to message array

Member Data Documentation

◆ __DeclareMsgId

Messaging::BatchMessage::__DeclareMsgId
private

◆ messages

Util::Array<Ptr<Message> > Messaging::BatchMessage::messages
private

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