00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 #ifndef BASICS_H
00031 #define BASICS_H
00032 
00033 #include "w_defines.h"
00034 
00035 
00036 
00037 #ifdef __GNUG__
00038 #pragma interface
00039 #endif
00040 
00041 #ifndef W_BASE_H
00042 #include <w_base.h>
00043 #endif
00044 
00045 typedef w_base_t::int1_t      int1_t;
00046 typedef w_base_t::int2_t      int2_t;
00047 typedef w_base_t::int4_t      int4_t;
00048 typedef w_base_t::uint1_t     uint1_t;
00049 typedef w_base_t::uint2_t     uint2_t;
00050 typedef w_base_t::uint4_t     uint4_t;
00051 
00052 
00053 typedef uint4_t               smsize_t;
00054 
00055 
00056 
00057 typedef w_base_t::uint4_t    shpid_t; 
00058 
00059 #ifndef SM_SOURCE
00060 
00061 
00062 
00063 namespace locking {
00064  typedef w_base_t::lock_duration_t  lock_duration_t; 
00065  typedef w_base_t::lock_mode_t  lock_mode_t; 
00066  static const lock_mode_t NL = w_base_t::NL;
00067  static const lock_mode_t IS = w_base_t::IS;
00068  static const lock_mode_t IX = w_base_t::IX;
00069  static const lock_mode_t SH = w_base_t::SH;
00070  static const lock_mode_t SIX = w_base_t::SIX;
00071  static const lock_mode_t UD = w_base_t::UD;
00072  static const lock_mode_t EX = w_base_t::EX;
00073 }
00074 using namespace locking;
00075 
00076 
00077 namespace two_phase_commit {
00078  typedef w_base_t::vote_t  vote_t; 
00079 }
00080 using namespace two_phase_commit;
00081 #endif
00082 
00083 
00084 
00085 typedef w_base_t::int2_t slotid_t;  
00086 
00087 
00088 const int2_t    max_int2 = 0x7fff;         
00089 const int2_t    min_int2 = (short)0x8000;     
00090 const int4_t    max_int4 = 0x7fffffff;         
00091 const int4_t    max_int4_minus1 = max_int4 -1;
00092 const int4_t    min_int4 = 0x80000000;         
00093 
00094 const uint2_t    max_uint2 = 0xffff;
00095 const uint2_t    min_uint2 = 0;
00096 const uint4_t    max_uint4 = 0xffffffff;
00097 const uint4_t    min_uint4 = 0;
00098 
00099 
00100 
00101 
00102 
00103 
00104 inline int u4i(uint4_t x) {w_assert1(x<=(unsigned)max_int4); return int(x); }
00105 
00106 
00107 
00108 
00109 
00110 inline bool is_aligned(smsize_t sz)
00111 {
00112     return w_base_t::is_aligned(sz);
00113 }
00114 
00115 inline bool is_aligned(const void* p)
00116 {
00117     return w_base_t::is_aligned(p);
00118 }
00119 
00120 
00121 
00122 #endif