|
| Messenger () |
| Default constructor. More...
|
|
| Messenger (const Handler *pcHandler, const Looper *pcLooper=NULL) |
| Construct a messenger targeting a looper and optionally a specific handler. More...
|
|
| Messenger (const Messenger &cMessenger) |
| Copy contructor. More...
|
|
| Messenger (port_id hPort) |
| Construct a messenger from a loopers message port. More...
|
|
| Messenger (const char *pzPort) |
| Construct a messenger for a named message port. More...
|
|
| ~Messenger () |
| Destructor. More...
|
|
Handler * | GetTarget (Looper **ppcLooper) const |
| Get a pointer to the handler targeted by this handler. More...
|
|
bool | IsTargetLocal (void) const |
| Check if the targeted handler/looper lives in the calling process. More...
|
|
bool | IsValid (void) const |
| Check if the messenger is fully initialized. More...
|
|
status_t | LockTarget (void) const |
| Lock the destination looper. More...
|
|
status_t | SendMessage (Message *pcMessage, Message *pcReply, bigtime_t nSendTimeOut=INFINITE_TIMEOUT, bigtime_t nReplyTimeOut=INFINITE_TIMEOUT) const |
| Deliver a message syncronously. More...
|
|
status_t | SendMessage (Message *pcMessage, Handler *pcReplyHandler=NULL, bigtime_t nTimeOut=INFINITE_TIMEOUT) const |
| Deliver message asyncronously. More...
|
|
status_t | SendMessage (int nCode, Message *pcReply=NULL) const |
| Short for SendMessage( &Message( nCode ), pcReply ) More...
|
|
status_t | SendMessage (int nCode, Handler *pcReplyHandler) const |
| Short for SendMessage( &Message( nCode ), pcReplyHandler ) More...
|
|
Messenger & | operator= (const Messenger &cMessenger) |
| Copy the target from another messenger. More...
|
|
bool | operator== (const Messenger &cMessenger) const |
| Compare two messengers. More...
|
|
status_t Messenger::SendMessage |
( |
Message * |
pcMsg, |
|
|
Message * |
pcReply, |
|
|
bigtime_t |
nSendTimeOut = INFINITE_TIMEOUT , |
|
|
bigtime_t |
nReplyTimeOut = INFINITE_TIMEOUT |
|
) |
| const |
- Description:
- Send a message to the target and optionally wait for a reply. If the
pcReply
argument is non-NULL, this function will not return until we receive a reply from the target or the nReplyTimeOut occure. The messenger will create a temporary message port from which it receives the reply. If pcReply is NULL the member will return as soon as the pcMsg message is delivered.
- Bugs:
- The timeout values is currently ignored, and is always interpreted as INFINITE_TIMEOUT
- Parameters
-
pcMsg | The message to deliver. The messages will be copyed and the caller keep ownership over the object. |
pcReply | The message to fill out with the reply or NULL to skip waiting for a reply. |
nSendTimeOut | Time to wait for a free slot in the receiving port before failing with errno == ETIME |
nReplyTimeOut | Time to wait for reply before failing with errno == ETIME |
- Returns
- On success 0 is returned. In the case of failure -1 is returned and a error code is written to the global variable errno.
- See Also
- os::Message::SendReply(), os::Message
- Author
- Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
References IsValid().
Referenced by os::RegistrarManager::ClearTypeExtensions(), os::RegistrarManager::ClearTypeHandlers(), os::RegistrarManager::GetAppList(), os::Event::GetLastEventMessage(), os::Event::GetRemoteChildren(), os::Font::GetSupportedCharacters(), os::RegistrarManager::GetType(), os::RegistrarManager::GetTypeAndIcon(), os::RegistrarManager::GetTypeCount(), os::DateView::HandleMessage(), os::CalendarView::HandleMessage(), os::FileRequester::HandleMessage(), os::ColorRequester::HandleMessage(), os::InputBox::HandleMessage(), os_priv::DirKeeper::Idle(), os::Invoker::Invoke(), os::Translator::Invoke(), MoveFileThread(), os::FileRequester::OkToQuit(), os::ColorRequester::OkToQuit(), os::InputBox::OkToQuit(), os::Event::PostEvent(), os::Event::Register(), os::RegistrarManager::RegisterType(), os::RegistrarManager::RegisterTypeExtension(), os::RegistrarManager::RegisterTypeHandler(), os::RegistrarManager::RegisterTypeIcon(), os::RegistrarManager::RegistrarManager(), SendMessage(), os::RegistrarManager::SetDefaultHandler(), os::Font::SetFamilyAndStyle(), os::Event::SetMonitorEnabled(), os::Event::SetToRemote(), os::TreeViewCheckNode::Toggle(), os::CheckRow::Toggle(), UnmountThread(), os::RegistrarManager::UnregisterType(), os::RegistrarManager::UpdateAppList(), os::Event::~Event(), and os::RegistrarManager::~RegistrarManager().