muscle  7.52
About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.
  Fossies Dox: muscle7.52.zip  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Message.cpp File Reference
#include "util/ByteBuffer.h"
#include "util/Queue.h"
#include "message/Message.h"
Include dependency graph for Message.cpp:

Go to the source code of this file.

Classes

class  FixedSizeDataArray< DataType >
 
class  TagDataArray
 
class  FixedSizeFlatObjectArray< DataType, FlatItemSize, ItemTypeCode >
 
class  PrimitiveTypeDataArray< DataType >
 
class  PointDataArray
 
class  RectDataArray
 
class  Int8DataArray
 
class  BoolDataArray
 
class  Int16DataArray
 
class  Int32DataArray
 
class  Int64DataArray
 
class  FloatDataArray
 
class  DoubleDataArray
 
class  PointerDataArray
 
class  FlatCountableRefDataArray< RefType, ItemTypeCode >
 
class  ByteBufferDataArray
 
class  MessageDataArray
 
class  VariableSizeFlatObjectArray< DataType >
 
class  StringDataArray
 

Namespaces

 muscle
 / / File: Message.h / / Description: OS-independent version of Be's BMessage class.
 

Macros

#define DECLARECLONE(X)
 
#define NEWFIELD(X)   _pool##X.ObtainObject()
 
#define DECLAREFIELDTYPE(X)   static ObjectPool<X> _pool##X; DECLARECLONE(X)
 
#define CONSTRUCT_DATA_TYPE(TheType)   {(void) new (_union._data) TheType();}
 
#define DESTRUCT_DATA_TYPE(TheType)   {TheType * MUSCLE_MAY_ALIAS p = reinterpret_cast<TheType *>(_union._data); p->~TheType();}
 

Functions

static void DoIndents (uint32 num, String &s)
 
MessageRef::ItemPool * GetMessagePool ()
 This function returns a pointer to a singleton ObjectPool that can be used to minimize the number of Message allocations and deletions by recycling the Message objects. More...
 
const ConstMessageRef & GetEmptyMessageRef ()
 Same as GetEmptyMessage(), except it returns a ConstMessageRef instead of a Message. More...
 
MessageRef GetMessageFromPool (uint32 what=0L)
 Convenience method: Gets a Message from the Message pool and returns a reference to it. More...
 
MessageRef GetMessageFromPool (const Message &copyMe)
 Convenience method: Gets a Message from the message pool, makes it equal to (copyMe), and returns a reference to it. More...
 
MessageRef GetMessageFromPool (const uint8 *flatBytes, uint32 numBytes)
 Convenience method: Gets a Message from the message pool, populates it using the flattened Message bytes at (flatBytes), and returns it. More...
 
MessageRef GetMessageFromPool (ObjectPool< Message > &pool, uint32 what=0L)
 As above, except that the Message is obtained from the specified pool instead of from the default Message pool. More...
 
MessageRef GetMessageFromPool (ObjectPool< Message > &pool, const Message &copyMe)
 As above, except that the Message is obtained from the specified pool instead of from the default Message pool. More...
 
MessageRef GetMessageFromPool (ObjectPool< Message > &pool, const uint8 *flatBytes, uint32 numBytes)
 As above, except that the Message is obtained from the specified pool instead of from the default Message pool. More...
 
MessageRef GetLightweightCopyOfMessageFromPool (const Message &copyMe)
 Convenience method: Gets a Message from the message pool, makes it a lightweight copy of (copyMe), and returns a reference to it. More...
 
MessageRef GetLightweightCopyOfMessageFromPool (ObjectPool< Message > &pool, const Message &copyMe)
 As above, except that the Message is obtained from the specified pool instead of from the default Message pool. More...
 
static void AddItemPreambleToString (uint32 indent, uint32 idx, String &s)
 
static String PointToString (const Point &p)
 
static String RectToString (const Rect &r)
 
static bool AreByteBufferPointersEqual (const ByteBuffer *myBuf, const ByteBuffer *hisBuf)
 
static bool AreMessagePointersDeeplyEqual (const Message *myMsg, const Message *hisMsg)
 
static uint32 GetFlattenedSizeForFixedSizeType (uint32 typeCode)
 
static void AddSingleItemToString (uint32 indent, const String &itemStr, String &s)
 
template<typename T >
void AddFormattedSingleItemToString (uint32 indent, const char *fmt, T val, String &s)
 
static bool CompareRefCountableRefs (const RefCountableRef &myRCR, const RefCountableRef &hisRCR)
 

Variables

static MessageRef::ItemPool _messagePool
 
static ObjectPool< TagDataArray > _poolTagDataArray
 
static ObjectPool< PointDataArray > _poolPointDataArray
 
static ObjectPool< RectDataArray > _poolRectDataArray
 
static ObjectPool< Int8DataArray > _poolInt8DataArray
 
static ObjectPool< BoolDataArray > _poolBoolDataArray
 
static ObjectPool< Int16DataArray > _poolInt16DataArray
 
static ObjectPool< Int32DataArray > _poolInt32DataArray
 
static ObjectPool< Int64DataArray > _poolInt64DataArray
 
static ObjectPool< FloatDataArray > _poolFloatDataArray
 
static ObjectPool< DoubleDataArray > _poolDoubleDataArray
 
static ObjectPool< PointerDataArray > _poolPointerDataArray
 
static ObjectPool< ByteBufferDataArray > _poolByteBufferDataArray
 
static ObjectPool< MessageDataArray > _poolMessageDataArray
 
static ObjectPool< StringDataArray > _poolStringDataArray
 

Macro Definition Documentation

◆ CONSTRUCT_DATA_TYPE

#define CONSTRUCT_DATA_TYPE (   TheType)    {(void) new (_union._data) TheType();}

Definition at line 2270 of file Message.cpp.

◆ DECLARECLONE

#define DECLARECLONE (   X)
Value:
AbstractDataArrayRef X :: Clone() const \
{ \
AbstractDataArrayRef ref(NEWFIELD(X)); \
if (ref()) *(static_cast<X*>(ref())) = *this; \
return ref; \
}

Definition at line 19 of file Message.cpp.

◆ DECLAREFIELDTYPE

#define DECLAREFIELDTYPE (   X)    static ObjectPool<X> _pool##X; DECLARECLONE(X)

Definition at line 32 of file Message.cpp.

◆ DESTRUCT_DATA_TYPE

#define DESTRUCT_DATA_TYPE (   TheType)    {TheType * MUSCLE_MAY_ALIAS p = reinterpret_cast<TheType *>(_union._data); p->~TheType();}

Definition at line 2271 of file Message.cpp.

◆ NEWFIELD

#define NEWFIELD (   X)    _pool##X.ObtainObject()

Definition at line 31 of file Message.cpp.

NEWFIELD
#define NEWFIELD(X)
Definition: Message.cpp:31