class MessageBuffer
{
public:
+ typedef std::ptrdiff_t WordType;
/**
* Create a new MessageBuffer
/**
* Reserve space for another message in the buffer.
* @pre size is greater than zero.
- * @param[in] The message size with respect to the size of type "char".
- * @return A pointer to the address allocated for the message.
+ * @param[in] size The message size with respect to the size of type "char".
+ * @return A pointer to the address allocated for the message, aligned to a word boundary
*/
unsigned int* ReserveMessageSlot( std::size_t size );
public:
// Constructor
- Iterator(unsigned int* current);
+ Iterator(WordType* current);
// Inlined for performance
bool IsValid()
}
// Inlined for performance
- unsigned int* Get()
+ WordType* Get()
{
return ( 0 != mMessageSize ) ? mCurrent : NULL;
}
private:
- unsigned int* mCurrent;
- unsigned int mMessageSize;
+ WordType* mCurrent;
+ std::size_t mMessageSize;
};
/**
std::size_t mInitialCapacity; ///< The capacity to allocate during first call to ReserveMessageSlot
- unsigned int* mData; ///< The data allocated for the message buffer
- unsigned int* mNextSlot; ///< The next free location in the buffer
+ WordType* mData; ///< The data allocated for the message buffer
+ WordType* mNextSlot; ///< The next free location in the buffer
- std::size_t mCapacity; ///< The memory allocated with respect to sizeof(unsigned int)
- std::size_t mSize; ///< The memory reserved for messages with respect to sizeof(unsigned int)
+ std::size_t mCapacity; ///< The memory allocated with respect to sizeof(WordType)
+ std::size_t mSize; ///< The memory reserved for messages with respect to sizeof(WordType)
};
} // namespace Internal