Changeset 1967 in Sophya for trunk/SophyaLib/SkyMap


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

Location:
trunk/SophyaLib/SkyMap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyMap/fiolocalmap.cc

    r1624 r1967  
    44#include "pexceptions.h"
    55#include "fiondblock.h"
     6#include "datatype.h"
     7#include <typeinfo>
    68
    79//*******************************************************************
     
    7274{
    7375  LocalMap<T> * po = dynamic_cast< LocalMap<T> * >(&o);
    74   if (po == NULL) return;
     76  if (po == NULL) {
     77    char buff[160];
     78    sprintf(buff,"FIO_LocalMap<%s>::SetDataObj(%s) - Object type  error ! ",
     79            DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
     80    throw TypeMismatchExc(PExcLongMessage(buff));   
     81  }
    7582  if (ownobj && dobj) delete dobj;
    7683  dobj = po; ownobj = false;
  • trunk/SophyaLib/SkyMap/fiospherethetaphi.cc

    r1624 r1967  
    44#include "pexceptions.h"
    55#include "fiondblock.h"
     6#include "datatype.h"
     7#include <typeinfo>
    68
    79///////////////////////////////////////////////////////////
     
    5759{
    5860  SphereThetaPhi<T> * po = dynamic_cast< SphereThetaPhi<T> * >(&o);
    59   if (po == NULL) return;
     61  if (po == NULL) {
     62    char buff[160];
     63    sprintf(buff,"FIO_SphereThetaPhi<%s>::SetDataObj(%s) - Object type  error ! ",
     64            DataTypeInfo<T>::getTypeName().c_str(), typeid(o).name());
     65    throw TypeMismatchExc(PExcLongMessage(buff));   
     66  }
     67
    6068  if (ownobj && dobj) delete dobj;
    6169  dobj = po; ownobj = false;
  • trunk/SophyaLib/SkyMap/spherepos.cc

    r764 r1967  
    22
    33#include "spherepos.h"
     4#include "datatype.h"
     5#include <typeinfo>
    46
    5 static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.1.1.1 2000-03-02 17:05:39 ansari Exp $";
     7static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/SkyMap/spherepos.cc,v 1.2 2002-04-26 16:48:22 ansari Exp $";
    68
    79
     
    7274{
    7375  SphereCoordSys * po = dynamic_cast<SphereCoordSys *>(&o);
    74   if (po == NULL) return;
     76  if (po == NULL) {
     77    char buff[160];
     78    sprintf(buff,"FIO_SphereCoordSys::SetDataObj(%s) - Object type  error ! ",
     79            typeid(o).name());
     80    throw TypeMismatchExc(PExcLongMessage(buff));   
     81  }
     82
    7583  if (ownobj && dobj) delete dobj; 
    7684  dobj = po; ownobj = false;
Note: See TracChangeset for help on using the changeset viewer.