Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roccom_basic.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 /* $Id: roccom_basic.h,v 1.30 2008/12/06 08:43:24 mtcampbe Exp $ */
24 
29 /* Author: Xiangmin Jiao
30  * Creation date: Jan. 10, 2001
31  */
32 
33 #ifndef __ROCCOM_BASIC_H__
34 #define __ROCCOM_BASIC_H__
35 
36 #ifdef __cplusplus
37 
41 #define COM_BEGIN_NAME_SPACE namespace COM {
42 
43 #define COM_END_NAME_SPACE }
44 
45 #define USE_COM_NAME_SPACE using namespace COM;
46 
47 class COM_Object {
48 public:
49  COM_Object() : _cookie( COM_COOKIE) {}
50  COM_Object( const COM_Object &m) : _cookie( &m? m._cookie : COM_COOKIE) {}
51  virtual ~COM_Object() {}
52 
57  int validate_object( void *obj=0) const {
58  int ierr=0;
59  if ( obj && obj!=this) ierr+=1;
60  if ( _cookie != COM_COOKIE) ierr += 2;
61  return ierr;
62  }
63 
64 protected:
65  enum { COM_COOKIE = 762266 };
66 
67  int _cookie;
68 };
69 
70 typedef void (COM_Object::*Member_func_ptr)();
71 typedef void (COM_Object::*COM_Member_func_ptr)();
73 #endif
74 /*}*/
75 
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 #ifdef COM_APPEND_TWOUNDERSCORE
79 # define COM_F_FUNC(x) x ## __
80 #elif defined(COM_APPEND_UNDERSCORE)
81 # define COM_F_FUNC(x) x ## _
82 #else
83 # define COM_F_FUNC(x) x
84 #endif
85 
86 #include "FC.h"
87 #define COM_F_FUNC2( lowcase, uppercase ) FC_GLOBAL(lowcase, uppercase)
88 /* #ifdef COM_UPPERCASE
89 // #define COM_F_FUNC2( lowcase, uppercase) COM_F_FUNC( uppercase)
90 // #else
91 // #define COM_F_FUNC2( lowcase, uppercase) COM_F_FUNC( lowcase)
92 // #endif
93 */
94 
95 #endif
96 
97 #ifdef STATIC_LINK
98 # define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName,windowString) \
99  { MPI_Comm comm = COM_get_default_communicator(); \
100  COM_set_default_communicator(MPI_COMM_SELF); \
101  moduleName##_load_module(windowString); \
102  COM_set_default_communicator(comm); \
103  }
104 # define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName,windowString) \
105  moduleName##_unload_module(windowString);
106 
107 # define COM_EXTERN_MODULE( moduleName) \
108  extern "C" void moduleName##_load_module( const char *); \
109  extern "C" void moduleName##_unload_module( const char *)
110 #else
111 # define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName,windowString) \
112  COM_load_module(#moduleName,windowString)
113 # define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName,windowString) \
114  COM_unload_module(#moduleName,windowString)
115 
116 # define COM_EXTERN_MODULE( moduleName)
117 #endif
118 
120 #define MAX_NAMELEN 128
121 
122 typedef int COM_Type;
123 typedef void (*Func_ptr)();
125 
127 enum {
138  COM_STRING = -1, COM_RAWDATA = -2, COM_METADATA = -3, COM_VOID = -4,
140 
141 #endif
142 
143 
144 
145 
146 
147 
int COM_Type
Indices for derived data types.
Definition: roccom_basic.h:122
Func_ptr COM_Func_ptr
Definition: roccom_basic.h:124
C/C++ Data types.
Definition: roccom_basic.h:129
void(* Func_ptr)()
Pointer of functions.
Definition: roccom_basic.h:123
Fortran Data types.
Definition: roccom_basic.h:133