haiku/headers/private/app/MessagePrivate.h
ejakowatz e9e500cb9e Minor tweak to BHandler::UnlockLooper()
Added calls to _init_message_(), _delete_message_(), and
_msg_cache_cleanup() to InitTerminateLibBe.cpp
Finished first implementation of BMessage::SendReply(), BMessage::_send_(),
and BMessage::_send_message()
Add BMessage to app.src, removed BBlockCache from support.src.
New BMessage::Private class has functions for twiddling BMessage internals


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-08-25 07:55:52 +00:00

65 lines
1.6 KiB
C++

//------------------------------------------------------------------------------
// MessagePrivate.h
//
//------------------------------------------------------------------------------
#ifndef MESSAGEPRIVATE_H
#define MESSAGEPRIVATE_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
// 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)
{
fMessage->fReplyTo.port = messenger.fPort;
fMessage->fReplyTo.target = messenger.fHandlerToken;
fMessage->fReplyTo.team = messenger.fTeam;
fMessage->fReplyTo.preferred = messenger.fPreferredTarget;
}
inline int32 GetTarget()
{
return fMessage->fTarget;
}
inline bool UsePreferredTarget()
{
return fMessage->fPreferred;
}
private:
BMessage* fMessage;
};
#endif // MESSAGEPRIVATE_H
/*
* $Log $
*
* $Id $
*
*/