<commit_before>#ifndef TMCONTROLGRAPH_H
#define TMCONTROLGRAPH_H

#include "TMCommand.h"
#include "TMStringCharPair.h"
#include "TMExceptions.h"
#include <unordered_map>
#include <string>
#include <memory>
using std::unordered_map;
using std::string;
using std::pair;
using std::move;


class TMControlGraph
{
    public:
        TMControlGraph() = default;
        TMControlGraph(const TMControlGraph&) = default;
        TMControlGraph& operator= (const TMControlGraph&) = default;
        TMControlGraph& operator= (TMControlGraph&&) = default;

        const TMCommand& operator[] (const TMStringCharPair& val) { return graph[val]; }
        void operator+= (const pair<string, TMCommand>& cmd) throw (CommandAlreadyExist);
        void addNewCmd(const pair<string, TMCommand>&) throw (CommandAlreadyExist);
    private:
        unordered_map<TMStringCharPair, TMCommand> graph;

        //void addNewCmd(const pair<string, TMCommand>&) throw (CommandAlreadyExist);
        void checkIfIsUnique(const TMStringCharPair&) throw (CommandAlreadyExist);
        void appendCmd(TMStringCharPair&, TMCommand&);
};

#endif // TMCONTROLGRAPH_H<commit_msg>[FIX] += overload now working properly<commit_after>#ifndef TMCONTROLGRAPH_H
#define TMCONTROLGRAPH_H

#include "TMCommand.h"
#include "TMStringCharPair.h"
#include "TMExceptions.h"
#include <unordered_map>
#include <string>
#include <memory>
using std::unordered_map;
using std::string;
using std::pair;
using std::move;


class TMControlGraph
{
    public:
        TMControlGraph() = default;
        TMControlGraph(const TMControlGraph&) = default;
        TMControlGraph& operator= (const TMControlGraph&) = default;
        TMControlGraph& operator= (TMControlGraph&&) = default;

        const TMCommand& operator[] (const TMStringCharPair& val) { return graph[val]; }
        void operator+= (const pair<string, TMCommand>& cmd) throw (CommandAlreadyExist);
    private:
        unordered_map<TMStringCharPair, TMCommand> graph;

        void addNewCmd(const pair<string, TMCommand>&) throw (CommandAlreadyExist);
        void checkIfIsUnique(const TMStringCharPair&) throw (CommandAlreadyExist);
        void appendCmd(TMStringCharPair&, TMCommand&);
};

#endif // TMCONTROLGRAPH_H
{'fraction_non_alphanumeric': 0.11121036176864672, 'fraction_numerical': 0.0, 'mean_word_length': 4.743589743589744, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '7115712', 'n_tokens_mistral': 721, 'n_tokens_neox': 664, 'n_words': 163}