Changeset 1967 in Sophya for trunk/SophyaLib/NTools/cimage.cc


Ignore:
Timestamp:
Apr 26, 2002, 6:48:22 PM (23 years ago)
Author:
ansari
Message:

Ajout throw TypeMismatchExc ds PPersist_X::SetDataObj() ds les differents classes handler PPersist, a place du return simple, lorsque le type d'objet n'etait pas bon ... Reza 26/4/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/cimage.cc

    r1390 r1967  
    88#include "pexceptions.h"
    99#include "cimage.h"
     10#include "datatype.h"
     11#include <typeinfo>
    1012
    1113/*!
     
    115117{
    116118  Image<T> * po = dynamic_cast< Image<T> * >(&o);
    117   if (po == NULL) return;
     119  if (po == NULL) {
     120    char buff[160];
     121    sprintf(buff,"FIO_Image<%s>::SetDataObj(%s) - Object type  error ! ",
     122            DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
     123    throw TypeMismatchExc(PExcLongMessage(buff));       
     124  }
    118125  if (ownobj && dobj) delete dobj;
    119126  dobj = po; ownobj = false;
Note: See TracChangeset for help on using the changeset viewer.