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 #ifndef _hyp_type_h_
00030 #define _hyp_type_h_
00031
00032 #include"hyp.def.h"
00033 #include"hyp.ker.def.h"
00034
00035 hyp_NAMESPACE_BEGIN_HYP
00036
00042
00047
00048 typedef int t_label;
00049 typedef unsigned int t_size;
00050
00051 typedef unsigned short int t_ushort;
00052 typedef unsigned char t_uchar;
00053 typedef unsigned long int t_ulong;
00054 typedef unsigned int t_uint;
00056
00063 #define hyp_USE_DOUBLE 1
00064
00065 #ifdef hyp_USE_DOUBLE
00066 typedef double t_real;
00067 #else
00068 typedef float t_real;
00069 #endif
00070
00071
00072
00078 class CFlag
00079 {
00080 public:
00081 typedef t_uint t_flag;
00082
00083 explicit CFlag(const t_size& Pos) { m_Flag = (0x00000001<<Pos) ; }
00084 CFlag() : m_Flag(0) {};
00085
00086 inline operator t_flag() const {
00087 return GetFlag();
00088 }
00089 inline t_flag GetFlag(void) const {
00090 return m_Flag;
00091 }
00092
00093 inline void SetFlag(const t_flag& Flag) {
00094 m_Flag|=Flag;
00095 }
00096 inline bool HaveFlag(const t_flag& Flag) const {
00097 return (Flag & m_Flag) ==0 ? false : true;
00098 }
00099
00100 private:
00101 t_flag m_Flag;
00102 };
00103
00104
00109
00115 template<class T>
00116 class TArray :
00117 #ifdef hyp_USE_VALARRAY
00118 public std::valarray<T>
00119 #else
00120 public std::vector<T>
00121 #endif
00122 {
00123 public:
00129 explicit TArray(t_size Capacity,const T& Data=T()) {
00130 resize(Capacity,Data);
00131 }
00132
00137 void reset(const T& Data) {
00138 for(int i=0;size();i++) (*this)[i]=Data;
00139 }
00140
00145 void show(std::ostream& Stream) {
00146 stream<<"TArray : "<<this<<" - Size : "<<size()<<"\n";
00147 for(int i=0;i<size();i++) {
00148 Stream<<"N° : "<<i<<" - "<<at(i)<<"\n";
00149 }
00150 }
00151 };
00152
00153 typedef TArray<t_real> t_real_array;
00154 typedef TArray<bool> t_mask_array;
00155 typedef TArray<t_label> t_label_array;
00156
00157 typedef std::vector<t_label> t_label_enum;
00159
00160
00165 typedef signed __int64 t_int64;
00166 hyp_ker_DLL t_int64 GetInt64(t_uint High,t_uint Low);
00167 hyp_ker_DLL t_uint GetHighInt64(t_int64);
00168 hyp_ker_DLL t_uint GetLowInt64(t_int64);
00169 hyp_ker_DLL std::ostream& operator<<(std::ostream&,const t_int64&);
00171
00172
00173
00174 hyp_NAMESPACE_END_HYP
00175
00176 #endif