@@ -319,7 +319,7 @@ class DataArray : public IDataArray
319319 * @param allocate Will all the memory be allocated at time of construction
320320 * @return
321321 */
322- IDataArray::Pointer createNewArray (size_t numTuples, int rank, const size_t * compDims, const QString& name, bool allocate) override
322+ IDataArray::Pointer createNewArray (size_t numTuples, int rank, const size_t * compDims, const QString& name, bool allocate) const override
323323 {
324324 IDataArray::Pointer p = DataArray<T>::CreateArray (numTuples, rank, compDims, name, allocate);
325325 return p;
@@ -333,7 +333,7 @@ class DataArray : public IDataArray
333333 * @param allocate Will all the memory be allocated at time of construction
334334 * @return Std::Shared_Ptr wrapping an instance of DataArrayTemplate<T>
335335 */
336- IDataArray::Pointer createNewArray (size_t numTuples, const comp_dims_type& compDims, const QString& name, bool allocate) override
336+ IDataArray::Pointer createNewArray (size_t numTuples, const comp_dims_type& compDims, const QString& name, bool allocate) const override
337337 {
338338 IDataArray::Pointer p = DataArray<T>::CreateArray (numTuples, compDims, name, allocate);
339339 return p;
@@ -427,7 +427,7 @@ class DataArray : public IDataArray
427427 * @param forceNoAllocate
428428 * @return
429429 */
430- IDataArray::Pointer deepCopy (bool forceNoAllocate = false ) override
430+ IDataArray::Pointer deepCopy (bool forceNoAllocate = false ) const override
431431 {
432432 bool allocate = m_IsAllocated;
433433 if (forceNoAllocate)
@@ -451,7 +451,7 @@ class DataArray : public IDataArray
451451 * @return
452452 */
453453
454- SIMPL::NumericTypes::Type getType ()
454+ SIMPL::NumericTypes::Type getType () const
455455 {
456456 T value = static_cast <T>(0x00 );
457457 if (typeid (value) == typeid (int8_t ))
@@ -512,7 +512,7 @@ class DataArray : public IDataArray
512512 * can be a primitive like char, float, int or the name of a class.
513513 * @return
514514 */
515- void getXdmfTypeAndSize (QString& xdmfTypeName, int & precision) override
515+ void getXdmfTypeAndSize (QString& xdmfTypeName, int & precision) const override
516516 {
517517 T value = static_cast <T>(0x00 );
518518 xdmfTypeName = " UNKNOWN" ;
@@ -650,7 +650,7 @@ class DataArray : public IDataArray
650650 * @brief copyIntoArray
651651 * @param dest
652652 */
653- bool copyIntoArray (Pointer dest)
653+ bool copyIntoArray (Pointer dest) const
654654 {
655655 if (m_IsAllocated && dest->isAllocated () && m_Array && dest->getPointer (0 ))
656656 {
@@ -665,7 +665,7 @@ class DataArray : public IDataArray
665665 * @brief isAllocated
666666 * @return
667667 */
668- bool isAllocated () override
668+ bool isAllocated () const override
669669 {
670670 return m_IsAllocated;
671671 }
@@ -903,23 +903,23 @@ class DataArray : public IDataArray
903903 * 4 = 32 bit integer/Float
904904 * 8 = 64 bit integer/Double
905905 */
906- size_t getTypeSize () override
906+ size_t getTypeSize () const override
907907 {
908908 return sizeof (T);
909909 }
910910
911911 /* *
912912 * @brief Returns the number of elements in the internal array.
913913 */
914- size_t getNumberOfTuples () override
914+ size_t getNumberOfTuples () const override
915915 {
916916 return m_NumTuples;
917917 }
918918
919919 /* *
920920 * @brief Returns the total number of elements that make up this array. Equal to NumTuples * NumComponents
921921 */
922- size_t getSize () override
922+ size_t getSize () const override
923923 {
924924 return m_Size;
925925 }
@@ -929,7 +929,7 @@ class DataArray : public IDataArray
929929 * at each tuple then this will return a single element QVector. If you have a 1x3 array (like EUler Angles) then
930930 * this will return a 3 Element QVector.
931931 */
932- comp_dims_type getComponentDimensions () override
932+ comp_dims_type getComponentDimensions () const override
933933 {
934934 return m_CompDims;
935935 }
@@ -939,7 +939,7 @@ class DataArray : public IDataArray
939939 * 3 element component (vector) then this will be 3. If you are storing a small image of size 80x60
940940 * at each Tuple (like EBSD Kikuchi patterns) then the result would be 4800.
941941 */
942- int getNumberOfComponents () override
942+ int getNumberOfComponents () const override
943943 {
944944 return m_NumComponents;
945945 }
@@ -965,7 +965,7 @@ class DataArray : public IDataArray
965965 * @brief Returns a list of the contents of DataArray (For Python Binding)
966966 * @return std::list. Possibly empty
967967 */
968- std::list<T> getArray ()
968+ std::list<T> getArray () const
969969 {
970970 return std::list<T>(m_Array, m_Array + (m_Size * sizeof (T)) / sizeof (T));
971971 }
@@ -994,7 +994,7 @@ class DataArray : public IDataArray
994994 * @param i The index to return the pointer to.
995995 * @return The pointer to the index
996996 */
997- virtual T* getPointer (size_t i)
997+ virtual T* getPointer (size_t i) const
998998 {
999999#ifndef NDEBUG
10001000 if (m_Size > 0 )
@@ -1010,7 +1010,7 @@ class DataArray : public IDataArray
10101010 * @param i The index to return the value at
10111011 * @return The value at index i
10121012 */
1013- virtual T getValue (size_t i)
1013+ virtual T getValue (size_t i) const
10141014 {
10151015#ifndef NDEBUG
10161016 if (m_Size > 0 )
@@ -1039,7 +1039,7 @@ class DataArray : public IDataArray
10391039
10401040 // ----------------------------------------------------------------------------
10411041 // These can be overridden for more efficiency
1042- T getComponent (size_t i, int j)
1042+ T getComponent (size_t i, int j) const
10431043 {
10441044#ifndef NDEBUG
10451045 if (m_Size > 0 )
@@ -1131,7 +1131,7 @@ class DataArray : public IDataArray
11311131 * @brief getTuplePointer Returns the pointer to a specific tuple
11321132 * @param tupleIndex The index of tuple
11331133 */
1134- T* getTuplePointer (size_t tupleIndex)
1134+ T* getTuplePointer (size_t tupleIndex) const
11351135 {
11361136#ifndef NDEBUG
11371137 if (m_Size > 0 )
@@ -1162,7 +1162,7 @@ class DataArray : public IDataArray
11621162 * @param i
11631163 * @param delimiter
11641164 */
1165- void printTuple (QTextStream& out, size_t i, char delimiter = ' ,' ) override
1165+ void printTuple (QTextStream& out, size_t i, char delimiter = ' ,' ) const override
11661166 {
11671167 int precision = out.realNumberPrecision ();
11681168 T value = static_cast <T>(0x00 );
@@ -1192,7 +1192,7 @@ class DataArray : public IDataArray
11921192 * @param i
11931193 * @param j
11941194 */
1195- void printComponent (QTextStream& out, size_t i, int j) override
1195+ void printComponent (QTextStream& out, size_t i, int j) const override
11961196 {
11971197 out << m_Array[i * m_NumComponents + j];
11981198 }
@@ -1203,7 +1203,7 @@ class DataArray : public IDataArray
12031203 * from
12041204 * @return The HDF5 native type for the value
12051205 */
1206- QString getFullNameOfClass ()
1206+ QString getFullNameOfClass () const
12071207 {
12081208 QString theType = getTypeAsString ();
12091209 theType = " DataArray<" + theType + " >" ;
@@ -1214,7 +1214,7 @@ class DataArray : public IDataArray
12141214 * @brief getTypeAsString
12151215 * @return
12161216 */
1217- QString getTypeAsString () override
1217+ QString getTypeAsString () const override
12181218 {
12191219 T value = static_cast <T>(0 );
12201220 if (typeid (value) == typeid (float ))
@@ -1369,7 +1369,7 @@ class DataArray : public IDataArray
13691369 * @param parentId
13701370 * @return
13711371 */
1372- int writeH5Data (hid_t parentId, comp_dims_type tDims) override
1372+ int writeH5Data (hid_t parentId, comp_dims_type tDims) const override
13731373 {
13741374 if (m_Array == nullptr )
13751375 {
@@ -1384,7 +1384,7 @@ class DataArray : public IDataArray
13841384 * @param volDims
13851385 * @return
13861386 */
1387- int writeXdmfAttribute (QTextStream& out, int64_t * volDims, const QString& hdfFileName, const QString& groupPath, const QString& label) override
1387+ int writeXdmfAttribute (QTextStream& out, int64_t * volDims, const QString& hdfFileName, const QString& groupPath, const QString& label) const override
13881388 {
13891389 if (m_Array == nullptr )
13901390 {
@@ -1443,7 +1443,7 @@ class DataArray : public IDataArray
14431443 * @return Returns a formatted string that contains general infomation about
14441444 * the instance of the object.
14451445 */
1446- QString getInfoString (SIMPL::InfoStringFormat format) override
1446+ QString getInfoString (SIMPL::InfoStringFormat format) const override
14471447 {
14481448
14491449 QLocale usa (QLocale::English, QLocale::UnitedStates);
0 commit comments