ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

MessageClass.hpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel MessageClass.hpp */
40 /* */
41 /* Primitive Message Class Definitions */
42 /* */
43 /******************************************************************************/
44 #ifndef Included_RexxMessage
45 #define Included_RexxMessage
46 
47 #define flagResultReturned 0x00000001
48 #define flagRaiseError 0x00000002
49 #define flagErrorReported 0x00000004
50 #define flagAllNotified 0x00000008
51 #define flagStartPending 0x00000010
52 #define flagMsgSent 0x00000020
53 
54  class RexxMessage : public RexxObject {
55  public:
56  void * operator new(size_t);
57  inline void * operator new(size_t size, void *objectPtr) { return objectPtr; };
58  /* So it doesn't need to do anythin*/
60  inline RexxMessage(RESTORETYPE restoreType) { ; };
61 
62  void live(size_t);
63  void liveGeneral(int reason);
64  void flatten(RexxEnvelope *);
66  RexxObject *result();
70  void sendNotification();
71  void error(RexxDirectory *);
77  RexxObject *newRexx(RexxObject **, size_t);
79 
80  inline bool resultReturned() { return (this->dataFlags & flagResultReturned) != 0; };
81  inline bool raiseError() { return (this->dataFlags & flagRaiseError) != 0; };
82  inline bool errorReported() { return (this->dataFlags & flagErrorReported) != 0; };
83  inline bool allNotified() { return (this->dataFlags & flagAllNotified) != 0; };
84  inline bool startPending() { return (this->dataFlags & flagStartPending) != 0; };
85  inline bool msgSent() { return (this->dataFlags & flagMsgSent) != 0; };
86  inline void setResultReturned() { this->dataFlags |= flagResultReturned; };
87  inline void setRaiseError() { this->dataFlags |= flagRaiseError; };
88  inline void setErrorReported() { this->dataFlags |= flagErrorReported; };
89  inline void setAllNotified() { this->dataFlags |= flagAllNotified; };
90  inline void setStartPending() { this->dataFlags |= flagStartPending; };
91  inline void setMsgSent() { this->dataFlags |= flagMsgSent; };
92 
93  static void createInstance();
95 
96  protected:
97 
98  RexxObject *receiver; /* Real receiver of message. */
99  RexxObject *target; /* Target object specified */
100  RexxString *message; /* Message to be sent */
101  RexxObject *startscope; /* Starting scope for method lookup */
104  RexxList *interestedParties; /* message objects to be notified */
105  RexxDirectory *condition; /* condition object, generated by */
106  RexxActivity *startActivity; /* Activity created to run msg */
107  RexxList *waitingActivities; /* waiting activities list */
108  size_t dataFlags; /* flags to control processing */
109  SysSemaphore waitResultSem; /* Semophore used to wait on result */
110  size_t NumWaiting; /* activities waiting on result */
111  };
112 
113 #endif
RexxMessage::startActivity
RexxActivity * startActivity
Definition: MessageClass.hpp:106
RexxMessage::interestedParties
RexxList * interestedParties
Definition: MessageClass.hpp:104
RexxArray
Definition: ArrayClass.hpp:100
SysSemaphore
Definition: SysSemaphore.hpp:52
RexxMessage::errorCondition
RexxObject * errorCondition()
Definition: MessageClass.cpp:440
RexxMessage::hasError
RexxObject * hasError()
Definition: MessageClass.cpp:420
RexxMessage::result
RexxObject * result()
Definition: MessageClass.cpp:189
RexxMessage::startPending
bool startPending()
Definition: MessageClass.hpp:84
RexxMessage::classInstance
static RexxClass * classInstance
Definition: MessageClass.hpp:94
RexxMessage::msgSent
bool msgSent()
Definition: MessageClass.hpp:85
RexxMessage::RexxMessage
RexxMessage(RESTORETYPE restoreType)
Definition: MessageClass.hpp:60
flagResultReturned
#define flagResultReturned
Definition: MessageClass.hpp:47
RexxMessage::message
RexxString * message
Definition: MessageClass.hpp:100
RexxMessage::newRexx
RexxObject * newRexx(RexxObject **, size_t)
Definition: MessageClass.cpp:499
RexxMessage::resultObject
RexxObject * resultObject
Definition: MessageClass.hpp:103
RexxMessage::waitResultSem
SysSemaphore waitResultSem
Definition: MessageClass.hpp:109
RexxMessage::target
RexxObject * target
Definition: MessageClass.hpp:99
flagMsgSent
#define flagMsgSent
Definition: MessageClass.hpp:52
RexxMessage::setRaiseError
void setRaiseError()
Definition: MessageClass.hpp:87
RexxMessage::setResultReturned
void setResultReturned()
Definition: MessageClass.hpp:86
RexxMessage::live
void live(size_t)
Definition: MessageClass.cpp:94
RexxMessage::getActivity
RexxActivity * getActivity()
Definition: MessageClass.hpp:78
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxMessage::arguments
RexxArray * arguments()
Definition: MessageClass.cpp:484
RexxMessage::args
RexxArray * args
Definition: MessageClass.hpp:102
RexxMessage::messageTarget
RexxObject * messageTarget()
Definition: MessageClass.cpp:461
RexxMessage::start
RexxObject * start(RexxObject *)
Definition: MessageClass.cpp:301
RexxMessage::resultReturned
bool resultReturned()
Definition: MessageClass.hpp:80
RexxMessage::createInstance
static void createInstance()
Definition: MessageClass.cpp:64
RexxMessage::allNotified
bool allNotified()
Definition: MessageClass.hpp:83
RexxActivity
Definition: RexxActivity.hpp:127
RexxDirectory
Definition: DirectoryClass.hpp:49
RexxClass
Definition: ClassClass.hpp:49
RexxMessage::sendNotification
void sendNotification()
Definition: MessageClass.cpp:339
RexxMessage::dataFlags
size_t dataFlags
Definition: MessageClass.hpp:108
flagStartPending
#define flagStartPending
Definition: MessageClass.hpp:51
RexxMessage::setAllNotified
void setAllNotified()
Definition: MessageClass.hpp:89
RexxMessage::liveGeneral
void liveGeneral(int reason)
Definition: MessageClass.cpp:112
RexxMessage::raiseError
bool raiseError()
Definition: MessageClass.hpp:81
RexxMessage::waitingActivities
RexxList * waitingActivities
Definition: MessageClass.hpp:107
RexxMessage
Definition: MessageClass.hpp:54
RexxMessage::NumWaiting
size_t NumWaiting
Definition: MessageClass.hpp:110
RexxMessage::completed
RexxObject * completed()
Definition: MessageClass.cpp:395
RexxMessage::errorReported
bool errorReported()
Definition: MessageClass.hpp:82
RexxMessage::setErrorReported
void setErrorReported()
Definition: MessageClass.hpp:88
RexxMessage::startscope
RexxObject * startscope
Definition: MessageClass.hpp:101
RexxMessage::notify
RexxObject * notify(RexxMessage *)
Definition: MessageClass.cpp:152
RexxMessage::flatten
void flatten(RexxEnvelope *)
Definition: MessageClass.cpp:130
RexxMessage::setMsgSent
void setMsgSent()
Definition: MessageClass.hpp:91
RexxMessage::error
void error(RexxDirectory *)
Definition: MessageClass.cpp:381
RexxMessage::messageName
RexxString * messageName()
Definition: MessageClass.cpp:473
flagErrorReported
#define flagErrorReported
Definition: MessageClass.hpp:49
RexxMessage::condition
RexxDirectory * condition
Definition: MessageClass.hpp:105
RexxMessage::setStartPending
void setStartPending()
Definition: MessageClass.hpp:90
RexxMessage::send
RexxObject * send(RexxObject *)
Definition: MessageClass.cpp:239
RexxMessage::RexxMessage
RexxMessage(RexxObject *, RexxString *, RexxObject *, RexxArray *)
Definition: MessageClass.cpp:79
RexxMessage::receiver
RexxObject * receiver
Definition: MessageClass.hpp:98
RESTORETYPE
RESTORETYPE
Definition: ObjectClass.hpp:80
RexxList
Definition: ListClass.hpp:63
flagRaiseError
#define flagRaiseError
Definition: MessageClass.hpp:48
RexxObject
Definition: ObjectClass.hpp:311
RexxString
Definition: StringClass.hpp:119
flagAllNotified
#define flagAllNotified
Definition: MessageClass.hpp:50