Prefetcher.hpp 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#ifndef __HEPNOS_PREFETCHER_HPP
#define __HEPNOS_PREFETCHER_HPP

#include <memory>

namespace hepnos {

class DataStore;
class PrefetcherImpl;
class AsyncEngine;
class RunSet;
12 13 14
class EventSet;
class Run;
class SubRun;
15 16 17 18

class Prefetcher {

    friend class RunSet;
19 20 21
    friend class EventSet;
    friend class Run;
    friend class SubRun;
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

    private:

    std::shared_ptr<PrefetcherImpl> m_impl;

    public:

    Prefetcher(const DataStore& ds,
               unsigned int cache_size=16,
               unsigned int batch_size=16);
    Prefetcher(const DataStore& ds, const AsyncEngine& async, 
               unsigned int cache_size=16,
               unsigned int batch_size=16);
    ~Prefetcher();
    Prefetcher(const Prefetcher&) = delete;
    Prefetcher(Prefetcher&&) = delete;
    Prefetcher& operator=(const Prefetcher&) = delete;
    Prefetcher& operator=(Prefetcher&&) = delete;

    unsigned int getCacheSize() const;
    void setCacheSize(unsigned int size);
    unsigned int getBatchSize() const;
    void setBatchSize(unsigned int size);
};

}

#endif