// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: proto/topicData/topicDataRecord/dataStructure/pose2d.proto

#include "proto/topicData/topicDataRecord/dataStructure/pose2d.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)

namespace protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fvector2_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fvector2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Vector2;
}  // namespace protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fvector2_2eproto
namespace ubii {
namespace dataStructure {
class Pose2DDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<Pose2D>
      _instance;
  const ::ubii::dataStructure::Vector2* direction_;
  float angle_;
} _Pose2D_default_instance_;
}  // namespace dataStructure
}  // namespace ubii
namespace protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto {
static void InitDefaultsPose2D() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::ubii::dataStructure::_Pose2D_default_instance_;
    new (ptr) ::ubii::dataStructure::Pose2D();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::ubii::dataStructure::Pose2D::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<1> scc_info_Pose2D =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsPose2D}, {
      &protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fvector2_2eproto::scc_info_Vector2.base,}};

void InitDefaults() {
  ::google::protobuf::internal::InitSCC(&scc_info_Pose2D.base);
}

::google::protobuf::Metadata file_level_metadata[1];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::dataStructure::Pose2D, _internal_metadata_),
  ~0u,  // no _extensions_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::dataStructure::Pose2D, _oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::dataStructure::Pose2D, position_),
  offsetof(::ubii::dataStructure::Pose2DDefaultTypeInternal, direction_),
  offsetof(::ubii::dataStructure::Pose2DDefaultTypeInternal, angle_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::dataStructure::Pose2D, orientation_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::ubii::dataStructure::Pose2D)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::ubii::dataStructure::_Pose2D_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  AssignDescriptors(
      "proto/topicData/topicDataRecord/dataStructure/pose2d.proto", schemas, file_default_instances, TableStruct::offsets,
      file_level_metadata, NULL, NULL);
}

void protobuf_AssignDescriptorsOnce() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n:proto/topicData/topicDataRecord/dataSt"
      "ructure/pose2d.proto\022\022ubii.dataStructure"
      "\032;proto/topicData/topicDataRecord/dataSt"
      "ructure/vector2.proto\"\211\001\n\006Pose2D\022-\n\010posi"
      "tion\030\001 \001(\0132\033.ubii.dataStructure.Vector2\022"
      "0\n\tdirection\030\002 \001(\0132\033.ubii.dataStructure."
      "Vector2H\000\022\017\n\005angle\030\003 \001(\002H\000B\r\n\013orientatio"
      "nb\006proto3"
  };
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      descriptor, 289);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "proto/topicData/topicDataRecord/dataStructure/pose2d.proto", &protobuf_RegisterTypes);
  ::protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fvector2_2eproto::AddDescriptors();
}

void AddDescriptors() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
}  // namespace protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto
namespace ubii {
namespace dataStructure {

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

void Pose2D::InitAsDefaultInstance() {
  ::ubii::dataStructure::_Pose2D_default_instance_._instance.get_mutable()->position_ = const_cast< ::ubii::dataStructure::Vector2*>(
      ::ubii::dataStructure::Vector2::internal_default_instance());
  ::ubii::dataStructure::_Pose2D_default_instance_.direction_ = const_cast< ::ubii::dataStructure::Vector2*>(
      ::ubii::dataStructure::Vector2::internal_default_instance());
  ::ubii::dataStructure::_Pose2D_default_instance_.angle_ = 0;
}
void Pose2D::clear_position() {
  if (GetArenaNoVirtual() == NULL && position_ != NULL) {
    delete position_;
  }
  position_ = NULL;
}
void Pose2D::set_allocated_direction(::ubii::dataStructure::Vector2* direction) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  clear_orientation();
  if (direction) {
    ::google::protobuf::Arena* submessage_arena = NULL;
    if (message_arena != submessage_arena) {
      direction = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, direction, submessage_arena);
    }
    set_has_direction();
    orientation_.direction_ = direction;
  }
  // @@protoc_insertion_point(field_set_allocated:ubii.dataStructure.Pose2D.direction)
}
void Pose2D::clear_direction() {
  if (has_direction()) {
    delete orientation_.direction_;
    clear_has_orientation();
  }
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Pose2D::kPositionFieldNumber;
const int Pose2D::kDirectionFieldNumber;
const int Pose2D::kAngleFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Pose2D::Pose2D()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::scc_info_Pose2D.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:ubii.dataStructure.Pose2D)
}
Pose2D::Pose2D(const Pose2D& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from.has_position()) {
    position_ = new ::ubii::dataStructure::Vector2(*from.position_);
  } else {
    position_ = NULL;
  }
  clear_has_orientation();
  switch (from.orientation_case()) {
    case kDirection: {
      mutable_direction()->::ubii::dataStructure::Vector2::MergeFrom(from.direction());
      break;
    }
    case kAngle: {
      set_angle(from.angle());
      break;
    }
    case ORIENTATION_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:ubii.dataStructure.Pose2D)
}

