<commit_before>#pragma once

#include "sol/environment.hpp"
#include "logconsole.h"
#include <memory>
#include "throwassert.h"

namespace RoseCommon {

class LuaAPI {
    public:
        LuaAPI() : isCreated_(false) {}
        virtual ~LuaAPI() = default;
        LuaAPI(sol::environment&& env) : isCreated_(true), env_(std::move(env)), logger_(Core::CLog::GetLogger(Core::log_type::SYSTEM)) {}

        sol::environment& getEnv() { 
            throw_assert(isCreated_, "Error, trying to access the sol environment before creating it");
            return env_;
        }

        const sol::environment getEnv() const {
            throw_assert(isCreated_, "Error, trying to access the sol environment before creating it");
            return env_;
        }

    protected:
        bool isCreated_;
        sol::environment env_;
        std::shared_ptr<spdlog::logger> logger_;<commit_msg>Update luaapi.h<commit_after>#pragma once

#include "sol/environment.hpp"
#include "logconsole.h"
#include <memory>
#include "throwassert.h"

namespace RoseCommon {

class LuaAPI {
    public:
        LuaAPI() : isCreated_(false) {}
        virtual ~LuaAPI() = default;
        LuaAPI(sol::environment&& env) : isCreated_(true), env_(std::move(env)), logger_(Core::CLog::GetLogger(Core::log_type::SYSTEM)) {}

        sol::environment& getEnv() { 
            throw_assert(isCreated_, "Error, trying to access the sol environment before creating it");
            return env_;
        }

        const sol::environment getEnv() const {
            throw_assert(isCreated_, "Error, trying to access the sol environment before creating it");
            return env_;
        }
    
        operator bool() const noexcept { return isCreated_; }

    protected:
        bool isCreated_;
        sol::environment env_;
        std::shared_ptr<spdlog::logger> logger_;
{'fraction_non_alphanumeric': 0.11859838274932614, 'fraction_numerical': 0.0, 'mean_word_length': 2.982832618025751, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5372968', 'n_tokens_mistral': 522, 'n_tokens_neox': 512, 'n_words': 134}