<commit_before>#ifndef _RUNNABLE_H_
#define _RUNNABLE_H_

#include "EventHandler.h"

#include <string>
#include <EventQueue.h>

class PlatformThread;
class Event;
class FWPlatform;

class Runnable : public EventHandler {
 public:
  Runnable() { }
  Runnable(const Runnable & other) = delete;
  Runnable & operator= (const Runnable & other) = delete;
  
  void start(PlatformThread * _thread);
  // void stop();

  PlatformThread & getThread();
  const PlatformThread & getThread() const;
  PlatformThread * getThreadPtr() { return thread; }

  void sendEvent(const Event & ev) {
    event_queue.push(0, ev);
  }
    
  void logMessage(const std::string & message) { logMessage(message.c_str()); }
  void logMessage(const char * message);
    
 protected:
  FWPlatform & getPlatform();
      
  EventQueue event_queue;
  void postEvent(const Event & event);
  virtual void run() = 0;

 private:
  PlatformThread * thread = 0;
};

#endif<commit_msg>add const version of getPlatform()<commit_after>#ifndef _RUNNABLE_H_
#define _RUNNABLE_H_

#include "EventHandler.h"

#include <string>
#include <EventQueue.h>

class PlatformThread;
class Event;
class FWPlatform;

class Runnable : public EventHandler {
 public:
  Runnable() { }
  Runnable(const Runnable & other) = delete;
  Runnable & operator= (const Runnable & other) = delete;
  
  void start(PlatformThread * _thread);
  // void stop();

  PlatformThread & getThread();
  const PlatformThread & getThread() const;
  PlatformThread * getThreadPtr() { return thread; }

  void sendEvent(const Event & ev) {
    event_queue.push(0, ev);
  }
    
  void logMessage(const std::string & message) { logMessage(message.c_str()); }
  void logMessage(const char * message);
    
 protected:
  FWPlatform & getPlatform();
  const FWPlatform & getPlatform() const;
  
  EventQueue event_queue;
  void postEvent(const Event & event);
  virtual void run() = 0;

 private:
  PlatformThread * thread = 0;
};

#endif
{'fraction_non_alphanumeric': 0.11469534050179211, 'fraction_numerical': 0.0030721966205837174, 'mean_word_length': 4.224598930481283, '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': '66761', 'n_tokens_mistral': 635, 'n_tokens_neox': 609, 'n_words': 167}