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

#include <message.h>

Detailed Description

Messages are packets of data which can be sent to a message port.

This implements a universal communication mechanism within the same thread, different threads, or even different machines.

Messages are implemented as normal C++ objects which can encode and decode themselves from and to a stream.

Inherits Core::RefCounted.

Inherited by Http::AttachRequestHandler, Http::HttpRequest, Http::RemoveRequestHandler, IO::CopyFile, IO::IOMessage, and Messaging::BatchMessage.

Public Member Functions

 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

Protected Attributes

volatile int handled
bool deferred
bool deferredHandled
bool distribute

Private Member Functions

 __DeclareClass (Message)

Private Attributes

 __DeclareMsgId

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)

Constructor & Destructor Documentation

◆ Message()

Messaging::Message::Message ( )

constructor

Member Function Documentation

◆ __DeclareClass()

Messaging::Message::__DeclareClass ( Message )
private

◆ CheckId()

bool Messaging::Message::CheckId ( const Messaging::Id & id) const
inline

return true if message is of the given id

◆ Decode()

void Messaging::Message::Decode ( const Ptr< IO::BinaryReader > & reader)
virtual

decode message from a stream

◆ DeferredHandled()

bool Messaging::Message::DeferredHandled ( ) const
inline

get the deferred handled flag

◆ Encode()

void Messaging::Message::Encode ( const Ptr< IO::BinaryWriter > & writer)
virtual

encode message into a stream

◆ GetDistribute()

bool Messaging::Message::GetDistribute ( ) const
inline

should this message be distributed over the network

◆ Handled()

bool Messaging::Message::Handled ( ) const
inline

return true if the message has been handled

◆ IsDeferred()

bool Messaging::Message::IsDeferred ( ) const
inline

get deferred flag

◆ SetDeferred()

void Messaging::Message::SetDeferred ( bool b)
inline

set deferred flag

◆ SetDeferredHandled()

void Messaging::Message::SetDeferredHandled ( bool b)
inline

set the deferred handled flag

◆ SetDistribute()

void Messaging::Message::SetDistribute ( bool b)
inline

enable distribution over network

◆ SetHandled()

void Messaging::Message::SetHandled ( bool b)
inline

set the handled flag

Member Data Documentation

◆ __DeclareMsgId

Messaging::Message::__DeclareMsgId
private

◆ deferred

bool Messaging::Message::deferred
protected

◆ deferredHandled

bool Messaging::Message::deferredHandled
protected

◆ distribute

bool Messaging::Message::distribute
protected

◆ handled

volatile int Messaging::Message::handled
protected

The documentation for this class was generated from the following files:
  • /github/workspace/code/foundation/messaging/message.h
  • /github/workspace/code/foundation/messaging/message.cc