IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2007, 3:09:20 PM (19 years ago)
Author:
eugene
Message:

updating all changes from from eam_branch_20071023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModelClass.c

    r14938 r15562  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-21 00:09:05 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-11-10 01:09:20 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757static void ModelClassFree (pmModelClass *modelClass)
    5858{
    59 
    6059    if (modelClass == NULL)
    6160        return;
     
    7069}
    7170
     71bool psMemCheckModelClass(psPtr ptr)
     72{
     73    PS_ASSERT_PTR(ptr, false);
     74    return ( psMemGetDeallocator(ptr) == (psFreeFunc) ModelClassFree);
     75}
     76
    7277void pmModelClassAdd (pmModelClass *model)
    7378{
    7479    if (models == NULL) {
    75         pmModelClassInit ();
     80        pmModelClassInit();
    7681    }
    7782
     
    8590{
    8691    // if we do not need to init, return false;
    87     if (models != NULL)
     92    if (models != NULL) {
    8893        return false;
     94    }
    8995
    9096    int Nnew = sizeof (defaultModels) / sizeof (pmModelClass);
     
    100106pmModelClass *pmModelClassSelect (pmModelType type)
    101107{
     108    if (models == NULL) {
     109        pmModelClassInit();
     110    }
     111
    102112    if ((type < 0) || (type >= Nmodels)) {
    103113        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
     
    111121    psFree (models);
    112122    models = NULL;
     123    Nmodels = 0;
    113124    return;
    114125}
     
    116127psS32 pmModelClassParameterCount (pmModelType type)
    117128{
     129    if (models == NULL) {
     130        pmModelClassInit();
     131    }
     132
    118133    if ((type < 0) || (type >= Nmodels)) {
    119134        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
     
    125140psS32 pmModelClassGetType (char *name)
    126141{
     142    if (models == NULL) {
     143        pmModelClassInit();
     144    }
     145
    127146    for (int i = 0; i < Nmodels; i++) {
    128147        if (!strcmp(models[i].name, name)) {
     
    135154char *pmModelClassGetName (pmModelType type)
    136155{
     156    if (models == NULL) {
     157        pmModelClassInit();
     158    }
     159
    137160    if ((type < 0) || (type >= Nmodels)) {
    138161        psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
Note: See TracChangeset for help on using the changeset viewer.