#include <Message.h>
Inheritance diagram for BMessage:

Public Member Functions | |
| BMessage () | |
| BMessage (uint32 what) | |
| BMessage (const BMessage &a_message) | |
| virtual | ~BMessage () |
| BMessage & | operator= (const BMessage &msg) |
| status_t | Update (const BMessage &from, bool recursive=false) |
| status_t | FillIn (const BMessage &from, bool recursive=false) |
| status_t | GetInfo (type_code typeRequested, int32 which, const char **name, type_code *typeReturned, int32 *count=NULL) const |
| status_t | GetInfo (const char *name, type_code *type, int32 *c=0) const |
| status_t | GetInfo (const char *name, type_code *type, bool *fixed_size) const |
| status_t | GetNextName (void **cookie, const char **outName, type_code *outType=NULL, int32 *outCount=NULL) const |
| int32 | CountNames (type_code type) const |
| bool | IsEmpty () const |
| bool | IsSystem () const |
| bool | IsReply () const |
| void | PrintToStream () const |
| status_t | Rename (const char *old_entry, const char *new_entry) |
| bool | WasDelivered () const |
| bool | IsReplyRequested () const |
| bool | IsSourceWaiting () const |
| bool | IsSourceRemote () const |
| bool | CompareDestination (const BMessenger &test) const |
| BMessenger | ReturnAddress () const |
| const BMessage * | Previous () const |
| bool | WasDropped () const |
| BPoint | DropPoint (BPoint *offset=NULL) const |
| bool | HasWhen () const |
| bigtime_t | When () const |
| void | SetWhen (bigtime_t time) |
| status_t | SendReply (const BMessage &the_reply, const BMessenger &reply_to, uint32 flags=B_TIMEOUT, bigtime_t timeout=B_INFINITE_TIMEOUT) |
| status_t | SendReply (uint32 command) |
| status_t | SendReply (uint32 command, const BMessenger &reply_to) |
| status_t | SendReply (const BMessage &the_reply, BMessage *reply_to_reply, uint32 flags=B_TIMEOUT, bigtime_t send_timeout=B_INFINITE_TIMEOUT, bigtime_t reply_timeout=B_INFINITE_TIMEOUT) |
| status_t | SendReply (uint32 command, BMessage *reply_to_reply) |
| status_t | SendReply (uint32 command, BHandler *reply_to) |
| status_t | SendReply (BMessage *the_reply, BHandler *reply_to=NULL, bigtime_t timeout=B_INFINITE_TIMEOUT) |
| status_t | SendReply (BMessage *the_reply, BMessenger reply_to, bigtime_t timeout=B_INFINITE_TIMEOUT) |
| status_t | SendReply (BMessage *the_reply, BMessage *reply_to_reply, bigtime_t send_timeout=B_INFINITE_TIMEOUT, bigtime_t reply_timeout=B_INFINITE_TIMEOUT) |
| ssize_t | FlattenedSize () const |
| status_t | Flatten (char *buffer, ssize_t size) const |
| status_t | Flatten (BDataIO *stream, ssize_t *size=NULL) const |
| status_t | Unflatten (const char *flat_buffer) |
| status_t | Unflatten (BDataIO *stream) |
| ssize_t | FlattenedSize (message_version format) const |
| status_t | Flatten (message_version format, char *buffer, ssize_t size) const |
| status_t | Flatten (message_version format, BDataIO *stream, ssize_t *size=NULL) const |
| status_t | WritePort (port_id port, int32 code, uint32 flags=0, bigtime_t timeout=B_INFINITE_TIMEOUT) const |
| status_t | ReadPort (port_id port, ssize_t size=-1, int32 *outCode=NULL, uint32 flags=0, bigtime_t timeout=B_INFINITE_TIMEOUT) |
| size_t | RawPortSize () const |
| const void * | RawPortData () const |
| status_t | AddSpecifier (const char *property) |
| status_t | AddSpecifier (const char *property, int32 index) |
| status_t | AddSpecifier (const char *property, int32 index, int32 range) |
| status_t | AddSpecifier (const char *property, const char *name) |
| status_t | AddSpecifier (const BMessage *specifier) |
| status_t | SetCurrentSpecifier (int32 index) |
| status_t | GetCurrentSpecifier (int32 *index, BMessage *specifier=NULL, int32 *form=NULL, const char **property=NULL) const |
| bool | HasSpecifiers () const |
| status_t | PopSpecifier () |
| status_t | AddRect (const char *name, BRect a_rect) |
| status_t | AddPoint (const char *name, BPoint a_point) |
| status_t | AddString (const char *name, const char *a_string) |
| status_t | AddString (const char *name, const BString &a_string) |
| status_t | AddInt8 (const char *name, int8 val) |
| status_t | AddInt16 (const char *name, int16 val) |
| status_t | AddInt32 (const char *name, int32 val) |
| status_t | AddInt64 (const char *name, int64 val) |
| status_t | AddBool (const char *name, bool a_boolean) |
| status_t | AddFloat (const char *name, float a_float) |
| status_t | AddDouble (const char *name, double a_double) |
| status_t | AddRGBColor (const char *name, rgb_color a_color, type_code type=B_RGB_COLOR_TYPE) |
| status_t | AddPointer (const char *name, const void *ptr) |
| status_t | AddMessenger (const char *name, BMessenger messenger) |
| status_t | AddRef (const char *name, const entry_ref *ref) |
| status_t | AddMessage (const char *name, const BMessage *msg) |
| status_t | AddFlat (const char *name, const BFlattenable *obj, int32 count=1) |
| status_t | AddAtom (const char *name, const BAtom *atm) |
| status_t | AddAtomRef (const char *name, const BAtom *atm) |
| status_t | AddData (const char *name, type_code type, const void *data, ssize_t numBytes, bool is_fixed_size=true, int32 count=1) |
| status_t | RemoveData (const char *name, int32 index=0) |
| status_t | RemoveName (const char *name) |
| status_t | MakeEmpty () |
| status_t | FindRect (const char *name, BRect *rect) const |
| status_t | FindRect (const char *name, int32 index, BRect *rect) const |
| status_t | FindPoint (const char *name, BPoint *pt) const |
| status_t | FindPoint (const char *name, int32 index, BPoint *pt) const |
| status_t | FindString (const char *name, const char **str) const |
| status_t | FindString (const char *name, int32 index, const char **str) const |
| status_t | FindString (const char *name, BString *str) const |
| status_t | FindString (const char *name, int32 index, BString *str) const |
| status_t | FindInt8 (const char *name, int8 *value) const |
| status_t | FindInt8 (const char *name, int32 index, int8 *val) const |
| status_t | FindInt16 (const char *name, int16 *value) const |
| status_t | FindInt16 (const char *name, int32 index, int16 *val) const |
| status_t | FindInt32 (const char *name, int32 *value) const |
| status_t | FindInt32 (const char *name, int32 index, int32 *val) const |
| status_t | FindInt64 (const char *name, int64 *value) const |
| status_t | FindInt64 (const char *name, int32 index, int64 *val) const |
| status_t | FindBool (const char *name, bool *value) const |
| status_t | FindBool (const char *name, int32 index, bool *value) const |
| status_t | FindFloat (const char *name, float *f) const |
| status_t | FindFloat (const char *name, int32 index, float *f) const |
| status_t | FindDouble (const char *name, double *d) const |
| status_t | FindDouble (const char *name, int32 index, double *d) const |
| status_t | FindRGBColor (const char *name, rgb_color *c, bool allow_int32_type=false) const |
| status_t | FindRGBColor (const char *name, int32 index, rgb_color *c, bool allow_int32_type=false) const |
| status_t | FindAtom (const char *name, BAtom **atm) const |
| status_t | FindAtom (const char *name, int32 index, BAtom **atm) const |
| status_t | FindAtomRef (const char *name, BAtom **atm) const |
| status_t | FindAtomRef (const char *name, int32 index, BAtom **atm) const |
| status_t | FindPointer (const char *name, void **ptr) const |
| status_t | FindPointer (const char *name, int32 index, void **ptr) const |
| status_t | FindMessenger (const char *name, BMessenger *m) const |
| status_t | FindMessenger (const char *name, int32 index, BMessenger *m) const |
| status_t | FindRef (const char *name, entry_ref *ref) const |
| status_t | FindRef (const char *name, int32 index, entry_ref *ref) const |
| status_t | FindMessage (const char *name, BMessage *msg) const |
| status_t | FindMessage (const char *name, int32 index, BMessage *msg) const |
| status_t | FindFlat (const char *name, BFlattenable *obj) const |
| status_t | FindFlat (const char *name, int32 index, BFlattenable *obj) const |
| status_t | FindData (const char *name, type_code type, const void **data, ssize_t *numBytes) const |
| status_t | FindData (const char *name, type_code type, int32 index, const void **data, ssize_t *numBytes) const |
| status_t | ReplaceRect (const char *name, BRect a_rect) |
| status_t | ReplaceRect (const char *name, int32 index, BRect a_rect) |
| status_t | ReplacePoint (const char *name, BPoint a_point) |
| status_t | ReplacePoint (const char *name, int32 index, BPoint a_point) |
| status_t | ReplaceString (const char *name, const char *string) |
| status_t | ReplaceString (const char *name, int32 index, const char *string) |
| status_t | ReplaceString (const char *name, const BString &string) |
| status_t | ReplaceString (const char *name, int32 index, const BString &string) |
| status_t | ReplaceInt8 (const char *name, int8 val) |
| status_t | ReplaceInt8 (const char *name, int32 index, int8 val) |
| status_t | ReplaceInt16 (const char *name, int16 val) |
| status_t | ReplaceInt16 (const char *name, int32 index, int16 val) |
| status_t | ReplaceInt32 (const char *name, int32 val) |
| status_t | ReplaceInt32 (const char *name, int32 index, int32 val) |
| status_t | ReplaceInt64 (const char *name, int64 val) |
| status_t | ReplaceInt64 (const char *name, int32 index, int64 val) |
| status_t | ReplaceBool (const char *name, bool a_bool) |
| status_t | ReplaceBool (const char *name, int32 index, bool a_bool) |
| status_t | ReplaceFloat (const char *name, float a_float) |
| status_t | ReplaceFloat (const char *name, int32 index, float a_float) |
| status_t | ReplaceDouble (const char *name, double a_double) |
| status_t | ReplaceDouble (const char *name, int32 index, double a_double) |
| status_t | ReplaceRGBColor (const char *name, rgb_color a_color, bool allow_int32_type=false) |
| status_t | ReplaceRGBColor (const char *name, int32 index, rgb_color a_color, bool allow_int32_type=false) |
| status_t | ReplaceAtom (const char *name, const BAtom *atm) |
| status_t | ReplaceAtom (const char *name, int32 index, const BAtom *atm) |
| status_t | ReplaceAtomRef (const char *name, const BAtom *atm) |
| status_t | ReplaceAtomRef (const char *name, int32 index, const BAtom *atm) |
| status_t | ReplacePointer (const char *name, const void *ptr) |
| status_t | ReplacePointer (const char *name, int32 index, const void *ptr) |
| status_t | ReplaceMessenger (const char *name, BMessenger messenger) |
| status_t | ReplaceMessenger (const char *name, int32 index, BMessenger msngr) |
| status_t | ReplaceRef (const char *name, const entry_ref *ref) |
| status_t | ReplaceRef (const char *name, int32 index, const entry_ref *ref) |
| status_t | ReplaceMessage (const char *name, const BMessage *msg) |
| status_t | ReplaceMessage (const char *name, int32 index, const BMessage *msg) |
| status_t | ReplaceFlat (const char *name, const BFlattenable *obj) |
| status_t | ReplaceFlat (const char *name, int32 index, const BFlattenable *obj) |
| status_t | ReplaceData (const char *name, type_code type, const void *data, ssize_t data_size) |
| status_t | ReplaceData (const char *name, type_code type, int32 index, const void *data, ssize_t data_size) |
| void * | operator new (size_t size) |
| void * | operator new (size_t size, const std::nothrow_t &) |
| void * | operator new (size_t, void *arg) |
| void | operator delete (void *ptr, size_t size) |
| bool | HasRect (const char *, int32 n=0) const |
| bool | HasPoint (const char *, int32 n=0) const |
| bool | HasString (const char *, int32 n=0) const |
| bool | HasInt8 (const char *, int32 n=0) const |
| bool | HasInt16 (const char *, int32 n=0) const |
| bool | HasInt32 (const char *, int32 n=0) const |
| bool | HasInt64 (const char *, int32 n=0) const |
| bool | HasBool (const char *, int32 n=0) const |
| bool | HasFloat (const char *, int32 n=0) const |
| bool | HasDouble (const char *, int32 n=0) const |
| bool | HasRGBColor (const char *name, int32 n=0, bool allow_int32_type=false) const |
| bool | HasAtom (const char *, int32 n=0) const |
| bool | HasAtomRef (const char *, int32 n=0) const |
| bool | HasPointer (const char *, int32 n=0) const |
| bool | HasMessenger (const char *, int32 n=0) const |
| bool | HasRef (const char *, int32 n=0) const |
| bool | HasMessage (const char *, int32 n=0) const |
| bool | HasFlat (const char *, const BFlattenable *) const |
| bool | HasFlat (const char *, int32, const BFlattenable *) const |
| bool | HasData (const char *, type_code, int32 n=0) const |
| BRect | FindRect (const char *, int32 n=0) const |
| BPoint | FindPoint (const char *, int32 n=0) const |
| const char * | FindString (const char *, int32 n=0) const |
| int8 | FindInt8 (const char *, int32 n=0) const |
| int16 | FindInt16 (const char *, int32 n=0) const |
| int32 | FindInt32 (const char *, int32 n=0) const |
| int64 | FindInt64 (const char *, int32 n=0) const |
| bool | FindBool (const char *, int32 n=0) const |
| float | FindFloat (const char *, int32 n=0) const |
| double | FindDouble (const char *, int32 n=0) const |
| status_t | AddAtom (const char *name, const atom< BAtom > &obj) |
| status_t | AddAtomRef (const char *name, const atom< BAtom > &obj) |
| status_t | AddAtomRef (const char *name, const atomref< BAtom > &obj) |
| status_t | FindAtom (const char *name, atom< BAtom > &atm) const |
| status_t | FindAtom (const char *name, int32 index, atom< BAtom > &atm) const |
| status_t | FindAtomRef (const char *name, atomref< BAtom > &atm) const |
| status_t | FindAtomRef (const char *name, int32 index, atomref< BAtom > &atm) const |
| status_t | ReplaceAtom (const char *name, const atom< BAtom > &atm) |
| status_t | ReplaceAtom (const char *name, int32 index, const atom< BAtom > &atm) |
| status_t | ReplaceAtomRef (const char *name, const atomref< BAtom > &atm) |
| status_t | ReplaceAtomRef (const char *name, int32 index, const atomref< BAtom > &atm) |
| template<class TYPE> | |
| status_t | FindAtom (const char *name, atom< TYPE > &atm) const |
| template<class TYPE> | |
| status_t | FindAtom (const char *name, int32 index, atom< TYPE > &atm) const |
| template<class TYPE> | |
| status_t | FindAtomRef (const char *name, atomref< TYPE > &atm) const |
| template<class TYPE> | |
| status_t | FindAtomRef (const char *name, int32 index, atomref< TYPE > &atm) const |
Public Attributes | |
| uint32 | what |
Friends | |
| class | BMessageList |
| class | BMessenger |
| class | BApplication |
| class | BParcel |
| void | _msg_cache_cleanup_ () |
| BMessage * | _reconstruct_msg_ (uint32, uint32) |
| void | _set_message_target_ (BMessage *, int32, bool) |
| void | _set_message_reply_ (BMessage *, BMessenger) |
| int32 | _get_message_target_ (BMessage *) |
| bool | _use_preferred_target_ (BMessage *) |
| BDataIO & | operator<< (BDataIO &io, const BMessage &message) |
| int | _init_message_ () |
| int | _delete_message_ () |
|
|
Creates a new BMessage object. |
|
|
Creates a new BMessage object that has the given command constant.
|
|
|
Creates a new BMessage object hat's a copy of another BMessage. If it's a copy, the new object contains the same command constant and data fields as message.
|
|
|
Frees all memory allocated to hold message data. If the message sender is expecting a reply but hasn't received one, a default reply (with The system retains ownership of the messages it delivers to you. Each message loop routinely deletes delivered BMessages after the application is finished responding to them. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Most of the other functions are variants of AddData() that hard-code the field's type. For example, AddFloat() assigns the type
|
|
||||||||||||||||||||||||||||
|
These functions add data to the field named name and assign a data type to the field. Field names can be no longer than 255 characters. If more than one item of data is added under the same name, the BMessage creates an array of data for that name. Each time you add another value (to the same name), the value is added to the end of the array - you can't add a value at a specific index. A given field can only store one type of data.
Copies numBytes of data into the field, and assigns the data a type code. It copies whatever the param_ref data pointer points to. For example, if you want to add a string of characters to the message, data should be the string pointer (char *). If you want to add only the string pointer, not the characters themselves, data should be a pointer to the pointer (char **). The assigned type must be a specific data type; it should not be
When you call AddData() to place the first item in an array under a new name, you can provide it with two arguments, fixedSize and numItems, that will improve the object's efficiency. If the fixedSize flag is
B_FLOAT_TYPE; AddBool() assigns B_BOOL_TYPE, and so on.There's no limit on the number of named fields a message can contain or on the size of a field's data. However, since the search is linear, combing through a very long list of names to find a particular piece of data may be inefficient. Also, because of the amount of data that must be moved, an extremely large message can slow the delivery mechanism. It's sometimes better to put some of the information in a common location (a file, a private clipboard, a shared area of memory) and just refer to it in the message. |
|
||||||||||||
|
|
|
||||||||||||||||
|
Flattens an obj (by calling its Flatten() function) and adds the flat data to the message. It calls the object's TypeCode() function to learn the type code it should associate with the data. Objects that are added through AddFlat() must inherit from BFlattenable (defined in the Support Kit).
You can also provide a numItems hint to
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Takes an int32 or uint32.
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
AddMessage() adds one BMessage to another. |
|
||||||||||||
|
Takes a BMessenger object.
|
|
||||||||||||
|
|
|
||||||||||||
|
Adds only the pointer it's passed, not the data it points to. To accomplish the same thing, AddData() would take a pointer to the pointer. (The pointer will be valid only locally; it won't be useful to a remote destination.)
|
|
||||||||||||
|
Add Rectangle.
|
|
||||||||||||
|
Similarly, AddRef() adds the pointed to entry_ref structure to the message (and the variable-length name that's one of the elements of the structure); |
|
||||||||||||||||
|
|
|
|
Adds a specifier to the specifier stack.
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
|
Method add a specifier targeting the property property, with specifier constant.
|
|
||||||||||||
|
|
|
||||||||||||
|
AddString(), like AddData(), takes a pointer to the data it adds, or you can use a BString object. The string must be null-terminated; the null character is counted and copied into the message. |
|
|
|
|
|
Returns the number of named data fields in the BMessage that store data of the specified type. An array of information held under a single name counts as one field; each name is counted only once, no matter how many data items are stored under that name. If type is
|
|
|
Reports the point where the cursor was located when the message was dropped (when the user released the mouse button). It directly returns the point in the screen coordinate system and, if an
true. |
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||
|
FindData() places, in *data, a pointer to the requested data item. The size of the item in bytes is written to numBytes. If type is
|
|
||||||||||||||||||||
|
FindData() places, in *data, a pointer to the requested data item. The size of the item in bytes is written to numBytes. If type is
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
See FindFlat() |
|
||||||||||||
|
Assigns the object stored in the BMessage to the object passed as an argument - it calls the object's Unflatten() function and passes it the flat data from the message - provided that the two objects have compatible types. The argument object's AllowsTypeCode() function must return true when tested with the type code stored in the message; if not, FindFlat() fails and returns .
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
This function retrieve rectangle data from the BMessage.
|
|
||||||||||||
|
This function retrieve rectangle data from the BMessage.
|
|
||||||||||||||||
|
Retrieves an entry_ref structure; the data that's used to reconstitute the structure may have been added as an entry_ref (through AddRef()), or as a flattened BPath object (AddFlat()).
|
|
||||||||||||
|
Retrieves an entry_ref structure; the data that's used to reconstitute the structure may have been added as an entry_ref (through AddRef()), or as a flattened BPath object (AddFlat()).
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
This function write the BMessage and the data it contains to a "flat" (untyped) buffer of bytes, and reconstruct a BMessage object from such a buffer. If passed a BDataIO object (including a BFile), Flatten() calls the object's Write() function to write the message data. If passed the address of a buffer, it begins writing at the start of the buffer. Flatten() places the number of bytes actually written in the variable that its numBytes argument refers to.
|
|
||||||||||||
|
|
|
|
FlattenedSize() returns the number of bytes you must provide in the buffer to hold the flattened object. |
|
|
|
|
||||||||||||||||||||
|
Unpacks the current specifier in the BMessage, the one at the top of the specifier stack; PopSpecifier() changes the notion of which specifier is current, by popping the current one from the stack.
This function aid in implementing a class-specific version of BHandler's ResolveSpecifier() function - the first gets the specifier that needs to be resolved, and the second pops it from the stack after it is resolved. You can also call them to examine relevant specifiers when handling a message that targets an object property (such as A scripting BMessage keeps specifiers in a data array named "specifiers"; each specifier is itself a BMessage, but one with a special structure and purpose in the scripting system. See the "Scripting" section near the beginning of this chapter for an overview of the system and the place of specifiers in it.
GetCurrentSpecifier() puts the index of the current specifier in the variable that its first argument, index, refers to. If other arguments are provided, it makes the specifier BMessage a copy of the current specifier. It also extracts two pieces of information from the specifier: It places the Both functions fail if the BMessage doesn't contain specifiers. In addition, GetCurrentSpecifier() fails if it can't find data in the BMessage for its specifier and property arguments. |
|
||||||||||||||||
|
Provides information about the data fields stored in the BMessage.
When the fixedSize argument is specified, the bool referenced by fixedSize is set to
|
|
||||||||||||||||
|
Provides information about the data fields stored in the BMessage.
When passed a name that matches a name within the BMessage, GetInfo() places the type code for data stored under that name in the variable referred to by typeFound and writes the number of data items with that name into the variable referred to by countFound. It then returns
|
|
||||||||||||||||||||||||
|
Provides information about the data fields stored in the BMessage.
When passed a type and an index, GetInfo() looks only at fields that store data of the requested type and provides information about the field at the requested index. Indices begin at 0 and are type specific. For example, if the requested type is
If successful in finding data of the type requested at index, GetInfo() returns
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
This function can help if you're engaged in an exchange of messages or managing an ongoing communication.
|
|
|
|
|
|
This function can help if you're engaged in an exchange of messages or managing an ongoing communication.
|
|
|
This function can help if you're engaged in an exchange of messages or managing an ongoing communication.
|
|
|
|
|
|
Removes and frees all data that has been added to the BMessage, without altering the what constant.
|
|
||||||||||||
|
Frees memory allocated by the BMessage version of new, which may mean restoring the memory to the cache. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Allocates memory for a BMessage object, or takes the memory from a previously allocated cache. The caching mechanism is an efficient way of managing memory for objects that are created frequently and used for short periods of time, as BMessages typically are.
|
|
|
Assigns one BMessage object to another. After the assignment, the two objects are duplicates of each other without shared data.
|
|
|
The specifiers in a message are ordered and, until PopSpecifier() is called, the one that was added last - the one with the greatest index - is the current specifier. PopSpecifier() merely decrements the index that picks the current specifier; it doesn't delete anything from the BMessage.
PopSpecifier() fails if the BMessage isn't one that has been delivered to you after being processed through a message loop. When it fails PopSpecifier() returns
|
|
|
This function can help if you're engaged in an exchange of messages or managing an ongoing communication.
|
|
|
Prints information about the BMessage to the standard output stream (stdout). Each field of named data is reported in the following format, entry name, type = type, count = count where name is the name that the data is registered under, type is the constant that indicates what type of data it is, and count is the number of data items in the named array. |
|
|
|
|
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||
|
Removes the single item of data at index in the name array. If the array has just one data item, it removes the array and name just as RemoveName() would.
B_OK when successful. However, if there's no data in the BMessage under name, they return a B_NAME_NOT_FOUND error. If message data can be read but can't be changed (as it can't for a message that's being dragged), they return B_ERROR. |
|
|
Removes all data entered in the BMessage under name and the name itself.
B_OK when successful. However, if there's no data in the BMessage under name, they return a B_NAME_NOT_FOUND error. If message data can be read but can't be changed (as it can't for a message that's being dragged), they return B_ERROR. |
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
|
If you want to use the ReturnAddress() BMessenger to send a synchronous reply, you must do so before the BMessage is deleted and a default reply is sent. |
|
||||||||||||||||||||
|
Sends a reply message back to the sender of the BMessage (in the case of a synchronous reply) or to a target BHandler (in the case of an asynchronous reply). Whether the reply is synchronous or asynchronous depends on how the BMessage that's sending the reply was itself sent:
SendReply() works only for BMessage objects that have been processed through a message loop and delivered to you. The caller retains ownership of the reply message passed to SendReply(); it can be deleted (or left to die on the stack) after the function returns. SendReply() sends a message - a reply message, to be sure, but a message nonetheless. It behaves exactly like the other message-sending function, BMessenger's SendMessage():
By default, SendReply() doesn't return until the reply message is delivered (placed in the BLooper's port queue). It's possible, in some circumstances, for the receiving port queue to be full, in which case SendReply() will block until a slot becomes free. However, you can limit how long SendReply() will wait to deliver the message before it gives up and returns. The sendTimeout argument is the number of microseconds you give the function to do its work. If the time limit is exceeded, the function fails and returns an error (
When asking for a synchronous reply, separate sendTimeout and replyTimeout limits can be set for sending the message and receiving the reply. There is no time limit if a timeout value is set to If a command is passed rather than a message, SendReply() constructs the reply BMessage, initializes its what data member with the command constant, and sends it just like any other reply. The command versions of this function have infinite timeouts; they block until the message is delivered and, if requested, a synchronous reply is received.
This function returns
If you want to delay sending a reply and keep the BMessage object beyond the time it's scheduled to be deleted, you may be able to detach it from the message loop. See DetachCurrentMessage() in the BLooper class. |
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
Empties the BMessage of any information it may happen to contain, then initializes the object from data read from the buffer. If passed a BDataIO object, it calls the object's Read() function to read the message data. If passed a buffer address, it begins reading at the start of the buffer. It's up to the caller to make sure that Unflatten() reads data that Flatten() wrote and that pointers are positioned correctly.
|
|
|
Empties the BMessage of any information it may happen to contain, then initializes the object from data read from the buffer. If passed a BDataIO object, it calls the object's Read() function to read the message data. If passed a buffer address, it begins reading at the start of the buffer. It's up to the caller to make sure that Unflatten() reads data that Flatten() wrote and that pointers are positioned correctly.
|
|
||||||||||||
|
|
|
|
This function can help if you're engaged in an exchange of messages or managing an ongoing communication. WasDelivered() indicates whether it's possible to send a reply to a message.
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|