IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 13, 2004, 9:54:26 AM (22 years ago)
Author:
desonia
Message:

Added macros for psElemType to accomplish things like sizeof.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psVector.h

    r662 r663  
    1919 *  @author Ross Harman, MHPCC
    2020 *   
    21  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-05-13 19:43:49 $
     21 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2004-05-13 19:54:26 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929
    3030#include <complex.h>
     31#include <stdint.h>
    3132
    3233/******************************************************************************/
     
    4748 */
    4849typedef enum {
    49     PS_TYPE_INT8,                       ///< Character.
    50     PS_TYPE_INT16,                      ///< Short integer.
    51     PS_TYPE_INT32,                      ///< Integer.
    52     PS_TYPE_INT64,                      ///< Long integer.
    53     PS_TYPE_UINT8,                      ///< Unsigned character.
    54     PS_TYPE_UINT16,                     ///< Unsigned short integer.
    55     PS_TYPE_UINT32,                     ///< Unsigned integer.
    56     PS_TYPE_UINT64,                     ///< Unsigned long integer.
    57     PS_TYPE_FLOAT,                      ///< Single-precision Floating point.
    58     PS_TYPE_DOUBLE,                     ///< Double-precision floating point.
    59     PS_TYPE_COMPLEX_FLOAT,              ///< Complex numbers consisting of single-precision floating point.
    60     PS_TYPE_COMPLEX_DOUBLE,             ///< Complex numbers consisting of double-precision floating point.
    61     PS_TYPE_OTHER,                      ///< Something else that's not supported for arithmetic.
     50    PS_TYPE_INT8 = 0x11,              ///< Character.
     51    PS_TYPE_INT16 = 0x12,             ///< Short integer.
     52    PS_TYPE_INT32 = 0x14,             ///< Integer.
     53    PS_TYPE_INT64 = 0x18,             ///< Long integer.
     54    PS_TYPE_UINT8 = 0x31,             ///< Unsigned character.
     55    PS_TYPE_UINT16 = 0x32,            ///< Unsigned short integer.
     56    PS_TYPE_UINT32 = 0x34,            ///< Unsigned integer.
     57    PS_TYPE_UINT64 = 0x38,            ///< Unsigned long integer.
     58    PS_TYPE_FLOAT = 0x44,             ///< Single-precision Floating point.
     59    PS_TYPE_DOUBLE = 0x48,            ///< Double-precision floating point.
     60    PS_TYPE_COMPLEX_FLOAT = 0x84,     ///< Complex numbers consisting of single-precision floating point.
     61    PS_TYPE_COMPLEX_DOUBLE = 0x88,    ///< Complex numbers consisting of double-precision floating point.
     62    PS_TYPE_OTHER,                    ///< Something else that's not supported for arithmetic.} psElemType;
    6263} psElemType;
     64
     65#define IS_PSELEMTYPE_INT(x) (x & 0x10 == 0x10)
     66#define IS_PSELEMTYPE_UNSIGNED(x) (x & 0x20 == 0x20)
     67#define IS_PSELEMTYPE_REAL(x) (x & 0x40 == 0x40)
     68#define IS_PSELEMTYPE_COMPLEX(x) (x & 0x80 == 0x80)
     69#define PSELEMTYPE_SIZEOF(x) (x & 0x0F)
    6370
    6471/** Dimensions of a data type.
     
    7784/** The type of a data type.
    7885 *
    79  * All psLib complex types consist of primitive components. This struct provides the description of those 
     86 * All psLib complex types consist of primitive components. This struct provides the description of those
    8087 * primitives.
    8188 *
Note: See TracChangeset for help on using the changeset viewer.