<commit_before>#include <iostream>
#include <memory>
#include <string>

#include "Connection.h"
#include "ConnectionDelegate.h"

class IrcClient
: public ConnectionDelegate
, public std::enable_shared_from_this<IrcClient> {
public:
    static std::shared_ptr<IrcClient> Create() {
        return std::shared_ptr<IrcClient>(new IrcClient);
    }

    void connect(const std::string &address, unsigned short port) {
        connection = Connection::Create(address, port, shared_from_this());
    } 

    void onConnect() {
        connection->write("NICK guest");
        connection->write("USER guest 0 * :<NAME>");
    }

    void onError() {
    }

private:
    IrcClient() {
    }

    std::shared_ptr<Connection> connection;
};

int main(int, char**) {
    auto client = IrcClient::Create();
    client->connect("127.0.0.1", 6667);

    std::cin.get();
}
<commit_msg>adapt main.cpp to previous changes<commit_after>#include "IrcClient.h"

#include <iostream>

int main(int, char**) {
    auto client = IrcClient::Create();
    client->connect("127.0.0.1", 6667);

    std::cin.get();
}

{'fraction_non_alphanumeric': 0.1561065197428834, 'fraction_numerical': 0.01928374655647383, 'mean_word_length': 3.8230088495575223, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5125530', 'n_tokens_mistral': 373, 'n_tokens_neox': 353, 'n_words': 74}