home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * Copyright (c) 1989-1992 Micro Digital Associates, Inc.
- * All Rights Reserved.
- *
- * MODULE: Message.hpp
- *
- * DESRIPTION:
- * This module defines the message class. Messages can
- * send and receive themselves to and from an exchange. They
- * also can put and get themselves from SIOBuses.
- *
- *
- * AUTHOR: Rick Evans
- *
- *
- * UPDATE LOG
- *
- *************************************************************************/
-
- #ifndef __MESSAGE_HPP
- #define __MESSAGE_HPP
-
- #include <xtypes.h>
- #include "exchange.hpp"
- #include "resxchg.hpp"
- #include "siobus.hpp"
-
- typedef enum { nearHeap, farHeap } HEAPTYPE;
-
- class Message
- {
-
- MCB_PTR MsgCBP;
- BOOLEAN HoldingFlg;
-
- public:
- //----- constructors ------
- Message();
- Message( word BlkSize, HEAPTYPE HeapType = nearHeap );
- Message( const Message& msg );
- Message( MCB_PTR p );
-
- //----- methods --------
- BOOLEAN Send( const Xchg& xchg );
- BOOLEAN Bump( word priority );
- BOOLEAN Receive( const Xchg& xchg, word TimeOut=INF );
- BOOLEAN ReceiveStop( const Xchg& xchg, word TimeOut=INF );
-
- BOOLEAN Put( const SIOBus& xchg );
- BOOLEAN Get( const SIOBus& xchg );
-
- void far* Contents();
- BOOLEAN Holding();
- BOOLEAN Create( word size, HEAPTYPE ht=nearHeap );
- BOOLEAN Create( word size, const ResXchg& rxchg,
- HEAPTYPE ht=nearHeap, word num=1 );
- BOOLEAN Delete();
-
- //---- destructor ------
- ~Message();
-
- };
-
- #endif
- //EOF