// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: hq/dto/OrderBook.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "hq/dto/OrderBook.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)

namespace {

const ::google::protobuf::Descriptor* OrderBook_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  OrderBook_reflection_ = NULL;

}  // namespace


void protobuf_AssignDesc_hq_2fdto_2fOrderBook_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_hq_2fdto_2fOrderBook_2eproto() {
  protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "hq/dto/OrderBook.proto");
  GOOGLE_CHECK(file != NULL);
  OrderBook_descriptor_ = file->message_type(0);
  static const int OrderBook_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OrderBook, level_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OrderBook, price_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OrderBook, volume_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OrderBook, oredercount_),
  };
  OrderBook_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      OrderBook_descriptor_,
      OrderBook::internal_default_instance(),
      OrderBook_offsets_,
      -1,
      -1,
      -1,
      sizeof(OrderBook),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OrderBook, _internal_metadata_));
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_hq_2fdto_2fOrderBook_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      OrderBook_descriptor_, OrderBook::internal_default_instance());
}

}  // namespace

void protobuf_ShutdownFile_hq_2fdto_2fOrderBook_2eproto() {
  OrderBook_default_instance_.Shutdown();
  delete OrderBook_reflection_;
}

void protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  OrderBook_default_instance_.DefaultConstruct();
  OrderBook_default_instance_.get_mutable()->InitAsDefaultInstance();
}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto_once_);
void protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto_once_,
                 &protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto_impl);
}
void protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\026hq/dto/OrderBook.proto\"N\n\tOrderBook\022\r\n"
    "\005level\030\001 \001(\005\022\r\n\005price\030\002 \001(\001\022\016\n\006volume\030\003 "
    "\001(\003\022\023\n\013orederCount\030\004 \001(\005BD\n2com.huasheng"
    ".quant.open.sdk.protobuf.hq.common.dtoB\016"
    "OrderBookProtob\006proto3", 182);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "hq/dto/OrderBook.proto", &protobuf_RegisterTypes);
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_hq_2fdto_2fOrderBook_2eproto);
}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto_once_);
void protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto_once_,
                 &protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto_impl);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_hq_2fdto_2fOrderBook_2eproto {
  StaticDescriptorInitializer_hq_2fdto_2fOrderBook_2eproto() {
    protobuf_AddDesc_hq_2fdto_2fOrderBook_2eproto();
  }
} static_descriptor_initializer_hq_2fdto_2fOrderBook_2eproto_;

namespace {

static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN;
static void MergeFromFail(int line) {
  ::google::protobuf::internal::MergeFromFail(__FILE__, line);
}

}  // namespace


// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int OrderBook::kLevelFieldNumber;
const int OrderBook::kPriceFieldNumber;
const int OrderBook::kVolumeFieldNumber;
const int OrderBook::kOrederCountFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

OrderBook::OrderBook()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  if (this != internal_default_instance()) protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto();
  SharedCtor();
  // @@protoc_insertion_point(constructor:OrderBook)
}

void OrderBook::InitAsDefaultInstance() {
}

OrderBook::OrderBook(const OrderBook& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  UnsafeMergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:OrderBook)
}

void OrderBook::SharedCtor() {
  ::memset(&price_, 0, reinterpret_cast<char*>(&volume_) -
    reinterpret_cast<char*>(&price_) + sizeof(volume_));
  _cached_size_ = 0;
}

OrderBook::~OrderBook() {
  // @@protoc_insertion_point(destructor:OrderBook)
  SharedDtor();
}

void OrderBook::SharedDtor() {
}

void OrderBook::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* OrderBook::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return OrderBook_descriptor_;
}

const OrderBook& OrderBook::default_instance() {
  protobuf_InitDefaults_hq_2fdto_2fOrderBook_2eproto();
  return *internal_default_instance();
}

::google::protobuf::internal::ExplicitlyConstructed<OrderBook> OrderBook_default_instance_;

OrderBook* OrderBook::New(::google::protobuf::Arena* arena) const {
  OrderBook* n = new OrderBook;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void OrderBook::Clear() {
// @@protoc_insertion_point(message_clear_start:OrderBook)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(OrderBook, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<OrderBook*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&(first), 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  ZR_(price_, volume_);

#undef ZR_HELPER_
#undef ZR_

}

bool OrderBook::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:OrderBook)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 level = 1;
      case 1: {
        if (tag == 8) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &level_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(17)) goto parse_price;
        break;
      }

      // optional double price = 2;
      case 2: {
        if (tag == 17) {
         parse_price:

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &price_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_volume;
        break;
      }

      // optional int64 volume = 3;
      case 3: {
        if (tag == 24) {
         parse_volume:

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &volume_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(32)) goto parse_orederCount;
        break;
      }

      // optional int32 orederCount = 4;
      case 4: {
        if (tag == 32) {
         parse_orederCount:

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &oredercount_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:OrderBook)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:OrderBook)
  return false;
#undef DO_
}

