oaBaseTypes.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaBaseTypes.h
00004 //
00005 // This file contains definitions for basic types used throughout OpenAccess.
00006 //
00007 // *****************************************************************************
00008 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00009 // Integration Initiative, this material may not be copied, modified,
00010 // re-published, uploaded, executed, or distributed in any way, in any medium,
00011 // in whole or in part, without prior written permission from Cadence.
00012 //
00013 //                Copyright 2002-2010 Cadence Design Systems, Inc.
00014 //                           All Rights Reserved.
00015 //
00016 //  $Author: icftcm $
00017 //  $Revision: #6 $
00018 //  $Date: 2010/10/18 $
00019 //  $State: $
00020 // *****************************************************************************
00021 // *****************************************************************************
00022 
00023 
00024 
00025 #if !defined(oaBaseTypes_P)
00026 #define oaBaseTypes_P
00027 
00028 
00029 
00030 // *****************************************************************************
00031 // Nested includes
00032 // *****************************************************************************
00033 #include "oaCommonTypes.h"
00034 
00035 
00036 
00037 // *****************************************************************************
00038 // Platform macros
00039 // *****************************************************************************
00040 #if defined(_MSC_VER)
00041 #define OA_WINDOWS
00042 #endif
00043 
00044 
00045 
00046 // *****************************************************************************
00047 // Required System Header Files
00048 // *****************************************************************************
00049 #include <math.h>
00050 #include <limits.h>
00051 
00052 
00053 
00054 // *****************************************************************************
00055 // API Revision Numbers for Product and this Development Stream
00056 // 
00057 // Note! These numbers need to be updated accordingly whenever there's an API 
00058 // change in product or in this development stream. When it happens, be sure to 
00059 // update the static map of Stream-BuildNames defined in oaSoftwareInfo class.
00060 // *****************************************************************************
00061 #define oacProdStreamAPIRevNumber       201
00062 
00063 
00064 
00065 // *****************************************************************************
00066 // Other const definitions related with API Major and Minor revisions. 
00067 // Note: branch stream number represents the x550 stream
00068 // *****************************************************************************
00069 #define oacProdStreamRevNumber      oacProdStreamAPIRevNumber
00070 
00071 #define oacStreamRevNumberOffset    1000
00072 #define oacBranchStreamNumberOffset 100
00073 
00074 #define oacAPIMajorRevNumber        4
00075 #define oacAPIMinorRevNumber        oacProdStreamRevNumber
00076 
00077 
00078 
00079 // *****************************************************************************
00080 // DataModel Version Numbers
00081 // *****************************************************************************
00082 #define oacDataModelRevNumber           4
00083 
00084 
00085 
00086 // *****************************************************************************
00087 // Constants
00088 // *****************************************************************************
00089 #define oacNullIndex            0xffffffffu
00090 #define oacDeletedIndex         0xfffffffeu
00091 #define oacNegativeOne          oaUInt4(-1)
00092 
00093 #if defined(OA_WINDOWS)
00094 #define oacNullLongIndex        0xffffffffffffffffui64
00095 #define oacDeletedLongIndex     0xfffffffffffffffeui64
00096 #else
00097 #define oacNullLongIndex        0xffffffffffffffffULL
00098 #define oacDeletedLongIndex     0xfffffffffffffffeULL
00099 #endif
00100 
00101 #if defined(OA_WINDOWS)
00102 #define oacMaxPathLen           _MAX_PATH
00103 #define oacPathSeparator        "\\"
00104 #define oacPathSeparatorChar    '\\'
00105 #else
00106 #define oacMaxPathLen           PATH_MAX
00107 #define oacPathSeparator        "/"
00108 #define oacPathSeparatorChar    '/'
00109 #endif
00110 
00111 #if !defined(M_PI)
00112 #define M_PI        3.14159265358979323846264338
00113 #endif
00114 #if !defined(M_PI_2)
00115 #define M_PI_2      1.57079632679489661923132169
00116 #endif
00117 #if !defined(M_PI_4)
00118 #define M_PI_4      0.78539816339744830961566085
00119 #endif
00120 #if !defined(M_PI_8)
00121 #define M_PI_8      0.39269908169872415480783042
00122 #endif
00123 
00124 #if !defined(OA_DEPRECATED)
00125 #define oacObserverRevision         1
00126 #endif
00127 
00128 
00129 
00130 // *****************************************************************************
00131 // Windows DLL export macros
00132 // *****************************************************************************
00133 #if defined(OA_WINDOWS) && defined(OA_BASE_DLL_EXPORTS)
00134 #define OA_BASE_DLL_API __declspec(dllexport)
00135 #define OA_BASE_DLL_PVT __declspec(dllexport)
00136 #define OA_BASE_DLL_EXTERN
00137 #elif defined(OA_WINDOWS) && !defined(OA_STATIC)
00138 #define OA_BASE_DLL_API __declspec(dllimport)
00139 #define OA_BASE_DLL_PVT __declspec(dllimport)
00140 #define OA_BASE_DLL_EXTERN extern
00141 #else
00142 #define OA_BASE_DLL_API
00143 #define OA_BASE_DLL_PVT
00144 #endif
00145 
00146 #if defined(OA_WINDOWS) && !defined(OA_STATIC)
00147 #define OA_DLL_EXPORT __declspec(dllexport)
00148 #else
00149 #define OA_DLL_EXPORT
00150 #endif
00151 
00152 
00153 
00154 // *****************************************************************************
00155 // Declare and define types in OpenAccess namespace.
00156 // *****************************************************************************
00157 BEGIN_OA_NAMESPACE
00158 
00159 
00160 
00161 // *****************************************************************************
00162 // oaCoord
00163 //
00164 // A geometric coordinate expressed in the fundamental database units.
00165 // *****************************************************************************
00166 typedef oaInt4 oaCoord;
00167 
00168 
00169 
00170 // *****************************************************************************
00171 // oaDist
00172 //
00173 // The non-negative distance, along one axis, between two oaCoord values.  This
00174 // cannot safely be used for full Cartesian distances due to overflow problems
00175 // on the most extreme diagonals.
00176 // *****************************************************************************
00177 typedef oaUInt4 oaDist;
00178 
00179 
00180 
00181 // *****************************************************************************
00182 // oaOffset
00183 //
00184 // The signed difference between two oaCoord values.  This cannot safely be used
00185 // to hold the difference of any two oaCoord values due to overflow issues.  It
00186 // is mainly intended, as the name implies, for offset values that are to be
00187 // added to existing oaCoord values.
00188 // *****************************************************************************
00189 typedef oaInt4 oaOffset;
00190 
00191 
00192 
00193 // *****************************************************************************
00194 // oaSocketD
00195 //
00196 // The unsigned value represent a socket descriptor.  The socket descriptor is
00197 // usually obtained by calling system socket functions.
00198 // *****************************************************************************
00199 typedef oaUInt4 oaSocketD;
00200 
00201 
00202 
00203 // *****************************************************************************
00204 // oaBaseDataTypeEnum
00205 //
00206 // The first two entries are special dataTypes that are used for the database
00207 // itself and for all oaAppObjects in the database. The next five entries are
00208 // reserved and are common to all databases.
00209 //
00210 // Note: The number of dataTypes should not include the special dataTypes.
00211 // *****************************************************************************
00212 #define oavBaseNumDataTypes             22
00213 #define oavBaseAppObjectDataTypeName    "appObject"
00214 
00215 enum oaBaseDataTypeEnum {
00216     oacBaseDatabaseDataType                 = UINT_MAX,
00217     oacBaseAppObjectDataType                = UINT_MAX - 1,
00218     oacBasePropDataType                     = 0,
00219     oacBaseGroupDataType                    = 1,
00220     oacBaseGroupMemDataType                 = 2,
00221     oacBaseAvatarDataType                   = 3,
00222     oacBaseValueDataType                    = 4,
00223     oacBaseConstraintParamDefDataType       = 5,
00224     oacBaseConstraintParamDataType          = 6,
00225     oacBaseConstraintDefDataType            = 7,
00226     oacBaseConstraintDataType               = 8,
00227     oacBaseConstraintGroupDataType          = 9,
00228     oacBaseConstraintGroupMemDataType       = 10,
00229     oacBaseConstraintGroupHeaderDataType    = 11,
00230 
00231     oacBaseFeatureDataType                  = 12,
00232     oacBaseFeaturePolicyDataType            = 13,
00233 
00234     oacBaseDerivedLayerParamDefDataType     = 14,
00235     oacBaseDerivedLayerDefDataType          = 15,
00236 
00237     oacBaseGroupDefDataType                 = 16,
00238     oacBaseConstraintGroupDefDataType       = 17,
00239 
00240     oacBaseViaVariantDataType               = 18,
00241     oacBaseParamDataType                    = 19,
00242     oacBaseViaVariantHeaderDataType         = 20,
00243     oacBaseViaParamDataType                 = 21
00244 };
00245 
00246 
00247 
00248 // *****************************************************************************
00249 // oaUndoModelEnum
00250 //
00251 // This is the enum used to specify which one of the undo model this user is
00252 // following: 
00253 // 1. checkpoint is placed after operations -- post-checkpoint model
00254 // 2. checkpoint is placed before operations -- pre-checkpoint model 
00255 // *****************************************************************************
00256 enum oaUndoModelEnum {
00257     oacUndoModelNotSpecified    = UINT_MAX,
00258     oacUndoModelPostCheckpoint  = 0,
00259     oacUndoModelPreCheckpoint   = 1
00260 };
00261 
00262 
00263 
00264 // *****************************************************************************
00265 // oaThreadUseModelEnum
00266 //
00267 // This is the enum used to specify if the OpenAccess session is in single 
00268 // thread or multiple thread use model.
00269 // *****************************************************************************
00270 enum oaThreadUseModelEnum {
00271     oacSingleThreadUseModel             = 0,
00272     oacMultipleReadersThreadUseModel    = 1,
00273     oacMultipleWritersThreadUseModel    = 2
00274 };
00275 
00276 #define oavNumThreadUseModelTypes    3
00277 
00278 
00279 
00280 // *****************************************************************************
00281 // Forward Public Class Declarations for Classes from Other Packages
00282 // *****************************************************************************
00283 class oaDerivedLayerDef;
00284 class oaDerivedLayerParamDef;
00285 
00286 
00287 
00288 // *****************************************************************************
00289 // Global Function Declarations and definitions
00290 // *****************************************************************************
00291 OA_BASE_DLL_API extern
00292 void oaBaseInit(oaUInt4 apiMajorRev = oacAPIMajorRevNumber,
00293                 oaUInt4 apiMinorRev = oacAPIMinorRevNumber);
00294 
00295 OA_BASE_DLL_API extern
00296 void oaBaseInit(oaUInt4 apiMajorRev,
00297                 oaUInt4 apiMinorRev,
00298                 oaUInt4 dataModelRev);
00299 
00300 
00301 
00302 // *****************************************************************************
00303 // oaSleep()
00304 //
00305 // This utility function puts the process to sleep for the specified number of
00306 // seconds.
00307 // *****************************************************************************
00308 extern OA_BASE_DLL_API
00309     void
00310     oaSleep(oaUInt4 sec);
00311 
00312 
00313 
00314 // *****************************************************************************
00315 // oaIsProcessActive()
00316 //
00317 // This utility function checks to see if the process with the process id is
00318 // active on the current machine.
00319 // *****************************************************************************
00320 extern OA_BASE_DLL_API
00321     oaBoolean
00322     oaIsProcessActive(oaUInt4 pid);
00323 
00324 
00325 
00326 // *****************************************************************************
00327 // oaStartDaemon()
00328 //
00329 // This utility function starts the daemon process by the given name.
00330 // *****************************************************************************
00331 extern OA_BASE_DLL_API
00332     void
00333     oaStartDaemon(const char    *name,
00334                   char *const   *argvIn = 0,
00335                   oaUInt4       numArgs = 0);
00336 
00337 
00338 
00339 // *****************************************************************************
00340 // oaCast
00341 //
00342 // oaCast macro serves as a safe downcast (dynamic_cast), while defaulting to 
00343 // the better performing static_cast in other configurations.
00344 // *****************************************************************************
00345 #if defined(OA_CAST) && !(defined(OA_WINDOWS) && defined(_MSC_VER) && (_MSC_VER < 1400))
00346 #define oaCast  dynamic_cast
00347 #else
00348 #define oaCast  static_cast
00349 #endif
00350 
00351 
00352 
00353 END_OA_NAMESPACE
00354 
00355 
00356 
00357 #endif
00358 

Return to top of page