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 namespace locking {
00062 typedef w_base_t::lock_duration_t lock_duration_t;
00063 typedef w_base_t::lock_mode_t lock_mode_t;
00064 static const lock_mode_t NL = w_base_t::NL;
00065 static const lock_mode_t IS = w_base_t::IS;
00066 static const lock_mode_t IX = w_base_t::IX;
00067 static const lock_mode_t SH = w_base_t::SH;
00068 static const lock_mode_t SIX = w_base_t::SIX;
00069 static const lock_mode_t UD = w_base_t::UD;
00070 static const lock_mode_t EX = w_base_t::EX;
00071 }
00072 using namespace locking;
00073
00074
00075 namespace two_phase_commit {
00076 typedef w_base_t::vote_t vote_t;
00077 }
00078 using namespace two_phase_commit;
00079 #endif
00080
00081
00082
00083 typedef w_base_t::int2_t slotid_t;
00084
00085
00086 const int2_t max_int2 = 0x7fff;
00087 const int2_t min_int2 = (short)0x8000;
00088 const int4_t max_int4 = 0x7fffffff;
00089 const int4_t max_int4_minus1 = max_int4 -1;
00090 const int4_t min_int4 = 0x80000000;
00091
00092 const uint2_t max_uint2 = 0xffff;
00093 const uint2_t min_uint2 = 0;
00094 const uint4_t max_uint4 = 0xffffffff;
00095 const uint4_t min_uint4 = 0;
00096
00097
00098
00099
00100
00101
00102 inline int u4i(uint4_t x) {w_assert1(x<=(unsigned)max_int4); return int(x); }
00103
00104
00105
00106
00107
00108 inline bool is_aligned(smsize_t sz)
00109 {
00110 return w_base_t::is_aligned(sz);
00111 }
00112
00113 inline bool is_aligned(const void* p)
00114 {
00115 return w_base_t::is_aligned(p);
00116 }
00117
00118
00119
00120 #endif