<commit_before>// Copyright 2016,<NAME>.

#include "RpcConnection.h"

#include <map>
#include <list>
#include <string>
#include <memory>
#include "glog/logging.h"

#include "Event.h"
#include "ReactorLoop.h"
#include "Buffer.h"

using namespace minirpc;

class closeConnection :public Task
{
 public:
  explicit closeConnection(RpcConnection::Impl* impl)
    :impl_(impl)
  {
  }

  std::string taskName()
  {
    return "closeConnection";
  }

  void handle()const override;

 private:
  RpcConnection::Impl* impl_;
};


class writeConnection :public Task
{
 public:
  writeConnection(RpcConnection::Impl* impl, uint32_t opcode,
                  const ::google::protobuf::Message *message)
    :impl_(impl),
     opcode_(opcode),
     message_(message)
  {
  }

  std::string taskName()
  {
    return "writeConnection";
  }
  void handle() const override;

 private:
  RpcConnection::Impl* impl_;
  uint32_t opcode_;
  const ::google::protobuf::Message *message_;
};



class readEventHandler:public EventHandler
{
 public:
  explicit readEventHandler(RpcConnection::Impl* impl)
    :impl_(impl)
  {
  }

  virtual ~readEventHandler()
  {
  }

  void handlePacket()  override;

 private:
  RpcConnection::Impl* impl_;
};


class writeEventHandler:public EventHandler
{
 public:
  explicit writeEventHandler(RpcConnection::Impl* impl)
    :impl_(impl)<commit_msg>Update RpcConnection.cpp<commit_after>// Copyright 2016,<NAME>.

#include "RpcConnection.h"

#include <map>
#include <list>
#include <string>
#include <memory>
#include "glog/logging.h"

#include "Event.h"
#include "ReactorLoop.h"
#include "Buffer.h"

using namespace minirpc;

class closeConnection :public Task
{
 public:
  explicit closeConnection(RpcConnection::Impl* impl)
    :impl_(impl)
  {
  }

  std::string taskName()
  {
    return "closeConnection";
  }

  void handle()const override;

 private:
  RpcConnection::Impl* impl_;
};


class writeConnection :public Task
{
 public:
  writeConnection(RpcConnection::Impl* impl, uint32_t opcode,
                  const ::google::protobuf::Message *message)
    :impl_(impl),
     opcode_(opcode),
     message_(message)
  {
  }

  std::string taskName()
  {
    return "writeConnection";
  }
  void handle() const override;

 private:
  RpcConnection::Impl* impl_;
  uint32_t opcode_;
  const ::google::protobuf::Message *message_;
};



class readEventHandler:public EventHandler
{
 public:
  explicit readEventHandler(RpcConnection::Impl* impl)
    :impl_(impl)
  {
  }

  void handlePacket()  override;

 private:
  RpcConnection::Impl* impl_;
};


class writeEventHandler:public EventHandler
{
 public:
  explicit writeEventHandler(RpcConnection::Impl* impl)
    :impl_(impl)
{'fraction_non_alphanumeric': 0.12435233160621761, 'fraction_numerical': 0.005921539600296077, 'mean_word_length': 4.3, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1845962', 'n_tokens_mistral': 890, 'n_tokens_neox': 868, 'n_words': 194}