/[escript]/branches/RW_WIN32/escript/src/Data/DataCached.h
ViewVC logotype

Annotation of /branches/RW_WIN32/escript/src/Data/DataCached.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 186 - (hide annotations)
Sun Nov 20 10:51:16 2005 UTC (14 years ago) by robwdcock
File MIME type: text/plain
File size: 4031 byte(s)
PARTIAL WIN32 PORT
+ Paso, ext_math and mmio libraries build using scons in top level directory
+ Scons build system currently hard coded against RW's third-party library paths.
+ Still lots TODO to complete port and build system 
1 jgs 121 /* $Id$ */
2    
3     /*
4     ******************************************************************************
5     * *
6     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
7     * *
8     * This software is the property of ACcESS. No part of this code *
9     * may be copied in any form or by any means without the expressed written *
10     * consent of ACcESS. Copying, use or modification of this software *
11     * by any unauthorised person is illegal unless that person has a software *
12     * license agreement with ACcESS. *
13     * *
14     ******************************************************************************
15     */
16    
17     #if !defined escript_DataCached_20050414_H
18     #define escript_DataCached_20050414_H
19 robwdcock 186 #ifdef MSVC
20     #ifdef ESCRIPT_EXPORTS
21     #define ESCRIPT_DLL __declspec(dllexport)
22     #else
23     #define ESCRIPT_DLL __declspec(dllimport)
24     #endif
25     #else
26     #define ESCRIPT_DLL
27     #endif
28 jgs 121
29     #include "DataAbstract.h"
30    
31     namespace escript {
32    
33     /**
34     \brief
35     Implements the DataAbstract interface for a cached Data object.
36    
37     Description:
38     Implements the DataAbstract interface for a cached Data object.
39     */
40    
41 robwdcock 186 class ESCRIPT_DLL DataCached : public DataAbstract {
42 jgs 121
43     public:
44    
45     /**
46     \brief
47     Default constructor for DataCached.
48    
49     Description:
50     Default constructor for DataCached.
51    
52     */
53     DataCached();
54    
55     /**
56     \brief
57     Destructor for DataCached.
58     */
59     virtual
60     ~DataCached();
61    
62     /**
63     \brief
64     Return a textual representation of the Data object.
65     */
66     virtual
67     std::string
68     toString() const;
69    
70     /**
71     \brief
72     Return the offset into the data array for the data point specified.
73     \param sampleNo - Input - Sample number.
74     \param dataPointNo - Input - data-point number.
75     */
76     virtual
77     DataArrayView::ValueType::size_type
78     getPointOffset(int sampleNo,
79     int dataPointNo) const;
80    
81     /**
82     \brief
83     Return a view into the data array for the data point specified.
84     \param sampleNo - Input - Sample number.
85     \param dataPointNo - Input - data-point number.
86     */
87     virtual
88     DataArrayView
89     getDataPoint(int sampleNo,
90     int dataPointNo);
91    
92     /**
93     \brief
94     Return the number of doubles stored for this object.
95     */
96     virtual
97     ValueType::size_type
98     getLength() const;
99    
100     /**
101     \brief
102     Factory method that returns a newly created DataCached sliced from the
103     current Data object according to the specified region.
104     The caller is reponsible for managing the object created.
105     */
106     virtual
107     DataAbstract*
108     getSlice(const DataArrayView::RegionType& region) const;
109    
110     /**
111     \brief
112     Set the current Data object according to the specified slice from the
113     given input value.
114     \param value Input - Data to copy from
115     \param region Input - Region to copy.
116     */
117     virtual
118     void
119     setSlice(const DataAbstract* value,
120     const DataArrayView::RegionType& region);
121    
122     /**
123     \brief
124     Reshape the data point if the data point is currently rank 0.
125     The original data point value is used for all values of the new
126     data point.
127     */
128     virtual
129     void
130     reshapeDataPoint(const DataArrayView::ShapeType& shape);
131    
132     protected:
133    
134     private:
135    
136     /**
137     \brief
138     Throw a standard exception. This function is called if an attempt
139     is made to use functions of DataCached that are not valid.
140     */
141     void
142     throwStandardException(const std::string& functionName) const;
143    
144     // data members will need to include:
145    
146     // 0. flag to turn caching on, or pass everything through to act like normal Data object (?)
147    
148     // 1. a stack of the operations applied
149    
150     // 2. a coresponding stack of the Data/DataVector objects which are the operands to the operations
151    
152     // 3. a DataVector representing the initial values of this object
153    
154     };
155    
156     } // end of namespace
157    
158     #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26