Changeset 17228 for trunk/Mars


Ignore:
Timestamp:
10/16/13 20:51:19 (11 years ago)
Author:
tbretz
Message:
Adapted to changes in Queue; Compression queues do not need sorting... first-in-first-out is always correct
File:
1 edited

Legend:

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

    r17225 r17228  
    2525class zofits : public ofits
    2626{
    27     public:
     27        template<class S>
     28        struct QueueMin : std::list<S>
     29        {
     30            typename std::list<S>::iterator begin()
     31            {
     32                return min_element(std::list<S>::begin(), std::list<S>::end());
     33            }
     34        };
    2835
    2936        struct WriteTarget
     
    3340                return tile_num < other.tile_num;
    3441            }
     42
    3543            uint32_t tile_num;
    3644            uint32_t size;
     
    4048        struct CompressionTarget
    4149        {
     50            /*
    4251            bool operator < (const CompressionTarget& other)
    4352            {
    4453                return target < other.target;
    45             }
     54            }*/
     55
    4656            shared_ptr<MemoryChunk> src;
    4757            shared_ptr<MemoryChunk> transposed_src;
     
    5060        };
    5161
    52 
     62public:
    5363        //constructors
    5464        zofits(uint32_t numTiles=1000,
     
    5666               uint64_t maxUsableMem=0) : ofits(),
    5767                                          fMemPool(0, maxUsableMem),
    58                                           fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), true, false)
     68                                          fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false)
    5969        {
    6070            InitMemberVariables(numTiles, rowPerTile, maxUsableMem);
     
    6777               uint64_t maxUsableMem=0) : ofits(fname),
    6878                                          fMemPool(0, maxUsableMem),
    69                                           fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), true, false)
     79                                          fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false)
    7080        {
    7181            InitMemberVariables(numTiles, rowPerTile, maxUsableMem);
     
    578588
    579589            //cannot be const, as resize does not want it that way
    580             Queue<CompressionTarget> queue(bind(&zofits::CompressBuffer, this, placeholders::_1), false, false);
     590            Queue<CompressionTarget> queue(bind(&zofits::CompressBuffer, this, placeholders::_1), false);
    581591
    582592            //shrink
     
    875885
    876886        //thread related stuff
    877         vector<Queue<CompressionTarget>> fCompressionQueues;
    878         Queue<WriteTarget>              fWriteToDiskQueue;
     887        vector<Queue<CompressionTarget>>          fCompressionQueues;
     888        Queue<WriteTarget, QueueMin<WriteTarget>> fWriteToDiskQueue;
    879889
    880890        //thread related stuff
Note: See TracChangeset for help on using the changeset viewer.