IrregularityFile.h 856 Bytes
Newer Older
Matteo's avatar
update  
Matteo committed
1
2
3
4
5
6
7
8
#ifndef IRREGULARITY_FILE_H
#define IRREGULARITY_FILE_H
#include <list>
#include <nlohmann/json.hpp>
#include "Irregularity.h"

using json = nlohmann::json;

Matteo's avatar
Matteo committed
9
10
11
12
13
/**
 * @class IrregularityFile
 * @brief An IrregularityFile is a collection of Irregularities detected on a tape.
 * 
 */
Matteo's avatar
update  
Matteo committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class IrregularityFile
{
private:
    /* data */
    uint16_t offset;
    std::list<Irregularity> irregularities;

public:
    IrregularityFile(uint16_t offset, std::list<Irregularity> irregularities);
    ~IrregularityFile();

    static IrregularityFile fromJSON(const json j);
    json toJSON();

    uint16_t getOffset() const;
    std::list<Irregularity> getIrregularities() const;
Matteo's avatar
update    
Matteo committed
30
31
32
    IrregularityFile& add(const Irregularity irregularity);
    IrregularityFile& remove_by_id(const boost::uuids::uuid id);
    IrregularityFile& sort();
Matteo's avatar
update  
Matteo committed
33
34
35
};

#endif // IRREGULARITY_FILE_H