void Pose2D::SharedCtor() {
  position_ = NULL;
  clear_has_orientation();
}

Pose2D::~Pose2D() {
  // @@protoc_insertion_point(destructor:ubii.dataStructure.Pose2D)
  SharedDtor();
}

void Pose2D::SharedDtor() {
  if (this != internal_default_instance()) delete position_;
  if (has_orientation()) {
    clear_orientation();
  }
}

void Pose2D::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Pose2D::descriptor() {
  ::protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const Pose2D& Pose2D::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::scc_info_Pose2D.base);
  return *internal_default_instance();
}


void Pose2D::clear_orientation() {
// @@protoc_insertion_point(one_of_clear_start:ubii.dataStructure.Pose2D)
  switch (orientation_case()) {
    case kDirection: {
      delete orientation_.direction_;
      break;
    }
    case kAngle: {
      // No need to clear
      break;
    }
    case ORIENTATION_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = ORIENTATION_NOT_SET;
}


void Pose2D::Clear() {
// @@protoc_insertion_point(message_clear_start:ubii.dataStructure.Pose2D)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (GetArenaNoVirtual() == NULL && position_ != NULL) {
    delete position_;
  }
  position_ = NULL;
  clear_orientation();
  _internal_metadata_.Clear();
}

bool Pose2D::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:ubii.dataStructure.Pose2D)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // .ubii.dataStructure.Vector2 position = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_position()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .ubii.dataStructure.Vector2 direction = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_direction()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // float angle = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
          clear_orientation();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &orientation_.angle_)));
          set_has_angle();
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:ubii.dataStructure.Pose2D)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:ubii.dataStructure.Pose2D)
  return false;
#undef DO_
}

void Pose2D::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:ubii.dataStructure.Pose2D)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .ubii.dataStructure.Vector2 position = 1;
  if (this->has_position()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->_internal_position(), output);
  }

  // .ubii.dataStructure.Vector2 direction = 2;
  if (has_direction()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->_internal_direction(), output);
  }

  // float angle = 3;
  if (has_angle()) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->angle(), output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:ubii.dataStructure.Pose2D)
}

::google::protobuf::uint8* Pose2D::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:ubii.dataStructure.Pose2D)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .ubii.dataStructure.Vector2 position = 1;
  if (this->has_position()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, this->_internal_position(), deterministic, target);
  }

  // .ubii.dataStructure.Vector2 direction = 2;
  if (has_direction()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->_internal_direction(), deterministic, target);
  }

  // float angle = 3;
  if (has_angle()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->angle(), target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:ubii.dataStructure.Pose2D)
  return target;
}

size_t Pose2D::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:ubii.dataStructure.Pose2D)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // .ubii.dataStructure.Vector2 position = 1;
  if (this->has_position()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *position_);
  }

  switch (orientation_case()) {
    // .ubii.dataStructure.Vector2 direction = 2;
    case kDirection: {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *orientation_.direction_);
      break;
    }
    // float angle = 3;
    case kAngle: {
      total_size += 1 + 4;
      break;
    }
    case ORIENTATION_NOT_SET: {
      break;
    }
  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Pose2D::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:ubii.dataStructure.Pose2D)
  GOOGLE_DCHECK_NE(&from, this);
  const Pose2D* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const Pose2D>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:ubii.dataStructure.Pose2D)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:ubii.dataStructure.Pose2D)
    MergeFrom(*source);
  }
}

void Pose2D::MergeFrom(const Pose2D& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:ubii.dataStructure.Pose2D)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.has_position()) {
    mutable_position()->::ubii::dataStructure::Vector2::MergeFrom(from.position());
  }
  switch (from.orientation_case()) {
    case kDirection: {
      mutable_direction()->::ubii::dataStructure::Vector2::MergeFrom(from.direction());
      break;
    }
    case kAngle: {
      set_angle(from.angle());
      break;
    }
    case ORIENTATION_NOT_SET: {
      break;
    }
  }
}

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

void Pose2D::CopyFrom(const Pose2D& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:ubii.dataStructure.Pose2D)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Pose2D::IsInitialized() const {
  return true;
}

void Pose2D::Swap(Pose2D* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Pose2D::InternalSwap(Pose2D* other) {
  using std::swap;
  swap(position_, other->position_);
  swap(orientation_, other->orientation_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata Pose2D::GetMetadata() const {
  protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_proto_2ftopicData_2ftopicDataRecord_2fdataStructure_2fpose2d_2eproto::file_level_metadata[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace dataStructure
}  // namespace ubii
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::ubii::dataStructure::Pose2D* Arena::CreateMaybeMessage< ::ubii::dataStructure::Pose2D >(Arena* arena) {
  return Arena::CreateInternal< ::ubii::dataStructure::Pose2D >(arena);
}
}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)
