IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4898 for trunk/psLib/src/types


Ignore:
Timestamp:
Aug 29, 2005, 3:14:13 PM (21 years ago)
Author:
drobbin
Message:

Implemented psMemCheckType functions and tests. Some testing remains unfinished.

Location:
trunk/psLib/src/types
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psArray.c

    r4600 r4898  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-07-22 23:47:13 $
     11 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-08-30 01:14:13 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4545    psFree(psArr->data);
    4646}
     47
     48bool psMemCheckArray(psPtr ptr)
     49{
     50    return ( psMemGetDeallocator(ptr) == (psFreeFunc)arrayFree );
     51}
     52
    4753
    4854/*****************************************************************************
  • trunk/psLib/src/types/psArray.h

    r4600 r4898  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-22 23:47:13 $
     14 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-08-30 01:14:13 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4747/*****************************************************************************/
    4848
     49/** Checks the type of a particular pointer.
     50 *
     51 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     52 *
     53 *  @return bool:       True if the pointer matches a psArray structure, false otherwise.
     54 */
     55bool psMemCheckArray(
     56    psPtr ptr                          ///< the pointer whose type to check
     57)
     58;
     59
     60
    4961/** Allocate an array.
    5062 *
     
    5769psArray* psArrayAlloc(
    5870    long nalloc                        ///< Total number of elements to make available.
    59 )
    60 ;
     71);
    6172
    6273/** Reallocate an array.
  • trunk/psLib/src/types/psBitSet.c

    r4819 r4898  
    1111 *  @author Robert DeSonia, MHPCC
    1212 *
    13  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-08-19 00:31:42 $
     13 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:13 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565    psFree(inBitSet->bits);
    6666}
     67
     68bool psMemCheckBitSet(psPtr ptr)
     69{
     70    return ( psMemGetDeallocator(ptr) == (psFreeFunc)bitSetFree );
     71}
     72
    6773
    6874psBitSet* psBitSetAlloc(long nalloc)
  • trunk/psLib/src/types/psBitSet.h

    r4610 r4898  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-26 00:44:45 $
     14 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-08-30 01:14:13 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4747/*****************************************************************************/
    4848
     49/** Checks the type of a particular pointer.
     50 *
     51 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     52 *
     53 *  @return bool:       True if the pointer matches a psBitSet structure, false otherwise.
     54 */
     55bool psMemCheckBitSet(
     56    psPtr ptr                          ///< the pointer whose type to check
     57)
     58;
     59
     60
    4961/** Allocate a psBitSet.
    5062 *
     
    5668psBitSet* psBitSetAlloc(
    5769    long nalloc                            ///< Number of bits in psBitSet array
    58 )
    59 ;
     70);
    6071
    6172/** Set a bit.
  • trunk/psLib/src/types/psHash.c

    r4556 r4898  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-07-15 02:33:54 $
     14*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-08-30 01:14:13 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    160160}
    161161
     162bool psMemCheckHash(psPtr ptr)
     163{
     164    return ( psMemGetDeallocator(ptr) == (psFreeFunc)hashFree );
     165}
     166
     167
    162168/******************************************************************************
    163169hashFree(table): This procedure deallocates the specified hash
  • trunk/psLib/src/types/psHash.h

    r4556 r4898  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-15 02:33:54 $
     13 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:13 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4646psHash;
    4747
     48/** Checks the type of a particular pointer.
     49 *
     50 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     51 *
     52 *  @return bool:       True if the pointer matches a psHash structure, false otherwise.
     53 */
     54bool psMemCheckHash(
     55    psPtr ptr                          ///< the pointer whose type to check
     56)
     57;
     58
     59
    4860/// Allocate hash buckets in table.
    4961psHash* psHashAlloc(
    5062    long nalloc                        ///< The number of buckets to allocate.
    51 )
    52 ;
     63);
    5364
    5465/// Insert entry into table.
  • trunk/psLib/src/types/psList.c

    r4556 r4898  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-07-15 02:33:54 $
     8 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-08-30 01:14:13 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    148148    return list;
    149149}
     150
     151bool psMemCheckList(psPtr ptr)
     152{
     153    return ( psMemGetDeallocator(ptr) == (psFreeFunc)listFree );
     154}
     155
     156
    150157
    151158psListIterator* psListIteratorAlloc(psList* list, long location, bool mutable)
  • trunk/psLib/src/types/psList.h

    r4590 r4898  
    77 *  @ingroup LinkedList
    88 *
    9  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-21 02:39:57 $
     9 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-30 01:14:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8484
    8585
    86 /** Creates a psList linked list object.
    87  *
    88  *  @return psList* A new psList object.
    89  */
    90 psList* psListAlloc(
    91     psPtr data
    92     ///< initial data item; may be NULL if no an empty psList is desired
     86/** Checks the type of a particular pointer.
     87 *
     88 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     89 *
     90 *  @return bool:       True if the pointer matches a psList structure, false otherwise.
     91 */
     92bool psMemCheckList(
     93    psPtr ptr                          ///< the pointer whose type to check
    9394)
    9495;
     96
     97
     98/** Creates a psList linked list object.
     99 *
     100 *  @return psList* A new psList object.
     101 */
     102psList* psListAlloc(
     103    psPtr data          ///< initial data item; may be NULL if an empty psList is desired
     104);
    95105
    96106/** Creates a psListIterator object and associates it with a psList.
  • trunk/psLib/src/types/psLookupTable.c

    r4589 r4898  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-07-21 01:40:10 $
     9*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-08-30 01:14:13 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    263263/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    264264/*****************************************************************************/
     265
     266bool psMemCheckLookupTable(psPtr ptr)
     267{
     268    return ( psMemGetDeallocator(ptr) == (psFreeFunc)lookupTableFree );
     269}
     270
    265271
    266272psLookupTable* psLookupTableAlloc(const char *filename,
  • trunk/psLib/src/types/psLookupTable.h

    r4589 r4898  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-07-21 01:40:10 $
     9*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-08-30 01:14:13 $
    1111*
    1212*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6060    PS_PARSE_ERROR_GENERAL        = 0x0104         ///< Any other type of lookup error
    6161}psParseErrorType;
     62
     63/** Checks the type of a particular pointer.
     64 *
     65 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     66 *
     67 *  @return bool:       True if the pointer matches a psLookupTable structure, false otherwise.
     68 */
     69bool psMemCheckLookupTable(
     70    psPtr ptr                          ///< the pointer whose type to check
     71);
     72
    6273
    6374/** Allocator for psLookupTable struct
  • trunk/psLib/src/types/psMetadata.c

    r4891 r4898  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-08-27 01:33:41 $
     14*  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-08-30 01:14:13 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    162162    return metadataItem;
    163163}
     164
     165bool psMemCheckMetadataItem(psPtr ptr)
     166{
     167    return ( psMemGetDeallocator(ptr) == (psFreeFunc)metadataItemFree );
     168}
     169
    164170
    165171#define METADATAITEM_ALLOC_TYPE(NAME,TYPE,METATYPE) \
     
    273279    return metadata;
    274280}
     281
     282
     283bool psMemCheckMetadata(psPtr ptr)
     284{
     285    return ( psMemGetDeallocator(ptr) == (psFreeFunc)metadataFree );
     286}
     287
     288
    275289
    276290bool psMetadataAddItem(psMetadata *md,
  • trunk/psLib/src/types/psMetadata.h

    r4891 r4898  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-08-27 01:33:41 $
     13*  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-08-30 01:14:13 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    155155;
    156156
     157
     158/** Checks the type of a particular pointer.
     159 *
     160 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     161 *
     162 *  @return bool:       True if the pointer matches a psMetadataItem structure, false otherwise.
     163 */
     164bool psMemCheckMetadataItem(
     165    psPtr ptr                          ///< the pointer whose type to check
     166);
     167
     168
    157169/** Create a metadata item with specified string data.
    158170 *
     
    253265psMetadata* psMetadataAlloc(void);
    254266
     267
     268/** Checks the type of a particular pointer.
     269 *
     270 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     271 *
     272 *  @return bool:       True if the pointer matches a psMetadata structure, false otherwise.
     273 */
     274bool psMemCheckMetadata(
     275    psPtr ptr                          ///< the pointer whose type to check
     276);
     277
     278
    255279/** Add existing metadata item to metadata collection.
    256280 *
  • trunk/psLib/src/types/psPixels.c

    r4597 r4898  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-22 22:19:27 $
     9 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-30 01:14:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7171    return out;
    7272}
     73
     74
     75bool psMemCheckPixels(psPtr ptr)
     76{
     77    return ( psMemGetDeallocator(ptr) == (psFreeFunc)pixelsFree );
     78}
     79
    7380
    7481psPixels* psPixelsRealloc(psPixels* pixels, long nalloc)
  • trunk/psLib/src/types/psPixels.h

    r4608 r4898  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-25 20:49:04 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-30 01:14:13 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5757)
    5858;
     59
     60/** Checks the type of a particular pointer.
     61 *
     62 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     63 *
     64 *  @return bool:       True if the pointer matches a psPixels structure, false otherwise.
     65 */
     66bool psMemCheckPixels(
     67    psPtr ptr                          ///< the pointer whose type to check
     68);
     69
    5970
    6071/** resizes a psPixels structure
Note: See TracChangeset for help on using the changeset viewer.