<commit_before>#ifndef DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H
#define DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H

#if defined(_MSC_VER)
#pragma once
#endif

#include <unordered_map>

#include "../session_manager.h"

namespace dsa {

class SecurityManager;
class Config;

class SimpleSessionManager final : public SessionManager {
  std::unordered_map<string_, ref_<Session>> _sessions;

  LinkStrandRef _strand;
  ClientInfo _last_client;

  uint64_t _session_seed = 0;

  uint _count_to_check = 0;
  void check_destroyed_session();

 protected:
  void destroy_impl() final;

 public:
  explicit SimpleSessionManager(LinkStrandRef strand);
  void get_session(const string_ &dsid, const string_ &auth_token,
                   const string_ &session_id,
                   Session::GetSessionCallback &&callback) final;
  // a lazy way to clean up unused sessions: after creating 100 new sessions,
  // check if any existing sessions are destroyed and release the reference
  uint memory_check_interval = 100;
};

}  // namespace dsa

#endif  // DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H<commit_msg>fix compile error for visual studio<commit_after>#ifndef DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H
#define DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H

#if defined(_MSC_VER)
#pragma once
#endif

#include <unordered_map>

#include "../session_manager.h"

namespace dsa {

class SecurityManager;
class Config;

class SimpleSessionManager final : public SessionManager {
  std::unordered_map<string_, ref_<Session>> _sessions;

  LinkStrandRef _strand;
  ClientInfo _last_client;

  uint64_t _session_seed{0};

  unsigned int _count_to_check{0};
  void check_destroyed_session();

 protected:
  void destroy_impl() final;

 public:
  explicit SimpleSessionManager(LinkStrandRef strand);
  void get_session(const string_ &dsid, const string_ &auth_token,
                   const string_ &session_id,
                   Session::GetSessionCallback &&callback) final;
  // a lazy way to clean up unused sessions: after creating 100 new sessions,
  // check if any existing sessions are destroyed and release the reference
  unsigned int memory_check_interval{100};
};

}  // namespace dsa

#endif  // DSA_SDK_MODULE_SIMPLE_SESSION_MANAGER_H
{'fraction_non_alphanumeric': 0.0724246513720198, 'fraction_numerical': 0.00899685110211426, 'mean_word_length': 4.731958762886598, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7550578', 'n_tokens_mistral': 723, 'n_tokens_neox': 677, 'n_words': 185}