CPN
Computational Process Networks
Context.cc
Go to the documentation of this file.
1 //=============================================================================
2 // Computational Process Networks class library
3 // Copyright (C) 1997-2006 Gregory E. Allen and The University of Texas
4 //
5 // This library is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU Library General Public License as published
7 // by the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
14 //
15 // The GNU Public License is available in the file LICENSE, or you
16 // can write to the Free Software Foundation, Inc., 59 Temple Place -
17 // Suite 330, Boston, MA 02111-1307, USA, or you can find it on the
18 // World Wide Web at http://www.fsf.org.
19 //=============================================================================
23 #include "common_priv.h"
24 #include <cpn/Context.h>
25 #include <cpn/Exceptions.h>
26 #include "LocalContext.h"
27 
28 namespace CPN {
29  shared_ptr<Context> Context::Local() {
30  return shared_ptr<Context>(new LocalContext);
31  }
32 
34  {
35  }
36 
38  }
39 
41  return false;
42  }
43 
45  if (IsTerminated()) {
46  throw ShutdownException();
47  }
48  }
49 
50 
51 }
52 
static shared_ptr< Context > Local()
Create a local context.
Definition: Context.cc:29
void CheckTerminated()
Convenience method that checks IsTerminated and if so throws a ShutdownException. ...
Definition: Context.cc:44
The Context abstract data type.
A local implementation of the Context interface.
Definition: LocalContext.h:40
An implemenation of Context for a local process specific context.
The exceptions specified for the CPN network.
An exception indicating that the Kernel has shut down.
Definition: Exceptions.h:38
virtual ~Context()
Definition: Context.cc:37
virtual bool RequireRemote()
Lets the kernel know that this context type requires remote activity. This overrides the kernel optio...
Definition: Context.cc:40
virtual bool IsTerminated()=0