Inheritance diagram for os::Message:
Public Member Functions | |
Message (int nCode=0) | |
Constructor. | |
Message (const Message &cMsg) | |
Copy constructor. | |
Message (const void *pFlattenedData) | |
Construct a message from a "flattened" buffer. | |
~Message () | |
Destructor. | |
int | GetCode (void) const |
void | SetCode (int nCode) |
size_t | GetFlattenedSize (void) const |
Get the required buffer size needed to "flatten" this message. | |
status_t | Flatten (uint8 *pBuffer, size_t nSize) const |
Write the message to a flat data-blob. | |
status_t | Unflatten (const uint8 *pBuffer) |
Reconstruct a message from a data-blob created by Flatten(). | |
status_t | AddData (const char *pzName, int nType, const void *pData, uint32 nSize, bool bFixedSize=true, int nMaxCountHint=1) |
Add a data member to the message. | |
status_t | AddObject (const char *pzName, const Flattenable &cVal) |
Add an object as a member of this message. | |
status_t | AddMessage (const char *pzName, const Message *pcVal) |
Add another message object as a member of this message. | |
status_t | AddPointer (const char *pzName, const void *pVal) |
Add a pointer to the message. | |
status_t | AddInt8 (const char *pzName, int8 nVal) |
Add a 8-bit integer to the message. | |
status_t | AddInt16 (const char *pzName, int16 nVal) |
Add a 16-bit integer to the message. | |
status_t | AddInt32 (const char *pzName, int32 nVal) |
Add a 32-bit integer to the message. | |
status_t | AddInt64 (const char *pzName, int64 nVal) |
Add a 64-bit integer to the message. | |
status_t | AddBool (const char *pzName, bool bVal) |
Add a boolean value to the message. | |
status_t | AddFloat (const char *pzName, float vVal) |
Add a float to the message. | |
status_t | AddDouble (const char *pzName, double vVal) |
Add a double to the message. | |
status_t | AddRect (const char *pzName, const Rect &cVal) |
status_t | AddIRect (const char *pzName, const IRect &cVal) |
status_t | AddPoint (const char *pzName, const Point &cVal) |
status_t | AddIPoint (const char *pzName, const IPoint &cVal) |
status_t | AddColor32 (const char *pzName, const Color32_s &cVal) |
status_t | AddString (const char *pzName, const char *pzString) |
Add a string to the message. | |
status_t | AddString (const char *pzName, const std::string &cString) |
Add a string to the message. | |
status_t | AddString (const char *pzName, const String &cString) |
status_t | AddVariant (const char *pzName, const Variant &cVal) |
status_t | FindData (const char *pzName, int nType, const void **ppData, size_t *pnSize, int nIndex=0) const |
status_t | FindObject (const char *pzName, Flattenable &cVal, int nIndex=0) const |
status_t | FindMessage (const char *pzName, Message *ppcVal, int nIndex=0) const |
status_t | FindPointer (const char *pzName, void **ppVal, int nIndex=0) const |
status_t | FindInt8 (const char *pzName, int8 *pnVal, int nIndex=0) const |
status_t | FindInt16 (const char *pzName, int16 *pnVal, int nIndex=0) const |
status_t | FindInt32 (const char *pzName, int32 *pnVal, int nIndex=0) const |
status_t | FindInt64 (const char *pzName, int64 *pnVal, int nIndex=0) const |
status_t | FindBool (const char *pzName, bool *pbVal, int nIndex=0) const |
status_t | FindFloat (const char *pzName, float *pvVal, int nIndex=0) const |
status_t | FindDouble (const char *pzName, double *pvVal, int nIndex=0) const |
status_t | FindRect (const char *pzName, Rect *pcVal, int nIndex=0) const |
status_t | FindIRect (const char *pzName, IRect *pcVal, int nIndex=0) const |
status_t | FindPoint (const char *pzName, Point *pcVal, int nIndex=0) const |
status_t | FindIPoint (const char *pzName, IPoint *pcVal, int nIndex=0) const |
status_t | FindColor32 (const char *pzName, Color32_s *pcVal, int nIndex=0) const |
status_t | FindString (const char *pzName, const char **pzString, int nIndex=0) const |
status_t | FindString (const char *pzName, std::string *pcString, int nIndex=0) const |
status_t | FindString (const char *pzName, String *pcString, int nIndex=0) const |
status_t | FindVariant (const char *pzName, Variant *pcVal, int nIndex=0) const |
template<class T> | |
status_t | FindInt (const char *pzName, T *pnVal, int nIndex=0) const |
status_t | RemoveData (const char *pzName, int nIndex=0) |
Delete an element from the message. | |
status_t | RemoveName (const char *pzName) |
Remove all entries stored under a given name. | |
status_t | GetNameInfo (const char *pzName, int *pnType=NULL, int *pnCount=NULL) const |
int | CountNames (void) const |
String | GetName (int nIndex) const |
void | MakeEmpty (void) |
Clear the message. | |
bool | IsEmpty (void) const |
bool | WasDelivered (void) const |
bool | IsSourceWaiting (void) const |
bool | IsSourceRemote (void) const |
Messenger | ReturnAddress (void) const |
bool | IsReply (void) const |
status_t | SendReply (int nCode, Handler *pcReplyHandler=NULL) |
status_t | SendReply (Message *pcTheReply, Handler *pcReplyHandler=NULL, uint nTimeOut=~0) |
status_t | SendReply (int nCode, Message *pcReplyToReply) |
status_t | SendReply (Message *pcTheReply, Message *pcReplyToReply, int nSendTimOut=~0, int nReplyTimeOut=~0) |
Message & | operator= (const Message &cOther) |
Copy the content of another message. | |
Friends | |
class | Looper |
class | MessageQueue |
class | Messenger |
class | View |
class | Settings |
Classes | |
struct | Chunk_s |
struct | DataArray_s |
Message::Message | ( | int | nCode = 0 |
) |
nCode | The message code. This can later be retrieved with GetCode(). |
Message::Message | ( | const Message & | cMsg | ) |
cMsg | The message to copy. |
Message::Message | ( | const void * | pFlattenedData | ) |
pFlattenedData | Pointer to a data-blob created by a previous call to Flatten(). |
Message::~Message | ( | ) |
int os::Message::GetCode | ( | void | ) | const [inline] |
void os::Message::SetCode | ( | int | nCode | ) | [inline] |
size_t Message::GetFlattenedSize | ( | void | ) | const |
status_t Message::Flatten | ( | uint8 * | pBuffer, | |
size_t | nSize | |||
) | const |
pBuffer
must be you must first call GetFlattenedSize(). pBuffer | Pointer to a buffer at least as large as reported by GetFlattenedSize() where the flattened message will be written. | |
nSize | Size of the buffer passed as pBuffer |
status_t Message::Unflatten | ( | const uint8 * | pBuffer | ) |
pBuffer | Pointer to a data-blob previously created with Flatten() |
status_t Message::AddData | ( | const char * | pzName, | |
int | nType, | |||
const void * | pData, | |||
uint32 | nSize, | |||
bool | bFixedSize = true , |
|||
int | nMaxCountHint = 1 | |||
) |
pzName | The name used to identify the member. If there already exist a member with this name in the message the new member will be appended to an array of elements under this name. It is an error to append objects with different types under the same name. | |
nType | Data type. This should be one of the predefined type codes. Normally you should only use this member to add T_RAW type data. All the more specific data-types should be added with one of the specialized Add*() members. | |
pData | Pointer to the data to be add. The data will be copyed into the message. | |
nSize | Size of the pData buffer. | |
bFixedSize | If you plan to make an array of members under the same name you must let the message know if each element can have a different size. If the message know that all the elements have the same size it can optimize the data a bit by only storing the size once. It will also greatly speed up array-element lookups if each element have the same size. If all elements in an array will have the same size or if you plan to add only one member under this name bFixedSize should be true. Otherwhice it should be false. | |
nMaxCountHint | An estimate of how many members are going to be added to this array. If you plan to add many elements under the same name and you know up-front how many you are going to add it is a good idea to let the message know when adding the first element. The nMaxCountHint will be used to decide how much memory to be allocated for the array and if the estimate is correct it will avoid any expensive reallocations during element insertions. |
status_t Message::AddObject | ( | const char * | pzName, | |
const Flattenable & | cVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
pcVal | The object to add. |
status_t Message::AddMessage | ( | const char * | pzName, | |
const Message * | pcVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
pcVal | The object to add. |
status_t Message::AddPointer | ( | const char * | pzName, | |
const void * | pVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
pVal | The pointer you want to add. Only the value of the pointer will be stored. Not the object it is pointing at. |
status_t Message::AddInt8 | ( | const char * | pzName, | |
int8 | nVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
nVal | The object to add. |
status_t Message::AddInt16 | ( | const char * | pzName, | |
int16 | nVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
nVal | The object to add. |
status_t Message::AddInt32 | ( | const char * | pzName, | |
int32 | nVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
nVal | The object to add. |
status_t Message::AddInt64 | ( | const char * | pzName, | |
int64 | nVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
nVal | The object to add. |
status_t Message::AddBool | ( | const char * | pzName, | |
bool | bVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
bVal | The object to add. |
status_t Message::AddFloat | ( | const char * | pzName, | |
float | vVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
vVal | The object to add. |
status_t Message::AddDouble | ( | const char * | pzName, | |
double | vVal | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
vVal | The object to add. |
status_t Message::AddRect | ( | const char * | pzName, | |
const Rect & | cVal | |||
) |
status_t Message::AddIRect | ( | const char * | pzName, | |
const IRect & | cVal | |||
) |
status_t Message::AddPoint | ( | const char * | pzName, | |
const Point & | cVal | |||
) |
status_t Message::AddIPoint | ( | const char * | pzName, | |
const IPoint & | cVal | |||
) |
status_t Message::AddColor32 | ( | const char * | pzName, | |
const Color32_s & | cVal | |||
) |
status_t Message::AddString | ( | const char * | pzName, | |
const char * | pzString | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
pzString | The string to add. |
status_t Message::AddString | ( | const char * | pzName, | |
const std::string & | cString | |||
) |
pzName | A name uniquely identifying the added object within the message. It is possible to add multiple objects of the same type under the same name but it is an error to use the same name for two objects of different type. | |
cString | The string to add. |
status_t Message::AddString | ( | const char * | pzName, | |
const String & | cString | |||
) |
status_t Message::AddVariant | ( | const char * | pzName, | |
const Variant & | cVal | |||
) |
status_t Message::FindData | ( | const char * | pzName, | |
int | nType, | |||
const void ** | ppData, | |||
size_t * | pnSize, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindObject | ( | const char * | pzName, | |
Flattenable & | cVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindMessage | ( | const char * | pzName, | |
Message * | ppcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindPointer | ( | const char * | pzName, | |
void ** | ppVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindInt8 | ( | const char * | pzName, | |
int8 * | pnVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindInt16 | ( | const char * | pzName, | |
int16 * | pnVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindInt32 | ( | const char * | pzName, | |
int32 * | pnVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindInt64 | ( | const char * | pzName, | |
int64 * | pnVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindBool | ( | const char * | pzName, | |
bool * | pbVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindFloat | ( | const char * | pzName, | |
float * | pvVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindDouble | ( | const char * | pzName, | |
double * | pvVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindRect | ( | const char * | pzName, | |
Rect * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindIRect | ( | const char * | pzName, | |
IRect * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindPoint | ( | const char * | pzName, | |
Point * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindIPoint | ( | const char * | pzName, | |
IPoint * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindColor32 | ( | const char * | pzName, | |
Color32_s * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindString | ( | const char * | pzName, | |
const char ** | pzString, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindString | ( | const char * | pzName, | |
std::string * | pcString, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindString | ( | const char * | pzName, | |
String * | pcString, | |||
int | nIndex = 0 | |||
) | const |
status_t Message::FindVariant | ( | const char * | pzName, | |
Variant * | pcVal, | |||
int | nIndex = 0 | |||
) | const |
status_t os::Message::FindInt | ( | const char * | pzName, | |
T * | pnVal, | |||
int | nIndex = 0 | |||
) | const [inline] |
status_t Message::RemoveData | ( | const char * | pzName, | |
int | nIndex = 0 | |||
) |
pzName | The member name. | |
nIndex | Index of the element to delete. If more than one element was added under the same name you can select which one to delete with this index. |
status_t Message::RemoveName | ( | const char * | pzName | ) |
pzName | The name of the member to delete. |
status_t Message::GetNameInfo | ( | const char * | pzName, | |
int * | pnType = NULL , |
|||
int * | pnCount = NULL | |||
) | const |
int Message::CountNames | ( | void | ) | const |
String Message::GetName | ( | int | nIndex | ) | const |
void Message::MakeEmpty | ( | void | ) |
bool Message::IsEmpty | ( | void | ) | const |
bool Message::WasDelivered | ( | void | ) | const |
bool Message::IsSourceWaiting | ( | void | ) | const |
bool Message::IsSourceRemote | ( | void | ) | const |
Messenger Message::ReturnAddress | ( | void | ) | const |
bool Message::IsReply | ( | void | ) | const |
status_t Message::SendReply | ( | int | nCode, | |
Handler * | pcReplyHandler = NULL | |||
) |
status_t Message::SendReply | ( | Message * | pcTheReply, | |
Handler * | pcReplyHandler = NULL , |
|||
uint | nTimeOut = ~0 | |||
) |
status_t Message::SendReply | ( | int | nCode, | |
Message * | pcReplyToReply | |||
) |
status_t Message::SendReply | ( | Message * | pcTheReply, | |
Message * | pcReplyToReply, | |||
int | nSendTimOut = ~0 , |
|||
int | nReplyTimeOut = ~0 | |||
) |
cMsg
cMsg | The message to copy. |
Reimplemented in os::Settings.
friend class Looper [friend] |
friend class MessageQueue [friend] |
friend class Messenger [friend] |
friend class View [friend] |
friend class Settings [friend] |