Changeset 17305


Ignore:
Timestamp:
10/22/13 11:03:54 (11 years ago)
Author:
lyard
Message:
Moved catalog reconstruction only when a row is read so that headers can be retrieved quickly in all cases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zfits.h

    r17282 r17305  
    2020    // Basic constructor
    2121    zfits(const std::string& fname, const std::string& tableName="", bool force=false)
    22         : fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
     22        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
    2323    {
    2424        open(fname.c_str());
    2525        Constructor(fname, "", tableName, force);
    26         InitCompressionReading();
     26//        InitCompressionReading();
    2727    }
    2828
    2929    // Alternative contstructor
    3030    zfits(const std::string& fname, const std::string& fout, const std::string& tableName, bool force=false)
    31         : fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
     31        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
    3232    {
    3333        open(fname.c_str());
    3434        Constructor(fname, fout, tableName, force);
    35         InitCompressionReading();
     35//        InitCompressionReading();
    3636    }
    3737
     
    9494    void InitCompressionReading()
    9595    {
     96        fCatalogInitialized = true;
     97
    9698        if (!fTable.is_compressed)
    9799            return;
     
    143145        memcpy(dest, src, c.num*c.size);
    144146    }
     147
     148    bool  fCatalogInitialized;
    145149
    146150    std::vector<char> fBuffer;           ///<store the uncompressed rows
     
    278282            return false;
    279283
     284        if (!fCatalogInitialized)
     285            InitCompressionReading();
     286
    280287        const uint32_t requestedTile = rowNum/fNumRowsPerTile;
    281288        const uint32_t currentTile   = fCurrentRow/fNumRowsPerTile;
Note: See TracChangeset for help on using the changeset viewer.