IrregularityFile.h 730 Bytes
Newer Older
Matteo's avatar
update  
Matteo committed
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
#ifndef IRREGULARITY_FILE_H
#define IRREGULARITY_FILE_H
#include <list>
#include <nlohmann/json.hpp>
#include "Irregularity.h"

using json = nlohmann::json;

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;
    IrregularityFile add(const Irregularity irregularity);
    IrregularityFile remove_by_id(const boost::uuids::uuid id);
    IrregularityFile sort();
};

#endif // IRREGULARITY_FILE_H