<commit_before>#ifndef CLUSTERING_ADMINISTRATION_ISSUES_LOCAL_HPP_
#define CLUSTERING_ADMINISTRATION_ISSUES_LOCAL_HPP_

#include <list>
#include <string>

#include "clustering/administration/issues/json.hpp"
#include "concurrency/watchable.hpp"
#include "containers/clone_ptr.hpp"
#include "http/json.hpp"
#include "rpc/serialize_macros.hpp"

class local_issue_t {
public:
    virtual std::string get_description() const = 0;
    virtual cJSON *get_json_description() const = 0;

    virtual ~local_issue_t() { }
    virtual local_issue_t *clone() const = 0;

    // Remember to include your subclass in the deserialize function below!
    enum serialization_code_t { PERSISTENCE_ISSUE_CODE };
    virtual void rdb_serialize(UNUSED write_message_t &msg) const = 0;

    local_issue_t() { }
private:
    DISABLE_COPYING(local_issue_t);
};

int deserialize(read_stream_t *s, local_issue_t **issue_ptr);

class local_issue_tracker_t {
public:
    local_issue_tracker_t() : issues_watchable(std::list<clone_ptr_t<local_issue_t> >()) { }

    class entry_t {
    public:
        entry_t(local_issue_tracker_t *p, const clone_ptr_t<local_issue_t> &d) :
            parent(p), issue(d)
        {
            parent->issues.insert(this);
            parent->recompute();
        }
        ~entry_t() {
            parent->issues.erase(this);
            parent->recompute();
        }
    private:
        friend class local_issue_tracker_t;
        local_issue_tracker_t *parent;
        clone_ptr_t<local_issue_t> issue;
    };

    clone_ptr_t<watchable_t<std::list<clone_ptr_t<local_issue_t> > > > get_issues_watchable() {
        return issues_watchable.get_watchable();
    }

private:
    void recompute() {
        std::list<clone_ptr_t<local_issue_t> > l;
        for (std::set<entry_t *>::iterator it = issues.begin(); it != issues.end(); it++) {
            l.push_back((*it)->issue);
        }
        issues_watchable.set_value(l);
    }
<commit_msg>Added DISABLE_COPYING to local_issue_tracker_t::entry_t.<commit_after>#ifndef CLUSTERING_ADMINISTRATION_ISSUES_LOCAL_HPP_
#define CLUSTERING_ADMINISTRATION_ISSUES_LOCAL_HPP_

#include <list>
#include <string>

#include "clustering/administration/issues/json.hpp"
#include "concurrency/watchable.hpp"
#include "containers/clone_ptr.hpp"
#include "http/json.hpp"
#include "rpc/serialize_macros.hpp"

class local_issue_t {
public:
    virtual std::string get_description() const = 0;
    virtual cJSON *get_json_description() const = 0;

    virtual ~local_issue_t() { }
    virtual local_issue_t *clone() const = 0;

    // Remember to include your subclass in the deserialize function below!
    enum serialization_code_t { PERSISTENCE_ISSUE_CODE };
    virtual void rdb_serialize(UNUSED write_message_t &msg) const = 0;

    local_issue_t() { }
private:
    DISABLE_COPYING(local_issue_t);
};

int deserialize(read_stream_t *s, local_issue_t **issue_ptr);

class local_issue_tracker_t {
public:
    local_issue_tracker_t() : issues_watchable(std::list<clone_ptr_t<local_issue_t> >()) { }

    class entry_t {
    public:
        entry_t(local_issue_tracker_t *p, const clone_ptr_t<local_issue_t> &d) :
            parent(p), issue(d)
        {
            parent->issues.insert(this);
            parent->recompute();
        }
        ~entry_t() {
            parent->issues.erase(this);
            parent->recompute();
        }
    private:
        friend class local_issue_tracker_t;
        local_issue_tracker_t *parent;
        clone_ptr_t<local_issue_t> issue;

        DISABLE_COPYING(entry_t);
    };

    clone_ptr_t<watchable_t<std::list<clone_ptr_t<local_issue_t> > > > get_issues_watchable() {
        return issues_watchable.get_watchable();
    }

private:
    void recompute() {
        std::list<clone_ptr_t<local_issue_t> > l;
        for (std::set<entry_t *>::iterator it = issues.begin(); it != issues.end(); it++) {
            l.push_back((*it)->issue);
        }
        issues_watchable.set_value(l);
    }

{'fraction_non_alphanumeric': 0.1148445336008024, 'fraction_numerical': 0.0020060180541624875, 'mean_word_length': 3.5073446327683615, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3009626', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1362, 'n_words': 230}