Calculate the buffer size required to read a row of the fits table, as well as the offsets to each column.
Calculates the required buffer size for reading one row of the current table. Also calculates the offsets to all the columns
Definition at line 274 of file fitsloader.cc.
References MessageImp::Error(), fColMap, MessageImp::Message(), size, and str.
Referenced by DoDumpPlease().
280 for (map<string, CCfits::Column*>::iterator it=
fColMap.begin(); it !=
fColMap.end(); it++)
282 int width = it->second->width();
283 switch (it->second->type())
286 case CCfits::Tushort:
289 sizes[it->second->index()] =
sizeof(char)*width;
294 sizes[it->second->index()] =
sizeof(int)*width;
299 sizes[it->second->index()] =
sizeof(int)*width;
301 case CCfits::Tlonglong:
303 sizes[it->second->index()] =
sizeof(
long long)*width;
307 sizes[it->second->index()] =
sizeof(float)*width;
309 case CCfits::Tdouble:
311 sizes[it->second->index()] =
sizeof(double)*width;
315 case CCfits::Tlogical:
316 case CCfits::Tstring:
317 case CCfits::Tcomplex:
318 case CCfits::Tdblcomplex:
321 case CCfits::VTlogical:
322 case CCfits::VTushort:
323 case CCfits::VTshort:
326 case CCfits::VTulong:
328 case CCfits::VTlonglong:
329 case CCfits::VTfloat:
330 case CCfits::VTdouble:
331 case CCfits::VTcomplex:
332 case CCfits::VTdblcomplex:
333 Error(
"Data type not implemented yet.");
334 return vector<int>();
337 Error(
"THIS SHOULD NEVER BE REACHED");
338 return vector<int>();
343 for (map<int,int>::iterator it=sizes.begin(); it != sizes.end(); it++)
345 result.push_back(size);
347 if (it->first != checkIndex)
350 str <<
"Expected index " << checkIndex <<
" found " << it->first;
355 result.push_back(size);
map< string, CCfits::Column * > fColMap
map between the column names and their CCfits objects
int Error(const std::string &str)
int Message(const std::string &str)