/[escript]/trunk/escript/src/DataC.cpp
ViewVC logotype

Diff of /trunk/escript/src/DataC.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2770 by jfenwick, Wed Nov 25 01:24:51 2009 UTC
# Line 138  int isEmpty(escriptDataC* data) Line 138  int isEmpty(escriptDataC* data)
138  // whether gcc would try to interpret __const as a function attribute rather than  // whether gcc would try to interpret __const as a function attribute rather than
139  // a modifier on the return value. Putting it here should remove any ambiguity  // a modifier on the return value. Putting it here should remove any ambiguity
140  // I have used const rather than __const in the cpp because only c++ will be reading the cpp.  // I have used const rather than __const in the cpp because only c++ will be reading the cpp.
141  double const* getSampleDataRO(struct escriptDataC* data, int sampleNo, void* buffer)  double const* getSampleDataRO(struct escriptDataC* data, int sampleNo)
142  {  {
143    if (data == (struct escriptDataC*)0) {    if (data == (struct escriptDataC*)0) {
144         return NULL;         return NULL;
# Line 147  double const* getSampleDataRO(struct esc Line 147  double const* getSampleDataRO(struct esc
147       if (temp->isEmpty()) {       if (temp->isEmpty()) {
148          return NULL;          return NULL;
149       } else {       } else {
150          return temp->getSampleDataRO(sampleNo,reinterpret_cast<escript::BufferGroup*>(buffer));          return temp->getSampleDataRO(sampleNo);
151       }       }
152    }    }
153  }  }
# Line 166  double* getSampleDataRW(struct escriptDa Line 166  double* getSampleDataRW(struct escriptDa
166    }    }
167  }  }
168    
169  const double* getSampleDataROFast(struct escriptDataC* data, int sampleNo, void* buffer)  const double* getSampleDataROFast(struct escriptDataC* data, int sampleNo)
170  {  {
171    escript::Data* temp=(escript::Data*)(data->m_dataPtr);    escript::Data* temp=(escript::Data*)(data->m_dataPtr);
172    return temp->getSampleDataRO(sampleNo, reinterpret_cast<escript::BufferGroup*>(buffer));    return temp->getSampleDataRO(sampleNo);
173  }  }
174    
175  double* getSampleDataRWFast(struct escriptDataC* data, int sampleNo)  double* getSampleDataRWFast(struct escriptDataC* data, int sampleNo)
# Line 190  double* getDataRW(escriptDataC* data) Line 190  double* getDataRW(escriptDataC* data)
190  }  }
191    
192    
 void* allocSampleBuffer(escriptDataC* data)  
 {  
   if (data == (struct escriptDataC*)0) {  
      return NULL;  
   } else {  
      escript::Data* temp=(escript::Data*)(data->m_dataPtr);  
      return temp->allocSampleBuffer();  
   }  
 }  
   
 // Not going to the c++ member for this because I don't need an instance to do this  
 void freeSampleBuffer(void* buffer)  
 {  
   if (buffer!=NULL)  
   {  
     delete (reinterpret_cast<escript::BufferGroup*>(buffer));  
   }  
 }  
   
193  void requireWrite(escriptDataC* data)  void requireWrite(escriptDataC* data)
194  {  {
195    if (data == (struct escriptDataC*)0) {    if (data == (struct escriptDataC*)0) {

Legend:
Removed from v.2548  
changed lines
  Added in v.2770

  ViewVC Help
Powered by ViewVC 1.1.26