# Messaging Tasks

Task Summary

Owner

BInvoker

BMessage

William Bull

BMessageFilter

Erik Jaesler

BMessageQueue

Jeremy Rand

BMessageRunner

BMessenger

BMessenger Support

Task Details

BInvoker Class

BInvoker();

BInvoker(BMessage* message, const BHandler* handler, const BLooper* looper = NULL);

BInvoker(BMessage* message, BMessenger target);

virtual ~BInvoker();

virtual status_t SetMessage(BMessage* message);

BMessage* Message() const;

uint32 Command() const;

virtual status_t SetTarget(const BHandler* h, const BLooper* loop = NULL);

virtual status_t SetTarget(BMessenger messenger);

bool IsTargetLocal() const;

BHandler* Target(BLooper** looper = NULL) const;

BMessenger Messenger() const;

virtual status_t SetHandlerForReply(BHandler* handler);

BHandler* HandlerForReply() const;

virtual status_t Invoke(BMessage* msg = NULL);

status_t InvokeNotify(BMessage* msg, uint32 kind = B_CONTROL_INVOKED);

status_t SetTimeout(bigtime_t timeout);

bigtime_t Timeout() const;

uint32 InvokeKind(bool* notify = NULL);

void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED);

void EndInvokeNotify();

BMessage Class

BMessage();

BMessage(uint32 what);

BMessage(const BMessage& a_message);

virtual ~BMessage();

BMessage& operator=(const BMessage& msg);

status_t GetInfo(type_code typeRequested, int32 which, 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;

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 IsSourceWaiting() const;

bool IsSourceRemote() const;

BMessenger ReturnAddress() const;

const BMessage* Previous() const;

bool WasDropped() const;

BPoint DropPoint(BPoint* offset = NULL) const;

status_t SendReply(uint32 command, BHandler* reply_to = NULL);

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(uint32 command, BMessage* reply_to_reply);

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);

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 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, BFlattenable* obj, int32 count = 1);

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 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 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, BFlattenable* obj);

status_t ReplaceFlat(const char* name, int32 index, 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 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 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;

BMessage(BMessage* a_message);

NOTE: Add convenience functions for struct rgb_color

BMessageFilter Class

BMessageFilter(uint32 what, filter_hook func = NULL);

BMessageFilter(message_delivery delivery, message_source source, filter_hook func = NULL);

BMessageFilter(message_delivery delivery, message_source source, uint32 what, filter_hook func = NULL);

BMessageFilter(const BMessageFilter& filter);

BMessageFilter(const BMessageFilter* filter);

virtual ~BMessageFilter();

BMessageFilter& operator=(const BMessageFilter &from);

virtual filter_result Filter(BMessage* message, BHandler** target);

message_delivery MessageDelivery() const;

message_source MessageSource() const;

uint32 Command() const;

bool FiltersAnyCommand() const;

BLooper* Looper() const;

BMessageQueue Class

BMessageQueue();

virtual ~BMessageQueue();

void AddMessage(BMessage* an_event);

bool RemoveMessage(BMessage* an_event);

BMessage* NextMessage();

BMessage* FindMessage(int32 index) const;

BMessage* FindMessage(uint32 what, int32 index = 0) const;

int32 CountMessages() const;

bool IsEmpty() const;

bool Lock();

void Unlock();

BMessageRunner Class

BMessageRunner(BMessenger target, const BMessage* msg, bigtime_t interval, int32 count = -1);

BMessageRunner(BMessenger target, const BMessage* msg, bigtime_t interval, int32 count, BMessenger reply_to);

virtual ~BMessageRunner();

status_t InitCheck() const;

status_t SetInterval(bigtime_t interval);

status_t SetCount(int32 count);

status_t GetInfo(bigtime_t* interval, int32* count) const;

BMessenger Class

BMessenger();

BMessenger(const char* mime_sig, team_id team = -1, status_t* perr = NULL);

BMessenger(const BHandler* handler, const BLooper* looper = NULL, status_t* perr = NULL);

BMessenger(const BMessenger& from);

~BMessenger();

bool IsTargetLocal() const;

BHandler* Target(BLooper** looper) const;

bool LockTarget() const;

status_t LockTargetWithTimeout(bigtime_t timeout) const;

status_t SendMessage(uint32 command, BHandler* reply_to = NULL) const;

status_t SendMessage(BMessage* a_message, BHandler* reply_to = NULL, bigtime_t timeout = B_INFINITE_TIMEOUT) const;

status_t SendMessage(BMessage* a_message, BMessenger reply_to, bigtime_t timeout = B_INFINITE_TIMEOUT) const;

status_t SendMessage(uint32 command, BMessage* reply) const;

status_t SendMessage(BMessage* a_message, BMessage* reply, bigtime_t send_timeout = B_INFINITE_TIMEOUT, bigtime_t reply_timeout = B_INFINITE_TIMEOUT) const;

BMessenger& operator=(const BMessenger &from);

bool operator==(const BMessenger &other) const;

bool IsValid() const;

team_id Team() const;

BMessenger Support Functions

bool operator<(const BMessenger & a, const BMessenger & b);

bool operator!=(const BMessenger & a, const BMessenger & b);

Legend

| Functional Spec
| Use Cases
| Unit Tests
| Technical Spec
| Implementation
| Completed

The OpenBeOS project is hosted by:

Copyright © 2001-2002 OpenBeOS Project