void OrderBook::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:OrderBook)
  // optional int32 level = 1;
  if (this->level() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->level(), output);
  }

  // optional double price = 2;
  if (this->price() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->price(), output);
  }

  // optional int64 volume = 3;
  if (this->volume() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->volume(), output);
  }

  // optional int32 orederCount = 4;
  if (this->oredercount() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->oredercount(), output);
  }

  // @@protoc_insertion_point(serialize_end:OrderBook)
}

::google::protobuf::uint8* OrderBook::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:OrderBook)
  // optional int32 level = 1;
  if (this->level() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->level(), target);
  }

  // optional double price = 2;
  if (this->price() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->price(), target);
  }

  // optional int64 volume = 3;
  if (this->volume() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->volume(), target);
  }

  // optional int32 orederCount = 4;
  if (this->oredercount() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->oredercount(), target);
  }

  // @@protoc_insertion_point(serialize_to_array_end:OrderBook)
  return target;
}

size_t OrderBook::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OrderBook)
  size_t total_size = 0;

  // optional int32 level = 1;
  if (this->level() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->level());
  }

  // optional double price = 2;
  if (this->price() != 0) {
    total_size += 1 + 8;
  }

  // optional int64 volume = 3;
  if (this->volume() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int64Size(
        this->volume());
  }

  // optional int32 orederCount = 4;
  if (this->oredercount() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->oredercount());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void OrderBook::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:OrderBook)
  if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
  const OrderBook* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const OrderBook>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:OrderBook)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:OrderBook)
    UnsafeMergeFrom(*source);
  }
}

void OrderBook::MergeFrom(const OrderBook& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OrderBook)
  if (GOOGLE_PREDICT_TRUE(&from != this)) {
    UnsafeMergeFrom(from);
  } else {
    MergeFromFail(__LINE__);
  }
}

void OrderBook::UnsafeMergeFrom(const OrderBook& from) {
  GOOGLE_DCHECK(&from != this);
  if (from.level() != 0) {
    set_level(from.level());
  }
  if (from.price() != 0) {
    set_price(from.price());
  }
  if (from.volume() != 0) {
    set_volume(from.volume());
  }
  if (from.oredercount() != 0) {
    set_oredercount(from.oredercount());
  }
}

void OrderBook::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:OrderBook)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void OrderBook::CopyFrom(const OrderBook& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OrderBook)
  if (&from == this) return;
  Clear();
  UnsafeMergeFrom(from);
}

bool OrderBook::IsInitialized() const {

  return true;
}

void OrderBook::Swap(OrderBook* other) {
  if (other == this) return;
  InternalSwap(other);
}
void OrderBook::InternalSwap(OrderBook* other) {
  std::swap(level_, other->level_);
  std::swap(price_, other->price_);
  std::swap(volume_, other->volume_);
  std::swap(oredercount_, other->oredercount_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata OrderBook::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = OrderBook_descriptor_;
  metadata.reflection = OrderBook_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// OrderBook

// optional int32 level = 1;
void OrderBook::clear_level() {
  level_ = 0;
}
::google::protobuf::int32 OrderBook::level() const {
  // @@protoc_insertion_point(field_get:OrderBook.level)
  return level_;
}
void OrderBook::set_level(::google::protobuf::int32 value) {
  
  level_ = value;
  // @@protoc_insertion_point(field_set:OrderBook.level)
}

// optional double price = 2;
void OrderBook::clear_price() {
  price_ = 0;
}
double OrderBook::price() const {
  // @@protoc_insertion_point(field_get:OrderBook.price)
  return price_;
}
void OrderBook::set_price(double value) {
  
  price_ = value;
  // @@protoc_insertion_point(field_set:OrderBook.price)
}

// optional int64 volume = 3;
void OrderBook::clear_volume() {
  volume_ = GOOGLE_LONGLONG(0);
}
::google::protobuf::int64 OrderBook::volume() const {
  // @@protoc_insertion_point(field_get:OrderBook.volume)
  return volume_;
}
void OrderBook::set_volume(::google::protobuf::int64 value) {
  
  volume_ = value;
  // @@protoc_insertion_point(field_set:OrderBook.volume)
}

// optional int32 orederCount = 4;
void OrderBook::clear_oredercount() {
  oredercount_ = 0;
}
::google::protobuf::int32 OrderBook::oredercount() const {
  // @@protoc_insertion_point(field_get:OrderBook.orederCount)
  return oredercount_;
}
void OrderBook::set_oredercount(::google::protobuf::int32 value) {
  
  oredercount_ = value;
  // @@protoc_insertion_point(field_set:OrderBook.orederCount)
}

inline const OrderBook* OrderBook::internal_default_instance() {
  return &OrderBook_default_instance_.get();
}
#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

// @@protoc_insertion_point(global_scope)
