home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / smxdemo / smxpp / message.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-16  |  1.6 KB  |  66 lines

  1. /*************************************************************************
  2. *  Copyright (c) 1989-1992 Micro Digital Associates, Inc.
  3. *                  All Rights Reserved.
  4. *
  5. *  MODULE: Message.hpp
  6. *
  7. *  DESRIPTION:
  8. *           This module defines the message class.  Messages can
  9. *           send and receive themselves to and from an exchange. They
  10. *           also can put and get themselves from SIOBuses.
  11. *
  12. *
  13. *  AUTHOR: Rick Evans 
  14. *
  15. *
  16. *  UPDATE LOG
  17. *
  18. *************************************************************************/
  19.  
  20. #ifndef __MESSAGE_HPP
  21. #define __MESSAGE_HPP
  22.  
  23. #include    <xtypes.h>
  24. #include    "exchange.hpp"
  25. #include    "resxchg.hpp"
  26. #include    "siobus.hpp"
  27.  
  28. typedef enum { nearHeap, farHeap } HEAPTYPE;
  29.  
  30. class Message
  31. {
  32.  
  33.    MCB_PTR     MsgCBP;
  34.    BOOLEAN     HoldingFlg;
  35.  
  36. public:
  37.    //----- constructors ------
  38.    Message();
  39.    Message( word BlkSize, HEAPTYPE HeapType = nearHeap );
  40.    Message( const Message& msg );
  41.    Message( MCB_PTR p );
  42.  
  43.    //----- methods --------
  44.    BOOLEAN     Send( const Xchg& xchg );
  45.    BOOLEAN     Bump( word priority );
  46.    BOOLEAN     Receive( const Xchg& xchg, word TimeOut=INF );
  47.    BOOLEAN     ReceiveStop( const Xchg& xchg, word TimeOut=INF );
  48.  
  49.    BOOLEAN     Put( const SIOBus& xchg );
  50.    BOOLEAN     Get( const SIOBus& xchg );
  51.  
  52.    void far*   Contents();
  53.    BOOLEAN     Holding();
  54.    BOOLEAN     Create( word size, HEAPTYPE ht=nearHeap );
  55.    BOOLEAN     Create( word size, const ResXchg& rxchg,
  56.                           HEAPTYPE ht=nearHeap, word num=1 );
  57.    BOOLEAN     Delete();
  58.  
  59.    //---- destructor ------
  60.    ~Message();
  61.  
  62. };
  63.  
  64. #endif
  65. //EOF
  66.