<commit_before>/*
 * THE NEW CHRONOTEXT TOOLKIT: https://github.com/arielm/new-chronotext-toolkit
 * COPYRIGHT (C) 2012, <NAME> ALL RIGHTS RESERVED.
 *
 * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE MODIFIED BSD LICENSE:
 * https://github.com/arielm/new-chronotext-toolkit/blob/master/LICENSE.md
 */

/*
 * INSPIRED BY http://developer.android.com/reference/android/os/Message.html
 */

#pragma once

#include <memory>
#include <string>

namespace chronotext
{
    class Handler;

    class Message
    {
    public:
        int what;
        std::shared_ptr<void> object;
        int64_t arg;
        
        Handler *target;
        
        Message():
        target(NULL)
        {}
        
        Message(int what, int64_t arg = 0)
        :
        what(what),
        arg(arg),
        target(NULL)
        {}
        
        Message(int what, std::shared_ptr<void> object, int64_t arg = 0)
        :
        what(what),
        object(object),
        arg(arg),
        target(NULL)
        {}
        
        Message(int what, const std::string &object, int64_t arg = 0)
        :
        what(what),
        object(std::make_shared<std::string>(object)),
        arg(arg),
        target(NULL)
        {}
        
        std::string& string() const
        {
            return *std::static_pointer_cast<std::string>(object);
        }
    };
}

namespace chr = chronotext;
<commit_msg>ATTEMPT TO MAKE os/Message MORE ANDROID-LIKE...<commit_after>/*
 * THE NEW CHRONOTEXT TOOLKIT: https://github.com/arielm/new-chronotext-toolkit
 * COPYRIGHT (C) 2012, <NAME> ALL RIGHTS RESERVED.
 *
 * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE MODIFIED BSD LICENSE:
 * https://github.com/arielm/new-chronotext-toolkit/blob/master/LICENSE.md
 */

/*
 * INSPIRED BY http://developer.android.com/reference/android/os/Message.html
 */

#pragma once

#include <memory>
#include <string>

namespace chronotext
{
    class Handler;

    class Message
    {
    public:
        int what;
        std::shared_ptr<void> object;
        int arg1;
        int arg2;
        
        Handler *target;
        
        Message():
        target(NULL)
        {}
        
        Message(int what, int arg1 = 0, int arg2 = 0)
        :
        what(what),
        arg1(arg1),
        arg2(arg2),
        target(NULL)
        {}
        
        Message(int what, std::shared_ptr<void> object, int arg1 = 0, int arg2 = 0)
        :
        what(what),
        object(object),
        arg1(arg1),
        arg2(arg2),
        target(NULL)
        {}
        
        Message(int what, const std::string &object, int arg1 = 0, int arg2 = 0)
        :
        what(what),
        object(std::make_shared<std::string>(object)),
        arg1(arg1),
        arg2(arg2),
        target(NULL)
        {}
        
        std::string& string() const
        {
            return *std::static_pointer_cast<std::string>(object);
        }
    };
}

namespace chr = chronotext;

{'fraction_non_alphanumeric': 0.12373567093728928, 'fraction_numerical': 0.015171948752528659, 'mean_word_length': 1.863899613899614, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 4, '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': '4010683', 'n_tokens_mistral': 989, 'n_tokens_neox': 948, 'n_words': 197}