00001 #ifndef __J2K__JObjectTypes_HPP__ 00002 #define __J2K__JObjectTypes_HPP__ 00003 00004 00005 // Bit vector cannot be lower than 8 bits. 00006 #define VBIT unsigned char 00007 00008 ///////////////////////////////////////////////// 00009 ///// J2K Object Sub Types definition ///// 00010 ///////////////////////////////////////////////// 00011 typedef struct _JOT_Base_t 00012 { 00013 /* Fundamental type section */ 00014 VBIT Core : 1; 00015 VBIT System : 1; 00016 VBIT Event : 1; 00017 VBIT Component : 1; 00018 VBIT Container : 1; 00019 VBIT DataType : 1; 00020 VBIT Storage : 1; 00021 VBIT Format : 1; // 8 bits 00022 00023 VBIT Pattern : 1; 00024 VBIT Math : 1; 00025 VBIT Graphics : 1; 00026 VBIT GUI : 1; 00027 VBIT IO : 1; 00028 VBIT Net : 1; 00029 VBIT Utility : 1; 00030 VBIT Security : 1; // 16 bits 00031 00032 } JOT_Base_t; 00033 00034 00035 typedef struct _JOT_Model_t 00036 { 00037 /* Modeling section */ 00038 VBIT Adapter : 1; 00039 VBIT Descriptor : 1; 00040 VBIT Driver : 1; 00041 VBIT Factory : 1; 00042 VBIT Filter : 1; 00043 VBIT Handler : 1; 00044 VBIT Interface : 1; 00045 VBIT Listener : 1; // 8 bits 00046 VBIT Observer : 1; 00047 VBIT Manager : 1; 00048 VBIT Modifier : 1; 00049 00050 VBIT Skeleton : 1; 00051 VBIT Support : 1; 00052 VBIT Tranferable : 1; 00053 VBIT Toolkit : 1; 00054 00055 VBIT Server : 1; // 16 bits 00056 VBIT Client : 1; 00057 VBIT Options : 1; 00058 VBIT Reader : 1; 00059 VBIT Writer : 1; 00060 VBIT Input : 1; 00061 VBIT Output : 1; // 22 bits 00062 00063 char padding : 2; 00064 00065 } JOT_Model_t; 00066 00067 00068 typedef struct _JOT_DataType_t 00069 { 00070 /* DataTypes section */ 00071 VBIT Array : 1; 00072 VBIT List : 1; 00073 VBIT Iterator : 1; 00074 VBIT Queue : 1; 00075 VBIT Hash : 1; 00076 VBIT Vector : 1; 00077 VBIT Stack : 1; 00078 VBIT Buffer : 1; // 8 bits 00079 00080 } JOT_DataType_t; 00081 00082 00083 typedef struct _JOT_DataBase_t 00084 { 00085 /* Database section */ 00086 VBIT Database : 1; 00087 VBIT SQL : 1; 00088 VBIT Oracle : 1; 00089 VBIT PostgreSQL : 1; 00090 VBIT mySQL : 1; 00091 VBIT Ingres : 1; 00092 VBIT Access : 1; 00093 VBIT CSV : 1; // 8 bits 00094 00095 } JOT_DataBase_t; 00096 00097 typedef struct _JOT_String_t 00098 { 00099 /* String section */ 00100 VBIT String : 1; 00101 VBIT Ascii : 1; 00102 VBIT Binary : 1; 00103 VBIT Unicode : 1; 00104 VBIT Locale : 1; 00105 VBIT Text : 1; 00106 VBIT Buffer : 1; 00107 VBIT Data : 1; // 8 bits 00108 00109 } JOT_String_t; 00110 00111 00112 typedef struct _JOT_Math_t 00113 { 00114 /* Math section */ 00115 VBIT Geometry : 1; 00116 VBIT Math2D : 1; 00117 VBIT Math3D : 1; 00118 VBIT MathND : 1; 00119 VBIT Number : 1; 00120 VBIT Linear : 1; 00121 VBIT Matrix : 1; 00122 VBIT Complex : 1; // 8 bits 00123 00124 } JOT_Math_t; 00125 00126 00127 typedef struct _JOT_GUI_t 00128 { 00129 /* GUI section */ 00130 VBIT Window : 1; 00131 VBIT Button : 1; 00132 VBIT Menu : 1; 00133 VBIT DropBox : 1; 00134 VBIT ComboBox : 1; 00135 VBIT ListBox : 1; 00136 VBIT ScrollBar : 1; 00137 VBIT CheckBox : 1; // 8 bits 00138 00139 } JOT_GUI_t; 00140 00141 00142 typedef struct _JOT_Net_t 00143 { 00144 /* Networking section */ 00145 VBIT Socket : 1; 00146 VBIT Packet : 1; 00147 VBIT IP : 1; 00148 VBIT Protocol : 1; 00149 VBIT UDP : 1; 00150 VBIT TFTP : 1; 00151 VBIT TCP : 1; 00152 VBIT HTTP : 1; // 8 bits 00153 00154 } JOT_Net_t; 00155 00156 typedef struct _JOT_System_t 00157 { 00158 /* System section */ 00159 VBIT File : 1; 00160 VBIT Compression : 1; 00161 VBIT Utils : 1; 00162 VBIT Resource : 1; // 4 bits 00163 00164 char padding : 4; 00165 00166 } JOT_System_t; 00167 00168 00169 typedef struct _JOT_Security_t 00170 { 00171 /* Security section */ 00172 VBIT Encryption : 1; 00173 VBIT PGP : 1; // 2 bits 00174 00175 char padding : 6; 00176 00177 } JOT_Security_t; 00178 00179 00180 typedef struct _JOT_Thread_t 00181 { 00182 /* Thread section */ 00183 VBIT POSIX : 1; 00184 VBIT Thread : 1; 00185 VBIT Mutex : 1; 00186 VBIT Lock : 1; 00187 VBIT RWLock : 1; 00188 VBIT Semaphore : 1; // 6 bits 00189 00190 char padding : 2; 00191 00192 } JOT_Thread_t ; 00193 00194 00195 typedef struct _JOT_MultiMedia_t 00196 { 00197 /* MultiMedia section */ 00198 VBIT Media : 1; 00199 VBIT Multimedia : 1; 00200 VBIT Sound : 1; 00201 VBIT Image : 1; 00202 VBIT Animation : 1; // 5 bits 00203 00204 char padding : 3; 00205 00206 } JOT_MultiMedia_t; 00207 00208 00209 //////////////////////////////////////////// 00210 ///// J2K Object Type definition ///// 00211 //////////////////////////////////////////// 00212 00213 typedef struct _JObjectType_t 00214 { 00215 /* Fundamental type section */ 00216 JOT_Base_t base; 00217 00218 /* Modeling section */ 00219 JOT_Model_t model; 00220 00221 /* DataTypes section */ 00222 JOT_DataType_t datatype; 00223 00224 /* Database section */ 00225 JOT_DataType_t database; 00226 00227 /* String section */ 00228 JOT_String_t string; 00229 00230 /* Math section */ 00231 JOT_Math_t math; 00232 00233 /* MultiMedia section */ 00234 JOT_MultiMedia_t media; 00235 00236 /* GUI section */ 00237 JOT_GUI_t gui; 00238 00239 /* Networking section */ 00240 JOT_Net_t net; 00241 00242 /* System section */ 00243 JOT_System_t system; 00244 00245 /* Security section */ 00246 JOT_Security_t security; 00247 00248 /* Thread section */ 00249 JOT_Thread_t thread; 00250 00251 } JObjectType_t; 00252 00253 ///////////////////////////////////////////////////////////////////////////// 00254 00255 inline int JOT__isBase( JObjectType_t jot ) 00256 { 00257 register long v = *((long*)(&jot.base)); 00258 return (( v != 0 ) ? 1 : 0 ); 00259 } 00260 00261 inline int JOT__isModel( JObjectType_t jot ) 00262 { 00263 register long v = *((long*)(&jot.model)); 00264 return (( v != 0 ) ? 1 : 0 ); 00265 } 00266 00267 inline int JOT__isDataType( JObjectType_t jot ) 00268 { 00269 register long v = *((long*)(&jot.datatype)); 00270 return (( v != 0 ) ? 1 : 0 ); 00271 } 00272 00273 inline int JOT__isDataBase( JObjectType_t jot ) 00274 { 00275 register long v = *((long*)(&jot.database)); 00276 return (( v != 0 ) ? 1 : 0 ); 00277 } 00278 00279 inline int JOT__isString( JObjectType_t jot ) 00280 { 00281 register long v = *((long*)(&jot.string)); 00282 return (( v != 0 ) ? 1 : 0 ); 00283 } 00284 00285 inline int JOT__isMath( JObjectType_t jot ) 00286 { 00287 register long v = *((long*)(&jot.math)); 00288 return (( v != 0 ) ? 1 : 0 ); 00289 } 00290 00291 inline int JOT__isMedia( JObjectType_t jot ) 00292 { 00293 register long v = *((long*)(&jot.media)); 00294 return (( v != 0 ) ? 1 : 0 ); 00295 } 00296 00297 inline int JOT__isGUI( JObjectType_t jot ) 00298 { 00299 register long v = *((long*)(&jot.gui)); 00300 return (( v != 0 ) ? 1 : 0 ); 00301 } 00302 00303 inline int JOT__isNet( JObjectType_t jot ) 00304 { 00305 register long v = *((long*)(&jot.net)); 00306 return (( v != 0 ) ? 1 : 0 ); 00307 } 00308 00309 inline int JOT__isSystem( JObjectType_t jot ) 00310 { 00311 register long v = *((long*)(&jot.system)); 00312 return (( v != 0 ) ? 1 : 0 ); 00313 } 00314 00315 inline int JOT__isSecurity( JObjectType_t jot ) 00316 { 00317 register long v = *((long*)(&jot.security)); 00318 return (( v != 0 ) ? 1 : 0 ); 00319 } 00320 00321 inline int JOT__isThread( JObjectType_t jot ) 00322 { 00323 register long v = *((long*)(&jot.thread)); 00324 return (( v != 0 ) ? 1 : 0 ); 00325 } 00326 00327 00328 #endif // End of JObjectTypes.hpp