escript  Revision_
DataC.h
Go to the documentation of this file.
00001 
00002 /*****************************************************************************
00003 *
00004 * Copyright (c) 2003-2014 by University of Queensland
00005 * http://www.uq.edu.au
00006 *
00007 * Primary Business: Queensland, Australia
00008 * Licensed under the Open Software License version 3.0
00009 * http://www.opensource.org/licenses/osl-3.0.php
00010 *
00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
00012 * Development 2012-2013 by School of Earth Sciences
00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
00014 *
00015 *****************************************************************************/
00016 
00017 
00018 #if !defined  escript_DataC_20040611_H
00019 #define escript_DataC_20040611_H
00020 #include "system_dep.h"
00021 
00030 struct escriptDataC {
00031   void* m_dataPtr;
00032 };
00033 
00034 typedef struct escriptDataC escriptDataC; 
00035 
00041 ESCRIPT_DLL_API int getFunctionSpaceType(escriptDataC* data);
00042 
00050 #define updateFunctionSpaceType(_FS,_DATA) _FS=(isEmpty(_DATA) ? _FS : getFunctionSpaceType(_DATA))
00051                                                                                      
00058 #define functionSpaceTypeEqual(_FS,_DATA) ( (isEmpty(_DATA) || _FS==getFunctionSpaceType(_DATA)) ) ? 1 : 0
00059 
00065 ESCRIPT_DLL_API int isEmpty(escriptDataC* data);
00066 
00074 ESCRIPT_DLL_API int isDataPointShapeEqual(escriptDataC* data, int rank, const int* dimensions);
00084 ESCRIPT_DLL_API int numSamplesEqual(escriptDataC* data, int numDataPointsPerSample,
00085             int numSamples);
00086 
00092 ESCRIPT_DLL_API int getNumDataPointsPerSample(escriptDataC* data);
00093 
00099 ESCRIPT_DLL_API int getDataPointRank(escriptDataC* data);
00100 
00107 ESCRIPT_DLL_API int getDataPointShape(escriptDataC* data,int i);
00108 
00114 ESCRIPT_DLL_API int getDataPointSize(escriptDataC* data);
00115 
00116 /*
00117    \brief
00118    Return the number of doubles stored for the Data object.
00119    Argument data may be NULL, in which case 0 is returnd.
00120    \param data Input - C wrapper for Data.
00121 
00122 This function has been removed because it does not make sense for LazyData
00123 */
00124 /*ESCRIPT_DLL_API int getLength(escriptDataC* data);*/
00125 
00134 ESCRIPT_DLL_API int isExpanded(escriptDataC* data);
00135 
00145 ESCRIPT_DLL_API double __const * getSampleDataRO(escriptDataC* data, int sampleNo);
00146 /* Placement of __const might be important. See .cpp */
00147 
00148 
00149 ESCRIPT_DLL_API double* getSampleDataRW(escriptDataC* data, int sampleNo);
00150 
00151 
00160 ESCRIPT_DLL_API double __const* getSampleDataROFast(escriptDataC* data, int sampleNo);
00161 
00169 ESCRIPT_DLL_API double* getSampleDataRWFast(escriptDataC* data, int sampleNo);
00170 
00171 
00180 ESCRIPT_DLL_API double* getDataRW(escriptDataC* data);
00181 
00182 
00190 ESCRIPT_DLL_API void requireWrite(escriptDataC* data);
00191 
00192 #endif