/[escript]/trunk/escript/src/DataCached.h
ViewVC logotype

Contents of /trunk/escript/src/DataCached.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 474 - (show annotations)
Mon Jan 30 04:23:44 2006 UTC (13 years, 6 months ago) by jgs
File MIME type: text/plain
File size: 3853 byte(s)
restructure escript source tree
move src/Data/* -> src
remove inc
modify #includes and cpppath settings accordingly

1 /* $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
20 #include "DataAbstract.h"
21
22 namespace escript {
23
24 /**
25 \brief
26 Implements the DataAbstract interface for a cached Data object.
27
28 Description:
29 Implements the DataAbstract interface for a cached Data object.
30 */
31
32 class DataCached : public DataAbstract {
33
34 public:
35
36 /**
37 \brief
38 Default constructor for DataCached.
39
40 Description:
41 Default constructor for DataCached.
42
43 */
44 DataCached();
45
46 /**
47 \brief
48 Destructor for DataCached.
49 */
50 virtual
51 ~DataCached();
52
53 /**
54 \brief
55 Return a textual representation of the Data object.
56 */
57 virtual
58 std::string
59 toString() const;
60
61 /**
62 \brief
63 Return the offset into the data array for the data point specified.
64 \param sampleNo - Input - Sample number.
65 \param dataPointNo - Input - data-point number.
66 */
67 virtual
68 DataArrayView::ValueType::size_type
69 getPointOffset(int sampleNo,
70 int dataPointNo) const;
71
72 /**
73 \brief
74 Return a view into the data array for the data point specified.
75 \param sampleNo - Input - Sample number.
76 \param dataPointNo - Input - data-point number.
77 */
78 virtual
79 DataArrayView
80 getDataPoint(int sampleNo,
81 int dataPointNo);
82
83 /**
84 \brief
85 Return the number of doubles stored for this object.
86 */
87 virtual
88 ValueType::size_type
89 getLength() const;
90
91 /**
92 \brief
93 Factory method that returns a newly created DataCached sliced from the
94 current Data object according to the specified region.
95 The caller is reponsible for managing the object created.
96 */
97 virtual
98 DataAbstract*
99 getSlice(const DataArrayView::RegionType& region) const;
100
101 /**
102 \brief
103 Set the current Data object according to the specified slice from the
104 given input value.
105 \param value Input - Data to copy from
106 \param region Input - Region to copy.
107 */
108 virtual
109 void
110 setSlice(const DataAbstract* value,
111 const DataArrayView::RegionType& region);
112
113 /**
114 \brief
115 Reshape the data point if the data point is currently rank 0.
116 The original data point value is used for all values of the new
117 data point.
118 */
119 virtual
120 void
121 reshapeDataPoint(const DataArrayView::ShapeType& shape);
122
123 protected:
124
125 private:
126
127 /**
128 \brief
129 Throw a standard exception. This function is called if an attempt
130 is made to use functions of DataCached that are not valid.
131 */
132 void
133 throwStandardException(const std::string& functionName) const;
134
135 // data members will need to include:
136
137 // 0. flag to turn caching on, or pass everything through to act like normal Data object (?)
138
139 // 1. a stack of the operations applied
140
141 // 2. a coresponding stack of the Data/DataVector objects which are the operands to the operations
142
143 // 3. a DataVector representing the initial values of this object
144
145 };
146
147 } // end of namespace
148
149 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26