<commit_before>//*****************************************************************************
// (C) 2014, <NAME>, Austria                                           *
//                                                                            *
// The Sim C++ Framework is free software; you can redistribute it and/or     *
// modify it under the terms of the GNU Lesser General Public License as      *
// published by the Free Software Foundation; either version 2.1 of the       *
// License, or (at your option) any later version.                            *
//                                                                            *
// The Sim C++ Framework is distributed in the hope that it will be useful,   *
// but WITHOUT ANY WARRANTY; without even the implied warranty of             *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser    *
// General Public License for more details.                                   *
//*****************************************************************************
// Global shared memory for all tasks                                         *
//*****************************************************************************
#ifndef SCHED_Memory_hpp
#define SCHED_Memory_hpp

#include <stddef.h>
#include <stdint.h>

// variable access - convenience macros
#define SET_VAR(VARIABLE,VALUE) \
  SCHED::Memory::instance()->setVariable(VARIABLE,VALUE)
#define GET_VAR(VARIABLE) \
  SCHED::Memory::instance()->getVariable(VARIABLE)
#define NUM_VARS \
  SCHED::Memory::instance()->getNumVariables()

namespace SCHED
{
  class Memory
  {
  public:
    // the memory (or a derived class) shall
    // be created and destroyed in main()
    Memory(size_t p_numVariables);
    virtual ~Memory();

    // the memory is a singleton
    static Memory* instance();

    // memory write access
    virtual void setVariable(size_t p_variable, uint32_t p_value);

    // memory read access
    virtual uint32_t getVariable(size_t p_variable) const;

    // number of variables
    virtual size_t getNumVariables() const;

  protected:
    uint32_t* m_variables;
    size_t m_numVariables;

  private:
    Memory();
    Memory(const Memory& p_scheduler);
    const Memory& operator=(const Memory& p_task);

    static Memory* s_instance;
  };
}

#endif<commit_msg>fix typo<commit_after>//*****************************************************************************
// (C) 2014, <NAME>, Austria                                           *
//                                                                            *
// The Sim C++ Framework is free software; you can redistribute it and/or     *
// modify it under the terms of the GNU Lesser General Public License as      *
// published by the Free Software Foundation; either version 2.1 of the       *
// License, or (at your option) any later version.                            *
//                                                                            *
// The Sim C++ Framework is distributed in the hope that it will be useful,   *
// but WITHOUT ANY WARRANTY; without even the implied warranty of             *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser    *
// General Public License for more details.                                   *
//*****************************************************************************
// Global shared memory for all tasks                                         *
//*****************************************************************************
#ifndef SCHED_Memory_hpp
#define SCHED_Memory_hpp

#include <stddef.h>
#include <stdint.h>

// variable access - convenience macros
#define SET_VAR(VARIABLE,VALUE) \
  SCHED::Memory::instance()->setVariable(VARIABLE,VALUE)
#define GET_VAR(VARIABLE) \
  SCHED::Memory::instance()->getVariable(VARIABLE)
#define NUM_VARS \
  SCHED::Memory::instance()->getNumVariables()

namespace SCHED
{
  class Memory
  {
  public:
    // the memory (or a derived class) shall
    // be created and destroyed in main()
    Memory(size_t p_numVariables);
    virtual ~Memory();

    // the memory is a singleton
    static Memory* instance();

    // memory write access
    virtual void setVariable(size_t p_variable, uint32_t p_value);

    // memory read access
    virtual uint32_t getVariable(size_t p_variable) const;

    // number of variables
    virtual size_t getNumVariables() const;

  protected:
    uint32_t* m_variables;
    size_t m_numVariables;

  private:
    Memory();
    Memory(const Memory& p_memory);
    const Memory& operator=(const Memory& p_task);

    static Memory* s_instance;
  };
}

#endif
{'fraction_non_alphanumeric': 0.17935483870967742, 'fraction_numerical': 0.005161290322580645, 'mean_word_length': 2.2524475524475522, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '485743', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1057, 'n_words': 380}