home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- **
- ** C++ Class Library for the Amiga© system software.
- **
- ** Copyright (C) 1994 by Armin Vogt ** EMail: armin@uni-paderborn.de
- ** All Rights Reserved.
- **
- ** $Source: apphome:APlusPlus/RCS/libsource/MessageC.cxx,v $
- ** $Revision: 1.4 $
- ** $Date: 1994/05/05 22:09:47 $
- ** $Author: Armin_Vogt $
- **
- ******************************************************************************/
-
-
- #include <string.h>
- #include <APlusPlus/exec/MessageC.h>
-
-
- volatile static char rcs_id[] = "$Id: MessageC.cxx,v 1.4 1994/05/05 22:09:47 Armin_Vogt Exp Armin_Vogt $";
-
-
- MessageC::MessageC()
- {
- memset(this,0,sizeof(*this));
- signRemoved(); mn_Node.ln_Type = NT_FREEMSG;
- }
-
- MessageC::~MessageC()
- {
- mn_Node.ln_Type = NT_DEATHMESSAGE;
- }
-
- void MessageC::signRemoved()
- {
- mn_Node.ln_Succ = mn_Node.ln_Pred = (struct Node*)(struct Message*)this;
- }
-
- BOOL MessageC::isRemoved()
- {
- return ((NodeC*)this)->isLonelyNode();
- }
-
- MsgState MessageC::getMsgState()
- {
- switch (mn_Node.ln_Type)
- {
- case NT_MESSAGE :
-
- if (isRemoved()) return MSG_IN_PROCESS; else return MSG_SENT;
- break;
-
- case NT_REPLYMSG :
-
- if (isRemoved()) return MSG_FREE; else return MSG_REPLIED;
- break;
- }
- return MSG_FREE;
- }
-
- BOOL MessageC::replyMsg()
- {
- if (getMsgState()&MSG_SENT)
- {
- ReplyMsg(this);
- return TRUE;
- }
- else return FALSE;
- }
-