CPN
Computational Process Networks
common.h
Go to the documentation of this file.
1 #ifndef CPN_COMMON_H
2 #define CPN_COMMON_H
3 #pragma once
4 #include <stdint.h>
5 #include <tr1/memory>
6 #include <memory>
7 
8 // This code was obtained from http://gcc.gnu.org/wiki/Visibility
9 // Generic helper definitions for shared library support
10 #if defined _WIN32 || defined __CYGWIN__
11 #define CPN_HELPER_DLL_IMPORT __declspec(dllimport)
12 #define CPN_HELPER_DLL_EXPORT __declspec(dllexport)
13 #define CPN_HELPER_DLL_LOCAL
14 #else
15 #if __GNUC__ >= 4
16 #define CPN_HELPER_DLL_IMPORT __attribute__ ((visibility("default")))
17 #define CPN_HELPER_DLL_EXPORT __attribute__ ((visibility("default")))
18 #define CPN_HELPER_DLL_LOCAL __attribute__ ((visibility("hidden")))
19 #else
20 #define CPN_HELPER_DLL_IMPORT
21 #define CPN_HELPER_DLL_EXPORT
22 #define CPN_HELPER_DLL_LOCAL
23 #endif
24 #endif
25 // Now we use the generic helper definitions above to define CPN_API and CPN_LOCAL.
26 // CPN_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
27 // CPN_LOCAL is used for non-api symbols.
28 #ifdef CPN_DLL // defined if CPN is compiled as a DLL
29 #ifdef CPN_DLL_EXPORTS // defined if we are building the CPN DLL (instead of using it)
30 #define CPN_API CPN_HELPER_DLL_EXPORT
31 #else
32 #define CPN_API CPN_HELPER_DLL_IMPORT
33 #endif // CPN_DLL_EXPORTS
34 #define CPN_LOCAL CPN_HELPER_DLL_LOCAL
35 #else // CPN_DLL is not defined: this means CPN is a static lib.
36 #define CPN_API
37 #define CPN_LOCAL
38 #endif // CPN_DLL
39 
40 namespace libvariant {
41  class Variant;
42 }
43 
48 namespace CPN {
49 
50  using std::tr1::shared_ptr;
51  using std::tr1::weak_ptr;
52  using std::tr1::dynamic_pointer_cast;
53  using std::auto_ptr;
54 
55  using libvariant::Variant;
56 
57  // Forward declarations
58  class Kernel;
59  class KernelBase;
60  class KernelAttr;
61  class ConnectionServer;
62  class RemoteQueueHolder;
63 
64  class QueueBase;
65  class QueueReader;
66  class QueueWriter;
67  class QueueReleaser;
68  class QueueAttr;
69  class SimpleQueueAttr;
70 
71  class NodeAttr;
72  class NodeBase;
73  class PseudoNode;
74  class NodeFactory;
75 
76  class Context;
77 
78  class RemoteQueue;
80 
81  // Global enums
82 
83  // Types
87  typedef uint64_t Key_t;
88 
89 }
90 
91 
92 #endif
uint64_t Key_t
Definition: common.h:79