IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 13, 2004, 12:47:52 PM (22 years ago)
Author:
desonia
Message:

Major refactoring of the Vector alloc/free functions.

File:
1 edited

Legend:

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

    r663 r670  
    1919 *  @author Ross Harman, MHPCC
    2020 *   
    21  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-05-13 19:54:26 $
     21 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2004-05-13 22:47:52 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6060    PS_TYPE_COMPLEX_FLOAT = 0x84,     ///< Complex numbers consisting of single-precision floating point.
    6161    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;
     62    PS_TYPE_PTR = 0x00,               ///< Something else that's not supported for arithmetic.}
    6363} psElemType;
    6464
     
    118118        double *d;                      ///< Pointers to double precision data.
    119119        complex float *cf;              ///< Pointers to complex floating point data.
     120        void *v;                        ///< Pointers to generic void data
    120121        void **vp;                      ///< Void pointer vector.
    121122    }vec;                               ///< Union for data types.
     
    135136 */
    136137psVector *psVectorAlloc(
    137     psElemType dataType,    ///< Type of data to be held by vector.
    138     int nalloc              ///< Total number of elements to make available.
     138    psElemType dataType,                ///< Type of data to be held by vector.
     139    unsigned int nalloc                 ///< Total number of elements to make available.
    139140);
    140141
     
    164165);
    165166
    166 /** Allocate a void pointer vector.
     167
     168/** Deallocate/Dereference elements of a void pointer vector.
    167169 *
    168  * Uses psLib memory allocation functions to create a vector of void pointers as defined by the psVoidPtrVector
    169  * struct.
    170  *
    171  * @return psVector*: Pointer to psVector.
    172  *
    173  */
    174 psVector *psVoidPtrVectorAlloc(
    175     unsigned int nalloc                 ///< Number of elements to use.
    176 );
    177 
    178 /** Reallocate a void pointer vector.
    179  *
    180  * Uses psLib memory allocation functions to reallocate a vector of void pointers as defined by the
    181  * psVoidPtrVector struct. If the vector size is increased or decreased, this function does not allocate or
    182  * deallocate the contents of individual vector elements. The user must do this after calling this function.
    183  *
    184  * @return psVector*: Pointer to psVector.
    185  *
    186  */
    187 psVector *psVoidPtrVectorRealloc(
    188     psVector *restrict psVec,           ///< Void pointer vector to destroy.
    189     unsigned int nalloc                 ///< Number of elements.
    190 );
    191 
    192 /** Deallocate a void pointer vector.
    193  *
    194  * Uses psLib memory allocation functions to deallocate a vector of void pointers as defined by the
    195  * psVoidPtrVector struct. This function does not free the vector elements unless the user provides a callback
    196  * function. NULL may be passed as an alternative to supplying a callback, but the user must remember to
    197  * delete the vector elements afterwards. The user must not delete or deallocate the vector elements prior to
    198  * calling this function, as it requires valid elements for memory reference decrementation operations.
    199  *
    200  * @return: void
     170 * Uses psLib memory allocation functions to deallocate/dereference elements of a vector of void pointers.
     171 * This function does not free the vector elements unless the user provides a elemFree function
     172 * pointer. If the elemFree function pointer is NULL, the reference cound of the elements are decremented
     173 * without being freed.  The vector psVec is not freed, and its elements will all be set to NULL.
    201174 *
    202175 */
Note: See TracChangeset for help on using the changeset viewer.