OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
FileFieldDataSource.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 FILE_FIELD_DATA_SOURCE_H
12 #define FILE_FIELD_DATA_SOURCE_H
13 
14 /***********************************************************************
15  *
16  * class FileFieldDataSource
17  *
18  * FileFieldDataSource is a specific version of DataSourceObject which takes
19  * the data for a given Field and writes it to a file using a DiscField
20  * object.
21  *
22  ***********************************************************************/
23 
24 // include files
26 #include "Field/Field.h"
27 #include "Utility/DiscField.h"
28 
29 
30 template<class T, unsigned Dim, class M, class C>
32 
33 public:
34 
35  // constructor: the name, the connection, the transfer method,
36  // the field to connect, and the parent node.
37  FileFieldDataSource(const char *, DataConnect *, int, Field<T,Dim,M,C>&);
38 
39  // destructor
40  virtual ~FileFieldDataSource();
41 
42  //
43  // virtual function interface.
44  //
45 
46  // Update the object, that is, make sure the receiver of the data has a
47  // current and consistent snapshot of the current state. Return success.
48  virtual bool update();
49 
50  // Indicate to the receiver that we're allowing them time to manipulate the
51  // data (e.g., for a viz program, to rotate it, change representation, etc.)
52  // This should only return when the manipulation is done.
53  virtual void interact(const char * = 0);
54 
55 private:
56  // the DiscField object, which read/writes the data
58 
59  // the Field to read into (or write from)
61 
62  // which field are we in the file?
63  int FieldID;
64 
65  // the number of frames we have read or written (i.e. or current record)
66  int counter;
67 };
68 
70 
71 #endif // FILE_FIELD_DATA_SOURCE_H
72 
73 /***************************************************************************
74  * $RCSfile: FileFieldDataSource.h,v $ $Author: adelmann $
75  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $
76  * IPPL_VERSION_ID: $Id: FileFieldDataSource.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $
77  ***************************************************************************/
Field< T, Dim, M, C > & myField
DiscField< Dim > * DF
FileFieldDataSource(const char *, DataConnect *, int, Field< T, Dim, M, C > &)
virtual void interact(const char *=0)