00001 // ***************************************************************************** 00002 // oaPackedData.h 00003 // 00004 // This file contains the definitions for the oaBasePackedData and oaPackedData 00005 // class. These classes are used to read and write data in either a packed 00006 // form or as standard data types that require byte-swapping. 00007 // 00008 // ***************************************************************************** 00009 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00010 // Integration Initiative, this material may not be copied, modified, 00011 // re-published, uploaded, executed, or distributed in any way, in any medium, 00012 // in whole or in part, without prior written permission from Cadence. 00013 // 00014 // Copyright 2002-2005 Cadence Design Systems, Inc. 00015 // All Rights Reserved. 00016 // 00017 // $Author: icftcm $ 00018 // $Revision: #1 $ 00019 // $Date: 2010/08/09 $ 00020 // $State: Exp $ 00021 // ***************************************************************************** 00022 // ***************************************************************************** 00023 00024 00025 00026 #if !defined(oaPackedData_P) 00027 #define oaPackedData_P 00028 00029 00030 00031 // ***************************************************************************** 00032 // Nested includes 00033 // ***************************************************************************** 00034 #include "oaPointArray.h" 00035 #include "oaTimeStamp.h" 00036 #include "oaComplex.h" 00037 #include "oaRange.h" 00038 00039 00040 00041 // ***************************************************************************** 00042 // Declare and define types in the OpenAccess namespace. 00043 // ***************************************************************************** 00044 BEGIN_OA_NAMESPACE 00045 00046 00047 00048 // ***************************************************************************** 00049 // Forward Public Class Declarations 00050 // ***************************************************************************** 00051 class oaPoint; 00052 class oaBox; 00053 class oaPointArray; 00054 class oaVector; 00055 class oaTimeStamp; 00056 class oaUInt8Rang; 00057 class oaInternalNameRef; 00058 class oaNameRef; 00059 class oaStringRef; 00060 class oaStringNameRef; 00061 00062 00063 00064 // ***************************************************************************** 00065 // Constants and Masks 00066 // ***************************************************************************** 00067 #define oavMax_1Byte_4 0x7U 00068 #define oavMax_2Byte_4 0x7ffU 00069 #define oavMax_3Byte_4 0x7ffffU 00070 #define oavMax_4Byte_4 0x7ffffffU 00071 #define oavMax_5Byte_4 0xffffffffU 00072 #define oavMax_1Byte_U4 0xfU 00073 #define oavMax_2Byte_U4 0xfffU 00074 #define oavMax_3Byte_U4 0xfffffU 00075 #define oavMax_4Byte_U4 0xfffffffU 00076 #define oavMax_5Byte_U4 0xffffffffU 00077 00078 #if defined(OA_WINDOWS) 00079 #define oavMax_1Byte_8 0x3UI64 00080 #define oavMax_2Byte_8 0x3ffUI64 00081 #define oavMax_3Byte_8 0x3ffffUI64 00082 #define oavMax_4Byte_8 0x3ffffffUI64 00083 #define oavMax_5Byte_8 0x3ffffffffUI64 00084 #define oavMax_6Byte_8 0x3ffffffffffUI64 00085 #define oavMax_7Byte_8 0x3ffffffffffffUI64 00086 #define oavMax_8Byte_8 0x3ffffffffffffffUI64 00087 #define oavMax_9Byte_8 0xffffffffffffffffUI64 00088 #define oavMax_1Byte_U8 0x7UI64 00089 #define oavMax_2Byte_U8 0x7ffUI64 00090 #define oavMax_3Byte_U8 0x7ffffUI64 00091 #define oavMax_4Byte_U8 0x7ffffffUI64 00092 #define oavMax_5Byte_U8 0x7ffffffffUI64 00093 #define oavMax_6Byte_U8 0x7ffffffffffUI64 00094 #define oavMax_7Byte_U8 0x7ffffffffffffUI64 00095 #define oavMax_8Byte_U8 0x7ffffffffffffffUI64 00096 #define oavMax_9Byte_U8 0xffffffffffffffffUI64 00097 #else 00098 #define oavMax_1Byte_8 0x3ULL 00099 #define oavMax_2Byte_8 0x3ffULL 00100 #define oavMax_3Byte_8 0x3ffffULL 00101 #define oavMax_4Byte_8 0x3ffffffULL 00102 #define oavMax_5Byte_8 0x3ffffffffULL 00103 #define oavMax_6Byte_8 0x3ffffffffffULL 00104 #define oavMax_7Byte_8 0x3ffffffffffffULL 00105 #define oavMax_8Byte_8 0x3ffffffffffffffULL 00106 #define oavMax_9Byte_8 0xffffffffffffffffULL 00107 #define oavMax_1Byte_U8 0x7ULL 00108 #define oavMax_2Byte_U8 0x7ffULL 00109 #define oavMax_3Byte_U8 0x7ffffULL 00110 #define oavMax_4Byte_U8 0x7ffffffULL 00111 #define oavMax_5Byte_U8 0x7ffffffffULL 00112 #define oavMax_6Byte_U8 0x7ffffffffffULL 00113 #define oavMax_7Byte_U8 0x7ffffffffffffULL 00114 #define oavMax_8Byte_U8 0x7ffffffffffffffULL 00115 #define oavMax_9Byte_U8 0xffffffffffffffffULL 00116 #endif 00117 00118 #define oavMaxPackedWidth 9 00119 00120 #define oavCodeMask4 0x1fU 00121 #define oavCodeMaskU4 0x0fU 00122 #define oavCodeMask8 0x3fU 00123 #define oavCodeMaskU8 0x1fU 00124 00125 #define oavGridMask 0x01U 00126 00127 #define oavSizeMask4 0x0eU 00128 #define oavSizeMask8 0x1eU 00129 00130 #define oavSignMask4 0x10U 00131 #define oavSignMask8 0x20U 00132 00133 #define oav_1Byte 0x00U 00134 #define oav_2Byte 0x02U 00135 #define oav_3Byte 0x04U 00136 #define oav_4Byte 0x06U 00137 #define oav_5Byte 0x08U 00138 #define oav_6Byte 0x0aU 00139 #define oav_7Byte 0x0cU 00140 #define oav_8Byte 0x0eU 00141 #define oav_9Byte 0x10U 00142 00143 #define oav_1Byte_N_Pos 0x00U 00144 #define oav_1Byte_G_Pos 0x01U 00145 #define oav_2Byte_N_Pos 0x02U 00146 #define oav_2Byte_G_Pos 0x03U 00147 #define oav_3Byte_N_Pos 0x04U 00148 #define oav_3Byte_G_Pos 0x05U 00149 #define oav_4Byte_N_Pos 0x06U 00150 #define oav_4Byte_G_Pos 0x07U 00151 #define oav_5Byte_N_Pos 0x08U 00152 #define oav_5Byte_G_Pos 0x09U 00153 #define oav_6Byte_N_Pos 0x0aU 00154 #define oav_6Byte_G_Pos 0x0bU 00155 #define oav_7Byte_N_Pos 0x0cU 00156 #define oav_7Byte_G_Pos 0x0dU 00157 #define oav_8Byte_N_Pos 0x0eU 00158 #define oav_8Byte_G_Pos 0x0fU 00159 #define oav_9Byte_N_Pos 0x10U 00160 #define oav_9Byte_G_Pos 0x11U 00161 #define oav_1Byte_N_Neg_4 0x10U 00162 #define oav_1Byte_G_Neg_4 0x11U 00163 #define oav_2Byte_N_Neg_4 0x12U 00164 #define oav_2Byte_G_Neg_4 0x13U 00165 #define oav_3Byte_N_Neg_4 0x14U 00166 #define oav_3Byte_G_Neg_4 0x15U 00167 #define oav_4Byte_N_Neg_4 0x16U 00168 #define oav_4Byte_G_Neg_4 0x17U 00169 #define oav_5Byte_N_Neg_4 0x18U 00170 #define oav_5Byte_G_Neg_4 0x19U 00171 #define oav_1Byte_N_Neg_8 0x20U 00172 #define oav_1Byte_G_Neg_8 0x21U 00173 #define oav_2Byte_N_Neg_8 0x22U 00174 #define oav_2Byte_G_Neg_8 0x23U 00175 #define oav_3Byte_N_Neg_8 0x24U 00176 #define oav_3Byte_G_Neg_8 0x25U 00177 #define oav_4Byte_N_Neg_8 0x26U 00178 #define oav_4Byte_G_Neg_8 0x27U 00179 #define oav_5Byte_N_Neg_8 0x28U 00180 #define oav_5Byte_G_Neg_8 0x29U 00181 #define oav_6Byte_N_Neg_8 0x2aU 00182 #define oav_6Byte_G_Neg_8 0x2bU 00183 #define oav_7Byte_N_Neg_8 0x2cU 00184 #define oav_7Byte_G_Neg_8 0x2dU 00185 #define oav_8Byte_N_Neg_8 0x2eU 00186 #define oav_8Byte_G_Neg_8 0x2fU 00187 #define oav_9Byte_N_Neg_8 0x30U 00188 #define oav_9Byte_G_Neg_8 0x31U 00189 00190 #define oavDefaultGrid 100 00191 00192 00193 00194 // ***************************************************************************** 00195 // oaBasePackedData 00196 // ***************************************************************************** 00197 class OA_BASE_DLL_API oaBasePackedData { 00198 public: 00199 oaBasePackedData(oaUInt4 gridIn = oavDefaultGrid); 00200 00201 oaUInt4 &grid(); 00202 oaUInt4 grid() const; 00203 00204 size_t calcDiskSize() const; 00205 00206 protected: 00207 oaUInt4 writePackedInt4(oaByte *data, 00208 oaInt4 val) const; 00209 oaUInt4 writePackedInt8(oaByte *data, 00210 oaInt8 val) const; 00211 oaUInt4 writePackedUInt4(oaByte *data, 00212 oaUInt4 val) const; 00213 oaUInt4 writePackedUInt8(oaByte *data, 00214 oaUInt8 val) const; 00215 oaUInt4 writePackedFloat(oaByte *data, 00216 oaFloat val) const; 00217 oaUInt4 writePackedDouble(oaByte *data, 00218 oaDouble val) const; 00219 oaUInt4 writePackedTime(oaByte *data, 00220 oaTime val) const; 00221 oaUInt4 writePackedPoint(oaByte *data, 00222 const oaPoint &point) const; 00223 oaUInt4 writePackedBox(oaByte *data, 00224 const oaBox &box) const; 00225 oaUInt4 writePackedPointArray(oaByte *data, 00226 const oaPointArray &points, 00227 oaBoolean isOrtho, 00228 oaBoolean isVFst) const; 00229 00230 oaUInt4 writeRef(oaByte *data, 00231 const oaInternalNameRef &ref) const; 00232 oaUInt4 writeRef(oaByte *data, 00233 const oaNameRef &ref) const; 00234 oaUInt4 writeRef(oaByte *data, 00235 const oaStringRef &ref) const; 00236 oaUInt4 writeRef(oaByte *data, 00237 const oaStringNameRef &ref) const; 00238 oaUInt4 writePackedRef(oaByte *data, 00239 const oaInternalNameRef &ref) const; 00240 oaUInt4 writePackedRef(oaByte *data, 00241 const oaNameRef &ref) const; 00242 oaUInt4 writePackedRef(oaByte *data, 00243 const oaStringRef &ref) const; 00244 oaUInt4 writePackedRef(oaByte *data, 00245 const oaStringNameRef &ref) const; 00246 00247 oaUInt4 readPackedInt4(const oaByte *data, 00248 oaInt4 &val) const; 00249 oaUInt4 readPackedInt8(const oaByte *data, 00250 oaInt8 &val) const; 00251 oaUInt4 readPackedUInt4(const oaByte *data, 00252 oaUInt4 &val) const; 00253 oaUInt4 readPackedUInt8(const oaByte *data, 00254 oaUInt8 &val) const; 00255 oaUInt4 readPackedFloat(const oaByte *data, 00256 oaFloat &val) const; 00257 oaUInt4 readPackedDouble(const oaByte *data, 00258 oaDouble &val) const; 00259 oaUInt4 readPackedTime(const oaByte *data, 00260 oaTime &val) const; 00261 oaUInt4 readPackedPoint(const oaByte *data, 00262 oaPoint &point) const; 00263 oaUInt4 readPackedBox(const oaByte *data, 00264 oaBox &box) const; 00265 oaUInt4 readPackedPointArray(const oaByte *data, 00266 oaPointArray &points, 00267 oaUInt4 numPoints, 00268 oaBoolean isOrthogonal, 00269 oaBoolean isVertFirst) const; 00270 oaUInt4 readRef(oaBoolean swapVal, 00271 const oaByte *data, 00272 oaInternalNameRef &ref) const; 00273 oaUInt4 readRef(oaBoolean swapVal, 00274 const oaByte *data, 00275 oaNameRef &ref) const; 00276 oaUInt4 readRef(oaBoolean swapVal, 00277 const oaByte *data, 00278 oaStringRef &ref) const; 00279 oaUInt4 readRef(oaBoolean swapVal, 00280 const oaByte *data, 00281 oaStringNameRef &ref) const; 00282 oaUInt4 readPackedRef(const oaByte *data, 00283 oaInternalNameRef &box) const; 00284 oaUInt4 readPackedRef(const oaByte *data, 00285 oaNameRef &ref) const; 00286 oaUInt4 readPackedRef(const oaByte *data, 00287 oaStringRef &ref) const; 00288 oaUInt4 readPackedRef(const oaByte *data, 00289 oaStringNameRef &ref) const; 00290 00291 oaUInt4 getPackedInt4Size(const oaByte *data) const; 00292 oaUInt4 getPackedInt8Size(const oaByte *data) const; 00293 oaUInt4 getPackedFloatSize(const oaByte *data) const; 00294 oaUInt4 getPackedDoubleSize(const oaByte *data) const; 00295 oaUInt4 getPackedTimeSize(const oaByte *data) const; 00296 oaUInt4 getPackedPointSize(const oaByte *data) const; 00297 oaUInt4 getPackedBoxSize(const oaByte *data) const; 00298 oaUInt4 getPackedPointArraySize(const oaByte *data, 00299 oaUInt4 numPoints, 00300 oaBoolean isOrtho) const; 00301 00302 oaUInt4 gridVal; 00303 00304 friend class oaPackedTbl; 00305 }; 00306 00307 00308 00309 // ***************************************************************************** 00310 // oaPackedData 00311 // ***************************************************************************** 00312 class OA_BASE_DLL_API oaPackedData : public oaBasePackedData { 00313 public: 00314 oaPackedData(); 00315 oaPackedData(oaByte *dataIn, 00316 oaUInt4 sizeIn); 00317 oaPackedData(oaByte *dataIn, 00318 oaUInt4 sizeIn, 00319 oaUInt4 gridIn, 00320 oaBoolean swapIn); 00321 00322 oaByte *&data(); 00323 oaUInt4 &size(); 00324 oaBoolean &swap(); 00325 00326 oaByte *data() const; 00327 oaUInt4 size() const; 00328 oaBoolean swap() const; 00329 00330 void writeByte(oaUInt4 &loc, 00331 oaByte val) const; 00332 void writeBytes(oaUInt4 &loc, 00333 oaUInt4 numObjects, 00334 const oaByte *val) const; 00335 void writeInt2(oaUInt4 &loc, 00336 oaInt2 val) const; 00337 void writeInt4(oaUInt4 &loc, 00338 oaInt4 val) const; 00339 void writeInt8(oaUInt4 &loc, 00340 oaInt8 val) const; 00341 void writeUInt2(oaUInt4 &loc, 00342 oaUInt2 val) const; 00343 void writeUInt4(oaUInt4 &loc, 00344 oaUInt4 val) const; 00345 void writeUInt8(oaUInt4 &loc, 00346 oaUInt8 val) const; 00347 void writeFloat(oaUInt4 &loc, 00348 oaFloat val) const; 00349 void writeDouble(oaUInt4 &loc, 00350 oaDouble val) const; 00351 void writeTime(oaUInt4 &loc, 00352 oaTime val) const; 00353 void writeString(oaUInt4 &loc, 00354 const oaString &val) const; 00355 void writePoint(oaUInt4 &loc, 00356 const oaPoint &val) const; 00357 void writeBox(oaUInt4 &loc, 00358 const oaBox &val) const; 00359 void writeUnalignedUInt4(oaUInt4 &loc, 00360 oaUInt4 val) const; 00361 void writeRef(oaUInt4 &loc, 00362 const oaInternalNameRef &ref) const; 00363 void writeRef(oaUInt4 &loc, 00364 const oaNameRef &ref) const; 00365 void writeRef(oaUInt4 &loc, 00366 const oaStringRef &ref) const; 00367 void writeRef(oaUInt4 &loc, 00368 const oaStringNameRef &ref) const; 00369 00370 void writeByteArray(oaUInt4 &loc, 00371 oaUInt4 numObjects, 00372 const oaByte *val) const; 00373 void writeInt2Array(oaUInt4 &loc, 00374 oaUInt4 numObjects, 00375 const oaInt2 *val) const; 00376 void writeInt4Array(oaUInt4 &loc, 00377 oaUInt4 numObjects, 00378 const oaInt4 *val) const; 00379 void writeInt8Array(oaUInt4 &loc, 00380 oaUInt4 numObjects, 00381 const oaInt8 *val) const; 00382 void writeUInt2Array(oaUInt4 &loc, 00383 oaUInt4 numObjects, 00384 const oaUInt2 *val) const; 00385 void writeUInt4Array(oaUInt4 &loc, 00386 oaUInt4 numObjects, 00387 const oaUInt4 *val) const; 00388 void writeUInt8Array(oaUInt4 &loc, 00389 oaUInt4 numObjects, 00390 const oaUInt8 *val) const; 00391 void writeFloatArray(oaUInt4 &loc, 00392 oaUInt4 numObjects, 00393 const oaFloat *val) const; 00394 void writeDoubleArray(oaUInt4 &loc, 00395 oaUInt4 numObjects, 00396 const oaDouble *val) const; 00397 void writePointArray(oaUInt4 &loc, 00398 oaUInt4 numObjects, 00399 const oaPoint *val) const; 00400 void writeBoxArray(oaUInt4 &loc, 00401 oaUInt4 numObjects, 00402 const oaBox *val) const; 00403 00404 void readByte(oaUInt4 &loc, 00405 oaByte &val) const; 00406 void readBytes(oaUInt4 &loc, 00407 oaUInt4 numObjects, 00408 oaByte *val) const; 00409 void readInt2(oaUInt4 &loc, 00410 oaInt2 &val) const; 00411 void readInt4(oaUInt4 &loc, 00412 oaInt4 &val) const; 00413 void readInt8(oaUInt4 &loc, 00414 oaInt8 &val) const; 00415 void readUInt2(oaUInt4 &loc, 00416 oaUInt2 &val) const; 00417 void readUInt4(oaUInt4 &loc, 00418 oaUInt4 &val) const; 00419 void readUInt8(oaUInt4 &loc, 00420 oaUInt8 &val) const; 00421 void readFloat(oaUInt4 &loc, 00422 oaFloat &val) const; 00423 void readDouble(oaUInt4 &loc, 00424 oaDouble &val) const; 00425 void readTime(oaUInt4 &loc, 00426 oaTime &val) const; 00427 void readString(oaUInt4 &loc, 00428 oaString &val) const; 00429 void readPoint(oaUInt4 &loc, 00430 oaPoint &val) const; 00431 void readBox(oaUInt4 &loc, 00432 oaBox &val) const; 00433 void readUnalignedUInt4(oaUInt4 &loc, 00434 oaUInt4 &val) const; 00435 void readRef(oaUInt4 &loc, 00436 oaInternalNameRef &ref) const; 00437 void readRef(oaUInt4 &loc, 00438 oaNameRef &ref) const; 00439 void readRef(oaUInt4 &loc, 00440 oaStringRef &ref) const; 00441 void readRef(oaUInt4 &loc, 00442 oaStringNameRef &ref) const; 00443 00444 void readByteArray(oaUInt4 &loc, 00445 oaUInt4 numObjects, 00446 oaByte *val) const; 00447 void readInt2Array(oaUInt4 &loc, 00448 oaUInt4 numObjects, 00449 oaInt2 *val) const; 00450 void readInt4Array(oaUInt4 &loc, 00451 oaUInt4 numObjects, 00452 oaInt4 *val) const; 00453 void readInt8Array(oaUInt4 &loc, 00454 oaUInt4 numObjects, 00455 oaInt8 *val) const; 00456 void readUInt2Array(oaUInt4 &loc, 00457 oaUInt4 numObjects, 00458 oaUInt2 *val) const; 00459 void readUInt4Array(oaUInt4 &loc, 00460 oaUInt4 numObjects, 00461 oaUInt4 *val) const; 00462 void readUInt8Array(oaUInt4 &loc, 00463 oaUInt4 numObjects, 00464 oaUInt8 *val) const; 00465 void readFloatArray(oaUInt4 &loc, 00466 oaUInt4 numObjects, 00467 oaFloat *val) const; 00468 void readDoubleArray(oaUInt4 &loc, 00469 oaUInt4 numObjects, 00470 oaDouble *val) const; 00471 void readPointArray(oaUInt4 &loc, 00472 oaUInt4 numObjects, 00473 oaPoint *val) const; 00474 void readBoxArray(oaUInt4 &loc, 00475 oaUInt4 numObjects, 00476 oaBox *val) const; 00477 00478 void writePackedInt4(oaUInt4 &loc, 00479 oaInt4 val) const; 00480 void writePackedInt8(oaUInt4 &loc, 00481 oaInt8 val) const; 00482 void writePackedUInt4(oaUInt4 &loc, 00483 oaUInt4 val) const; 00484 void writePackedUInt8(oaUInt4 &loc, 00485 oaUInt8 val) const; 00486 void writePackedFloat(oaUInt4 &loc, 00487 oaFloat val) const; 00488 void writePackedDouble(oaUInt4 &loc, 00489 oaDouble val) const; 00490 void writePackedTime(oaUInt4 &loc, 00491 oaTime val) const; 00492 void writePackedPoint(oaUInt4 &loc, 00493 const oaPoint &point) const; 00494 void writePackedBox(oaUInt4 &loc, 00495 const oaBox &box) const; 00496 void writePackedPointArray(oaUInt4 &loc, 00497 const oaPointArray &points, 00498 oaBoolean isOrtho, 00499 oaBoolean isVFst) const; 00500 void writePackedRef(oaUInt4 &loc, 00501 const oaInternalNameRef &ref) const; 00502 void writePackedRef(oaUInt4 &loc, 00503 const oaNameRef &ref) const; 00504 void writePackedRef(oaUInt4 &loc, 00505 const oaStringRef &ref) const; 00506 void writePackedRef(oaUInt4 &loc, 00507 const oaStringNameRef &ref) const; 00508 00509 void readPackedInt4(oaUInt4 &loc, 00510 oaInt4 &val) const; 00511 void readPackedInt8(oaUInt4 &loc, 00512 oaInt8 &val) const; 00513 void readPackedUInt4(oaUInt4 &loc, 00514 oaUInt4 &val) const; 00515 void readPackedUInt8(oaUInt4 &loc, 00516 oaUInt8 &val) const; 00517 void readPackedFloat(oaUInt4 &loc, 00518 oaFloat &val) const; 00519 void readPackedDouble(oaUInt4 &loc, 00520 oaDouble &val) const; 00521 void readPackedTime(oaUInt4 &loc, 00522 oaTime &val) const; 00523 void readPackedPoint(oaUInt4 &loc, 00524 oaPoint &point) const; 00525 void readPackedBox(oaUInt4 &loc, 00526 oaBox &box) const; 00527 void readPackedPointArray(oaUInt4 &loc, 00528 oaPointArray &points, 00529 oaUInt4 numPoints, 00530 oaBoolean isOrthogonal, 00531 oaBoolean isVertFirst) const; 00532 void readPackedRef(oaUInt4 &loc, 00533 oaInternalNameRef &ref) const; 00534 void readPackedRef(oaUInt4 &loc, 00535 oaNameRef &ref) const; 00536 void readPackedRef(oaUInt4 &loc, 00537 oaStringRef &ref) const; 00538 void readPackedRef(oaUInt4 &loc, 00539 oaStringNameRef &ref) const; 00540 00541 oaUInt4 getPackedInt4Size(oaUInt4 loc) const; 00542 oaUInt4 getPackedInt8Size(oaUInt4 loc) const; 00543 oaUInt4 getPackedFloatSize(oaUInt4 loc) const; 00544 oaUInt4 getPackedDoubleSize(oaUInt4 loc) const; 00545 oaUInt4 getPackedTimeSize(oaUInt4 loc) const; 00546 oaUInt4 getPackedPointSize(oaUInt4 loc) const; 00547 oaUInt4 getPackedBoxSize(oaUInt4 loc) const; 00548 oaUInt4 getPackedPointArraySize(oaUInt4 loc, 00549 oaUInt4 numPoints, 00550 oaBoolean isOrtho) const; 00551 00552 private: 00553 oaByte *dataP; 00554 oaUInt4 sizeVal; 00555 oaBoolean swapVal; 00556 }; 00557 00558 00559 00560 // ***************************************************************************** 00561 // oaSwap() 00562 // 00563 // The specializations of this template function perform byte-swapping on 00564 // objects of type T. The default implementation does not actually swap. 00565 // ***************************************************************************** 00566 template <class T> 00567 inline void 00568 oaSwap(T &out, 00569 const oaByte *bytesIn); 00570 00571 template <> 00572 inline void 00573 oaSwap(oaInt2 &out, 00574 const oaByte *bytesIn); 00575 00576 template <> 00577 inline void 00578 oaSwap(oaUInt2 &out, 00579 const oaByte *bytesIn); 00580 00581 template <> 00582 inline void 00583 oaSwap(oaInt4 &out, 00584 const oaByte *bytesIn); 00585 00586 template <> 00587 inline void 00588 oaSwap(oaUInt4 &out, 00589 const oaByte *bytesIn); 00590 00591 template <> 00592 inline void 00593 oaSwap(oaInt8 &out, 00594 const oaByte *bytesIn); 00595 00596 template <> 00597 inline void 00598 oaSwap(oaUInt8 &out, 00599 const oaByte *bytesIn); 00600 00601 template <> 00602 inline void 00603 oaSwap(oaFloat &out, 00604 const oaByte *bytesIn); 00605 00606 template <> 00607 inline void 00608 oaSwap(oaDouble &out, 00609 const oaByte *bytesIn); 00610 00611 template <> 00612 inline void 00613 oaSwap(oaComplex<oaFloat> &out, 00614 const oaByte *bytesIn); 00615 00616 template <> 00617 inline void 00618 oaSwap(oaVector &out, 00619 const oaByte *bytesIn); 00620 00621 template <> 00622 inline void 00623 oaSwap(oaPoint &out, 00624 const oaByte *bytesIn); 00625 00626 template <> 00627 inline void 00628 oaSwap(oaBox &out, 00629 const oaByte *bytesIn); 00630 00631 template <> 00632 inline void 00633 oaSwap(oaTimeStamp &out, 00634 const oaByte *bytesIn); 00635 00636 template <> 00637 inline void 00638 oaSwap(oaIntRange &out, 00639 const oaByte *bytesIn); 00640 00641 template <> 00642 inline void 00643 oaSwap(oaUInt8Range &out, 00644 const oaByte *bytesIn); 00645 00646 00647 00648 END_OA_NAMESPACE 00649 00650 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.