@@ -146,51 +146,51 @@ namespace SCIRun
146146 // clone the current object
147147 // i.e create a new databuffer and copy the actual data
148148 // the normal assignment operator only copies the pointer
149- matfiledata clone ();
149+ matfiledata clone () const ;
150150
151151 // get/set type information
152152 // setting type information using type()
153153 // will not result in casting the data
154154 // contained in the databuffer
155155
156- void type (mitype type);
157- mitype type ();
156+ void setType (mitype type);
157+ mitype type () const ;
158158
159159 // get size information.
160- int size (); // size in elements
161- int bytesize (); // size in bytes
162- int elsize (); // size of the elements in the array
163- int elsize (mitype type); // element size of a type
160+ int size () const ; // size in elements
161+ int bytesize () const ; // size in bytes
162+ int elsize () const ; // size of the elements in the array
163+ int elsize (mitype type) const ; // element size of a type
164164
165165 // Direct access to data
166- void getdata (void *dataptr,int bytesize);
167- void putdata (void *dataptr,int bytesize,mitype type);
166+ void getdata (void *dataptr,int bytesize) const ;
167+ void putdata (const void *dataptr,int bytesize,mitype type);
168168
169169 // copying and casting templates
170170
171171 // copy and cast the data in a user defined memory space
172172 // dataptr and size specify the data block and the number of elements
173173 // that can be stored in this data block.
174- template <class T > void getandcast (T *dataptr,int size);
175- template <class T > void getandcast (T **dataptr,int dim1, int dim2);
176- template <class T > void getandcast (T ***dataptr,int dim1, int dim2, int dim3);
177- template <class T > void putandcast (T *dataptr,int size,mitype type);
178- template <class T > void putandcast (T **dataptr,int dim1, int dim2, mitype type);
179- template <class T > void putandcast (T ***dataptr,int dim1, int dim2, int dim3, mitype type);
174+ template <class T > void getandcast (T *dataptr,int size) const ;
175+ template <class T > void getandcast (T **dataptr,int dim1, int dim2) const ;
176+ template <class T > void getandcast (T ***dataptr,int dim1, int dim2, int dim3) const ;
177+ template <class T > void putandcast (const T *dataptr,int size,mitype type);
178+ template <class T > void putandcast (const T **dataptr,int dim1, int dim2, mitype type);
179+ template <class T > void putandcast (const T ***dataptr,int dim1, int dim2, int dim3, mitype type);
180180
181181
182182 // For smaller arrays use the STL and put the data in a vector. These
183183 // vectors are copied and hence are less efficient. However using STL
184184 // there is no need to do memory management
185185
186- template <class T > void getandcastvector (std::vector<T> &vec);
186+ template <class T > void getandcastvector (std::vector<T> &vec) const ;
187187 template <class T > void putandcastvector (const std::vector<T> &vec,mitype type);
188188
189189 template <class ITERATOR > void putandcast (ITERATOR is,ITERATOR ie,mitype type);
190190
191191
192192 // Access functions per element.
193- template <class T > T getandcastvalue (int index);
193+ template <class T > T getandcastvalue (int index) const ;
194194 template <class T > void putandcastvalue (T value,int index);
195195
196196 // string functions
@@ -231,7 +231,7 @@ namespace SCIRun
231231 // //////////////////////////////////////
232232
233233
234- template <class T > void matfiledata::getandcast (T *dataptr,int dsize)
234+ template <class T > void matfiledata::getandcast (T *dataptr,int dsize) const
235235 {
236236 // This function copies and casts the data in the matfilebuffer into
237237 // a new buffer specified by dataptr (address of this new buffer) with
@@ -291,7 +291,7 @@ namespace SCIRun
291291 }
292292
293293
294- template <class T > void matfiledata::getandcast (T **dataptr,int dim1, int dim2)
294+ template <class T > void matfiledata::getandcast (T **dataptr,int dim1, int dim2) const
295295 {
296296 // This function copies and casts the data in the matfilebuffer into
297297 // a new buffer specified by dataptr (address of this new buffer) with
@@ -366,7 +366,7 @@ namespace SCIRun
366366 }
367367
368368
369- template <class T > void matfiledata::getandcast (T ***dataptr,int dim1, int dim2, int dim3)
369+ template <class T > void matfiledata::getandcast (T ***dataptr,int dim1, int dim2, int dim3) const
370370 {
371371 // This function copies and casts the data in the matfilebuffer into
372372 // a new buffer specified by dataptr (address of this new buffer) with
@@ -444,7 +444,7 @@ namespace SCIRun
444444 }
445445
446446
447- template <class T > void matfiledata::getandcastvector (std::vector<T> &vec)
447+ template <class T > void matfiledata::getandcastvector (std::vector<T> &vec) const
448448 {
449449
450450 // This function copies and casts the data into a vector container
@@ -503,7 +503,7 @@ namespace SCIRun
503503 }
504504
505505
506- template <class T > T matfiledata::getandcastvalue (int index)
506+ template <class T > T matfiledata::getandcastvalue (int index) const
507507 {
508508 // direct access to the data
509509
@@ -554,7 +554,7 @@ namespace SCIRun
554554 // functions inserting data
555555
556556
557- template <class T > void matfiledata::putandcast (T *dataptr,int dsize,mitype dtype)
557+ template <class T > void matfiledata::putandcast (const T *dataptr,int dsize,mitype dtype)
558558 {
559559 // This function copies and casts the data in the matfilebuffer into
560560 // a new buffer specified by dataptr (address of this new buffer) with
@@ -613,7 +613,7 @@ namespace SCIRun
613613 }
614614
615615
616- template <class T > void matfiledata::putandcast (T **dataptr,int dim1, int dim2 ,mitype dtype)
616+ template <class T > void matfiledata::putandcast (const T **dataptr,int dim1, int dim2 ,mitype dtype)
617617 {
618618 // This function copies and casts the data in the matfilebuffer into
619619 // a new buffer specified by dataptr (address of this new buffer) with
@@ -681,7 +681,7 @@ namespace SCIRun
681681 }
682682 }
683683
684- template <class T > void matfiledata::putandcast (T ***dataptr,int dim1, int dim2, int dim3 ,mitype dtype)
684+ template <class T > void matfiledata::putandcast (const T ***dataptr,int dim1, int dim2, int dim3 ,mitype dtype)
685685 {
686686 // This function copies and casts the data in the matfilebuffer into
687687 // a new buffer specified by dataptr (address of this new buffer) with
0 commit comments