Run.hpp 945 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 50 51 52 53 54 55 56 57 58
#ifndef __HEPNOS_RUN_H
#define __HEPNOS_RUN_H

#include <memory>
#include <string>
#include <hepnos/DataStore.hpp>
#include <hepnos/RunNumber.hpp>

namespace hepnos {

class RunSet;

class Run {

    private:

    friend class RunSet;
    friend class DataSet;

    class Impl;
    std::unique_ptr<Impl> m_impl;

    Run(DataStore* datastore, uint8_t level, const std::string& container, const RunNumber& run);

    public:

    Run();

    Run(const Run&);

    Run(Run&&);

    Run& operator=(const Run&);

    Run& operator=(Run&&);

    ~Run();

    Run next() const;

    bool valid() const;

    bool storeRawData(const std::string& key, const std::vector<char>& buffer);

    bool loadRawData(const std::string& key, std::vector<char>& buffer) const;

    bool operator==(const Run& other) const;

    bool operator!=(const Run& other) const;

    const RunNumber& number() const;

    const std::string& container() const;
};

}

#endif