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)  

ContextApi.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.ibm.com/developerworks/oss/CPLv1.0.htm */
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 API support */
40 /* */
41 /* Stub functions for all APIs accessed via the NativeFunctionContext */
42 /* */
43 /******************************************************************************/
44 
45 #ifndef ContextApi_Included
46 #define ContextApi_Included
47 
48 #include "RexxCore.h"
49 #include "RexxNativeActivation.hpp"
51 #include "RexxActivity.hpp"
52 
57 {
58 public:
65  {
66  // we need to cleanup on exit
67  releaseLock = true;
71  // go acquire the kernel lock and take care of nesting
73  // we need to validate the thread call context to ensure this
74  // is the correct thread
76  }
77 
78 
86  inline ApiContext(RexxThreadContext *c, bool blocking)
87  {
88 
89  // we need to cleanup on exit
90  releaseLock = blocking;
94  }
95 
102  {
103  // we need to cleanup on exit
104  releaseLock = true;
108  // go acquire the kernel lock and take care of nesting
110  // we need to validate the thread call context to ensure this
111  // is the correct thread
113  }
114 
121  {
122  // we need to cleanup on exit
123  releaseLock = true;
127  // go acquire the kernel lock and take care of nesting
129  // we need to validate the thread call context to ensure this
130  // is the correct thread
132  }
133 
140  {
141  // we need to cleanup on exit
142  releaseLock = true;
146  // go acquire the kernel lock and take care of nesting
148  // we need to validate the thread call context to ensure this
149  // is the correct thread
151  }
152 
157  inline ~ApiContext()
158  {
159  // we only do this sort of cleanup if we really entered on the
160  // activity
161  if (releaseLock)
162  {
165  }
166  }
167 
169  {
171  return (RexxObjectPtr)o;
172  }
173 
182 
187 };
188 
189 
194 {
195 public:
202  {
203  instance = ((InstanceContext *)c)->instance;
204  }
205 
211  {
212  }
213 
218 };
219 
220 #endif
RexxActivity::getApiContext
RexxNativeActivation * getApiContext()
Definition: RexxActivity.hpp:297
InstanceApiContext
Definition: ContextApi.hpp:193
RexxThreadContext_
Definition: oorexxapi.h:710
InstanceApiContext::instance
InterpreterInstance * instance
Definition: ContextApi.hpp:217
ApiContext::ApiContext
ApiContext(RexxMethodContext *c)
Definition: ContextApi.hpp:139
RexxActivity::enterCurrentThread
void enterCurrentThread()
Definition: RexxActivity.cpp:201
RexxActivity::exitCurrentThread
void exitCurrentThread()
Definition: RexxActivity.cpp:184
RexxNativeActivation.hpp
ApiContext::context
RexxNativeActivation * context
Definition: ContextApi.hpp:181
ApiContext::ApiContext
ApiContext(RexxThreadContext *c, bool blocking)
Definition: ContextApi.hpp:86
InstanceApiContext::~InstanceApiContext
~InstanceApiContext()
Definition: ContextApi.hpp:210
ApiContext
Definition: ContextApi.hpp:56
ApiContext::ret
RexxObjectPtr ret(RexxObject *o)
Definition: ContextApi.hpp:168
ApiContext::ApiContext
ApiContext(RexxCallContext *c)
Definition: ContextApi.hpp:101
InstanceContext
Definition: ActivationApiContexts.hpp:59
RexxNativeActivation::disableConditionTraps
void disableConditionTraps()
Definition: RexxNativeActivation.hpp:182
ApiContext::ApiContext
ApiContext(RexxThreadContext *c)
Definition: ContextApi.hpp:64
ApiContext::~ApiContext
~ApiContext()
Definition: ContextApi.hpp:157
RexxMethodContext_
Definition: oorexxapi.h:1404
RexxActivity
Definition: RexxActivity.hpp:127
contextToActivity
RexxActivity * contextToActivity(RexxThreadContext *c)
Definition: ActivationApiContexts.hpp:98
RexxNativeActivation::enableConditionTraps
void enableConditionTraps()
Definition: RexxNativeActivation.hpp:181
InstanceApiContext::InstanceApiContext
InstanceApiContext(RexxInstance *c)
Definition: ContextApi.hpp:201
RexxNativeActivation::createLocalReference
void createLocalReference(RexxObject *objr)
Definition: RexxNativeActivation.cpp:1162
RexxExitContext_
Definition: oorexxapi.h:2906
RexxActivity::validateThread
void validateThread()
Definition: RexxActivity.cpp:3224
ActivationApiContexts.hpp
InterpreterInstance
Definition: InterpreterInstance.hpp:55
contextToActivation
RexxNativeActivation * contextToActivation(RexxThreadContext *c)
Definition: RexxActivity.hpp:407
RexxNativeActivation
Definition: RexxNativeActivation.hpp:62
RexxActivity.hpp
RexxCallContext_
Definition: oorexxapi.h:2154
RexxCore.h
ApiContext::ApiContext
ApiContext(RexxExitContext *c)
Definition: ContextApi.hpp:120
ApiContext::releaseLock
bool releaseLock
Definition: ContextApi.hpp:186
RexxInstance_
Definition: oorexxapi.h:677
RexxObject
Definition: ObjectClass.hpp:311
ApiContext::activity
RexxActivity * activity
Definition: ContextApi.hpp:177
RexxObjectPtr
struct _RexxObjectPtr * RexxObjectPtr
Definition: rexx.h:127