
#ifndef PLS_INTERNAL_SCHEDULING_THREAD_STATE_STATIC_H_
#define PLS_INTERNAL_SCHEDULING_THREAD_STATE_STATIC_H_

#include "pls/internal/scheduling/task_manager.h"
#include "pls/internal/scheduling/cont_manager.h"

#include "pls/internal/base/system_details.h"

#include "thread_state.h"

namespace pls {
namespace internal {
namespace scheduling {

template<size_t NUM_TASKS, size_t NUM_CONTS, size_t MAX_CONT_SIZE>
struct alignas(base::system_details::CACHE_LINE_SIZE) thread_state_static {
 public:
  thread_state_static()
      : static_task_manager_{},
        static_cont_manager_{},
        thread_state_{static_task_manager_.get_task_manager(), static_cont_manager_.get_cont_manager()} {}
  thread_state &get_thread_state() { return thread_state_; }

 private:
  alignas(base::system_details::CACHE_LINE_SIZE) static_task_manager<NUM_TASKS> static_task_manager_;
  alignas(base::system_details::CACHE_LINE_SIZE) static_cont_manager<NUM_CONTS, MAX_CONT_SIZE> static_cont_manager_;
  alignas(base::system_details::CACHE_LINE_SIZE) thread_state thread_state_;
};

}
}
}

#endif //PLS_INTERNAL_SCHEDULING_THREAD_STATE_STATIC_H_
