PtclAttribDataSource.cpp 2.06 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
// -*- C++ -*-
/***************************************************************************
 *
 * The IPPL Framework
 * 
 * This program was prepared by PSI. 
 * All rights in the program are reserved by PSI.
 * Neither PSI nor the author(s)
 * makes any warranty, express or implied, or assumes any liability or
 * responsibility for the use of this software
 *
 * Visit www.amas.web.psi for more details
 *
 ***************************************************************************/

// -*- C++ -*-
/***************************************************************************
 *
 * The IPPL Framework
 * 
 *
 * Visit http://people.web.psi.ch/adelmann/ for more details
 *
 ***************************************************************************/

// include files
#include "DataSource/PtclAttribDataSource.h"
#include "DataSource/PtclBaseDataSource.h"

///////////////////////////////////////////////////////////////////////////
// constructor: the name, the connection, the transfer method, the attrib
ParticleAttribDataSource::ParticleAttribDataSource(const char *nm,
        DataConnect *dc, int tm, ParticleAttribBase *pa, DataSource *ds)
  : DataSourceObject(nm, ds, dc, tm) {

  // find a particlebase object which contains this attribute; if none
  // found, it is an error
38
  PBase = IpplParticleBaseDataSource::find_particle_base(this, pa);
gsell's avatar
gsell committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

  // if we did find it ...
  if (PBase != 0) {
    // change our name to include the particle base's name
    std::string newname = PBase->name();
    newname += ":";
    newname += name();
    setName(newname.c_str());
  }
}


///////////////////////////////////////////////////////////////////////////
// destructor
ParticleAttribDataSource::~ParticleAttribDataSource() { }



/***************************************************************************
 * $RCSfile: PtclAttribDataSource.cpp,v $   $Author: adelmann $
 * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:25 $
 * IPPL_VERSION_ID: $Id: PtclAttribDataSource.cpp,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $ 
 ***************************************************************************/