haiku/headers/private/app/MessagePrivate.h
ejakowatz 19cdc4570f How the glaring fubar in MessagePrivate.h got past me is a mystery.
Nonetheless, here is new BMessenger-related goodness to smooth is all out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-08-25 23:33:02 +00:00

69 lines
1.6 KiB
C++

//------------------------------------------------------------------------------
// MessagePrivate.h
//
//------------------------------------------------------------------------------
#ifndef MESSAGEPRIVATE_H
#define MESSAGEPRIVATE_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <Message.h>
#include <Messenger.h>
#include <MessengerPrivate.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
extern "C" void _msg_cache_cleanup_();
extern "C" int _init_message_();
extern "C" int _delete_message_();
class BMessage::Private
{
public:
Private(BMessage* msg) : fMessage(msg) {;}
Private(BMessage& msg) : fMessage(&msg) {;}
inline void SetTarget(int32 token, bool preferred)
{
fMessage->fTarget = token;
fMessage->fPreferred = preferred;
}
inline void SetReply(BMessenger messenger)
{
BMessenger::Private mp(messenger);
fMessage->fReplyTo.port = mp.Port();
fMessage->fReplyTo.target = mp.Token();
fMessage->fReplyTo.team = mp.Team();
fMessage->fReplyTo.preferred = mp.IsPreferredTarget();
}
inline int32 GetTarget()
{
return fMessage->fTarget;
}
inline bool UsePreferredTarget()
{
return fMessage->fPreferred;
}
private:
BMessage* fMessage;
};
#endif // MESSAGEPRIVATE_H
/*
* $Log $
*
* $Id $
*
*/