<commit_before>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2019.  All rights reserved
 */
#ifndef _Stroika_Foundation_Execution_ModuleInit_inl_
#define _Stroika_Foundation_Execution_ModuleInit_inl_ 1

/*
 ********************************************************************************
 ***************************** Implementation Details ***************************
 ********************************************************************************
 */
#include "../Debug/Assertions.h"

namespace Stroika::Foundation::Execution {

    /*
     ********************************************************************************
     ******************************** ModuleDependency ******************************
     ********************************************************************************
     */
    inline ModuleDependency::ModuleDependency (void (*start) (), void (*end) ())
        : fEnd_ (end)
    {
        (*start) ();
    }
    inline ModuleDependency::~ModuleDependency ()
    {
        (*fEnd_) ();
    }

    /*
     ********************************************************************************
     ************************ ModuleInitializer<MODULE_DATA> ************************
     ********************************************************************************
     */
    template <typename MODULE_DATA>
    inline void ModuleInitializer<MODULE_DATA>::Start ()
    {
        if (sInitCnt_++ == 0) {
            // no need to store pointer, cuz its the same as &sActualModuleInitializer_Storage_
            (void)new (&sActualModuleInitializer_Storage_) MODULE_DATA ();
        }
    }
    template <typename MODULE_DATA>
    void ModuleInitializer<MODULE_DATA>::End ()
    {
        if (--sInitCnt_ == 0) {<commit_msg>cosmetic<commit_after>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2019.  All rights reserved
 */
#ifndef _Stroika_Foundation_Execution_ModuleInit_inl_
#define _Stroika_Foundation_Execution_ModuleInit_inl_ 1

/*
 ********************************************************************************
 ***************************** Implementation Details ***************************
 ********************************************************************************
 */
#include "../Debug/Assertions.h"

namespace Stroika::Foundation::Execution {

    /*
     ********************************************************************************
     ******************************** ModuleDependency ******************************
     ********************************************************************************
     */
    inline ModuleDependency::ModuleDependency (void (*start) (), void (*end) ())
        : fEnd_{end}
    {
        (*start) ();
    }
    inline ModuleDependency::~ModuleDependency ()
    {
        (*fEnd_) ();
    }

    /*
     ********************************************************************************
     ************************ ModuleInitializer<MODULE_DATA> ************************
     ********************************************************************************
     */
    template <typename MODULE_DATA>
    inline void ModuleInitializer<MODULE_DATA>::Start ()
    {
        if (sInitCnt_++ == 0) {
            // no need to store pointer, cuz its the same as &sActualModuleInitializer_Storage_
            (void)new (&sActualModuleInitializer_Storage_) MODULE_DATA ();
        }
    }
    template <typename MODULE_DATA>
    void ModuleInitializer<MODULE_DATA>::End ()
    {
        if (--sInitCnt_ == 0) {
{'fraction_non_alphanumeric': 0.4422857142857143, 'fraction_numerical': 0.006285714285714286, 'mean_word_length': 4.646774193548387, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1789529', 'n_tokens_mistral': 783, 'n_tokens_neox': 715, 'n_words': 129}