OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ScalarDataSource.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef SCALAR_DATA_SOURCE_H
12 #define SCALAR_DATA_SOURCE_H
13 
14 /***********************************************************************
15  *
16  * ScalarDataSource is a DataSource for scalars.
17  * It makes a scalar available for another program or data processing
18  * API (e.g., visualization) through the DataSource API.
19  *
20 ***********************************************************************/
21 
22 // include files
23 #include "DataSource/DataSource.h"
24 
25 // forward declarations
26 class DataSourceObject;
27 class DataConnect;
28 
29 // A DataSource class for handling scalars
30 template<class T>
31 class ScalarDataSource : public DataSource {
32 
33 public:
34  // constructor
35  ScalarDataSource(T& S) : MyScalar(S) {};
36 
37  // destructor
38  virtual ~ScalarDataSource() { }
39 
40  // Return ptr to Scalar
41  T& scalarRef() { return MyScalar; }
42 
43 protected:
44  // a virtual function which is called by this base class to get a
45  // specific instance of DataSourceObject based on the type of data
46  // and the connection method (the argument to the call).
48  DataConnect *,
49  int);
50 
51 private:
52  // The scalar
54 };
55 
57 
58 #endif // SCALAR_DATA_SOURCE_H
59 
60 /***************************************************************************
61  * $RCSfile: ScalarDataSource.h,v $ $Author: adelmann $
62  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $
63  * IPPL_VERSION_ID: $Id: ScalarDataSource.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $
64  ***************************************************************************/
DataSourceObject * createDataSourceObject(const char *, DataConnect *, int)
Definition: rbendmap.h:8
virtual ~ScalarDataSource()