/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "precomp.hpp"
#include <time.h>
#include "PFSolver.hpp"
#include "TrackingFunctionPF.hpp"
#ifdef _WIN32
#define TIME( arg ) (((double) clock()) / CLOCKS_PER_SEC)
#else
#define TIME( arg ) (time( arg ))
#endif
namespace cv
{
/*
* TrackerSamplerAlgorithm
*/
TrackerSamplerAlgorithm::~TrackerSamplerAlgorithm()
{
}
bool TrackerSamplerAlgorithm::sampling( const Mat& pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: HardwareConfiguration.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "HardwareConfiguration.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 Tango {
namespace PMR {
namespace Hardware {
class HardwareConfigurationDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<HardwareConfiguration>
_instance;
} _HardwareConfiguration_default_instance_;
namespace protobuf_HardwareConfiguration_2eproto {
namespace {
::google::protobuf::Metadata file_level_metadata[1];
} // namespace
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField
const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},
};
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField
const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
::google::protobuf::internal::AuxillaryParseTableField(),
};
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const
TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ NULL, NULL, 0, -1, -1, -1, -1, NULL, false },
};
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, dancers_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, dispensers_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, motors_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, pidcontrols_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HardwareConfiguration, winders_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(HardwareConfiguration)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&_HardwareConfiguration_default_instance_),
};
namespace {
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
AssignDescriptors(
"HardwareConfiguration.proto", schemas, file_default_instances, TableStruct::offsets, factory,
file_level_metadata, NULL, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
} // namespace
void TableStruct::InitDefaultsImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::internal::InitProtobufDefaults();
::Tango::PMR::Hardware::protobuf_HardwareDancer_2eproto::InitDefaults();
::Tango::PMR::Hardware::protobuf_HardwareDispenser_2eproto::InitDefaults();
::Tango::PMR::Hardware::protobuf_HardwareMotor_2eproto::InitDefaults();
::Tango::PMR::Hardware::protobuf_HardwarePidControl_2eproto::InitDefaults();
::Tango::PMR::Hardware::protobuf_HardwareWinder_2eproto::InitDefaults();
_HardwareConfiguration_default_instance_._instance.DefaultConstruct();
::google::protobuf::internal::OnShutdownDestroyMessage(
&_HardwareConfiguration_default_instance_);}
void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\033HardwareConfiguration.proto\022\022Tango.PMR"
".Hardware\032\024HardwareDancer.proto\032\027Hardwar"
"eDispenser.proto\032\023HardwareMotor.proto\032\030H"
"ardwarePidControl.proto\032\024HardwareWinder."
"proto\"\254\002\n\025HardwareConfiguration\0223\n\007Dance"
"rs\030\001 \003(\0132\".Tango.PMR.Hardware.HardwareDa"
"ncer\0229\n\nDispensers\030\002 \003(\0132%.Tango.PMR.Har"
"dware.HardwareDispenser\0221\n\006Motors\030\003 \003(\0132"
"!.Tango.PMR.Hardware.HardwareMotor\022;\n\013Pi"
"dControls\030\004 \003(\0132&.Tango.PMR.Hardware.Har"
"dwarePidControl\0223\n\007Winders\030\005 \003(\0132\".Tango"
".PMR.Hardware.HardwareWinderB\036\n\034com.twin"
"e.tango.pmr.hardwareb\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 508);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"HardwareConfiguration.proto", &protobuf_RegisterTypes);
::Tango::PMR::Hardware::protobuf_HardwareDancer_2eproto::AddDescriptors();
::Tango::PMR::Hardware::protobuf_HardwareDispenser_2eproto::AddDescriptors();
::Tango::PMR::Hardware::protobuf_HardwareMotor_2eproto::AddDescriptors();
::Tango::PMR::Hardware::protobuf_HardwarePidControl_2eproto::AddDescriptors();
::Tango::PMR::Hardware::protobuf_HardwareWinder_2eproto::AddDescriptors();
}
} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_HardwareConfiguration_2eproto
// ===================================================================
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int HardwareConfiguration::kDancersFieldNumber;
const int HardwareConfiguration::kDispensersFieldNumber;
const int HardwareConfiguration::kMotorsFieldNumber;
const int HardwareConfiguration::kPidControlsFieldNumber;
const int HardwareConfiguration::kWindersFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
HardwareConfiguration::HardwareConfiguration()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
protobuf_HardwareConfiguration_2eproto::InitDefaults();
}
SharedCtor();
// @@protoc_insertion_point(constructor:Tango.PMR.Hardware.HardwareConfiguration)
}
HardwareConfiguration::HardwareConfiguration(const HardwareConfiguration& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
dancers_(from.dancers_),
dispensers_(from.dispensers_),
motors_(from.motors_),
pidcontrols_(from.pidcontrols_),
winders_(from.winders_),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:Tango.PMR.Hardware.HardwareConfiguration)
}
void HardwareConfiguration::SharedCtor() {
_cached_size_ = 0;
}
HardwareConfiguration::~HardwareConfiguration() {
// @@protoc_insertion_point(destructor:Tango.PMR.Hardware.HardwareConfiguration)
SharedDtor();
}
void HardwareConfiguration::SharedDtor() {
}
void HardwareConfiguration::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* HardwareConfiguration::descriptor() {
protobuf_HardwareConfiguration_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_HardwareConfiguration_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const HardwareConfiguration& HardwareConfiguration::default_instance() {
protobuf_HardwareConfiguration_2eproto::InitDefaults();
return *internal_default_instance();
}
HardwareConfiguration* HardwareConfiguration::New(::google::protobuf::Arena* arena) const {
HardwareConfiguration* n = new HardwareConfiguration;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void HardwareConfiguration::Clear() {
// @@protoc_insertion_point(message_clear_start:Tango.PMR.Hardware.HardwareConfiguration)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
dancers_.Clear();
dispensers_.Clear();
motors_.Clear();
pidcontrols_.Clear();
winders_.Clear();
_internal_metadata_.Clear();
}
bool HardwareConfiguration::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:Tango.PMR.Hardware.HardwareConfiguration)
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)) {
// repeated .Tango.PMR.Hardware.HardwareDancer Dancers = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_dancers()));
} else {
goto handle_unusual;
}
break;
}
// repeated .Tango.PMR.Hardware.HardwareDispenser Dispensers = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_dispensers()));
} else {
goto handle_unusual;
}
break;
}
// repeated .Tango.PMR.Hardware.HardwareMotor Motors = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_motors()));
} else {
goto handle_unusual;
}
break;
}
// repeated .Tango.PMR.Hardware.HardwarePidControl PidControls = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_pidcontrols()));
} else {
goto handle_unusual;
}
break;
}
// repeated .Tango.PMR.Hardware.HardwareWinder Winders = 5;
case 5: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_winders()));
} 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:Tango.PMR.Hardware.HardwareConfiguration)
return true;
failure:
// @@protoc_insertion_point(parse_failure:Tango.PMR.Hardware.HardwareConfiguration)
return false;
#undef DO_
}
void HardwareConfiguration::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:Tango.PMR.Hardware.HardwareConfiguration)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .Tango.PMR.Hardware.HardwareDancer Dancers = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dancers_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->dancers(static_cast<int>(i)), output);
}
// repeated .Tango.PMR.Hardware.HardwareDispenser Dispensers = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dispensers_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->dispensers(static_cast<int>(i)), output);
}
// repeated .Tango.PMR.Hardware.HardwareMotor Motors = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->motors_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->motors(static_cast<int>(i)), output);
}
// repeated .Tango.PMR.Hardware.HardwarePidControl PidControls = 4;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->pidcontrols_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->pidcontrols(static_cast<int>(i)), output);
}
// repeated .Tango.PMR.Hardware.HardwareWinder Winders = 5;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->winders_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5, this->winders(static_cast<int>(i)), 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:Tango.PMR.Hardware.HardwareConfiguration)
}
::google::protobuf::uint8* HardwareConfiguration::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:Tango.PMR.Hardware.HardwareConfiguration)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .Tango.PMR.Hardware.HardwareDancer Dancers = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dancers_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
1, this->dancers(static_cast<int>(i)), deterministic, target);
}
// repeated .Tango.PMR.Hardware.HardwareDispenser Dispensers = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dispensers_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
2, this->dispensers(static_cast<int>(i)), deterministic, target);
}
// repeated .Tango.PMR.Hardware.HardwareMotor Motors = 3;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->motors_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
3, this->motors(static_cast<int>(i)), deterministic, target);
}
// repeated .Tango.PMR.Hardware.HardwarePidControl PidControls = 4;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->pidcontrols_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
4, this->pidcontrols(static_cast<int>(i)), deterministic, target);
}
// repeated .Tango.PMR.Hardware.HardwareWinder Winders = 5;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->winders_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
5, this->winders(static_cast<int>(i)), deterministic, 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:Tango.PMR.Hardware.HardwareConfiguration)
return target;
}
size_t HardwareConfiguration::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Tango.PMR.Hardware.HardwareConfiguration)
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()));
}
// repeated .Tango.PMR.Hardware.HardwareDancer Dancers = 1;
{
unsigned int count = static_cast<unsigned int>(this->dancers_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->dancers(static_cast<int>(i)));
}
}
// repeated .Tango.PMR.Hardware.HardwareDispenser Dispensers = 2;
{
unsigned int count = static_cast<unsigned int>(this->dispensers_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->dispensers(static_cast<int>(i)));
}
}
// repeated .Tango.PMR.Hardware.HardwareMotor Motors = 3;
{
unsigned int count = static_cast<unsigned int>(this->motors_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->motors(static_cast<int>(i)));
}
}
// repeated .Tango.PMR.Hardware.HardwarePidControl PidControls = 4;
{
unsigned int count = static_cast<unsigned int>(this->pidcontrols_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->pidcontrols(static_cast<int>(i)));
}
}
// repeated .Tango.PMR.Hardware.HardwareWinder Winders = 5;
{
unsigned int count = static_cast<unsigned int>(this->winders_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->winders(static_cast<int>(i)));
}
}
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 HardwareConfiguration::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:Tango.PMR.Hardware.HardwareConfiguration)
GOOGLE_DCHECK_NE(&from, this);
const HardwareConfiguration* source =
::google::protobuf::internal::DynamicCastToGenerated<const HardwareConfiguration>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:Tango.PMR.Hardware.HardwareConfiguration)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:Tango.PMR.Hardware.HardwareConfiguration)
MergeFrom(*source);
}
}
void HardwareConfiguration::MergeFrom(const HardwareConfiguration& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Tango.PMR.Hardware.HardwareConfiguration)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
dancers_.MergeFrom(from.dancers_);
dispensers_.MergeFrom(from.dispensers_);
motors_.MergeFrom(from.motors_);
pidcontrols_.MergeFrom(from.pidcontrols_);
winders_.MergeFrom(from.winders_);
}
void HardwareConfiguration::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:Tango.PMR.Hardware.HardwareConfiguration)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void HardwareConfiguration::CopyFrom(const HardwareConfiguration& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Tango.PMR.Hardware.HardwareConfiguration)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool HardwareConfiguration::IsInitialized() const {
return true;
}
void HardwareConfiguration::Swap(HardwareConfiguration* other) {
if (other == this) return;
InternalSwap(other);
}
void HardwareConfiguration::InternalSwap(HardwareConfiguration* other) {
using std::swap;
dancers_.InternalSwap(&other->dancers_);
dispensers_.InternalSwap(&other->dispensers_);
motors_.InternalSwap(&other->motors_);
pidcontrols_.InternalSwap(&other->pidcontrols_);
winders_.InternalSwap(&other->winders_);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata HardwareConfiguration::GetMetadata() const {
protobuf_HardwareConfiguration_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_HardwareConfiguration_2eproto::file_level_metadata[kIndexInFileMessages];
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
// HardwareConfiguration
// repeated .Tango.PMR.Hardware.HardwareDancer Dancers = 1;
int HardwareConfiguration::dancers_size() const {
return dancers_.size();
}
void HardwareConfiguration::clear_dancers() {
dancers_.Clear();
}
const ::Tango::PMR::Hardware::HardwareDancer& HardwareConfiguration::dancers(int index) const {
// @@protoc_insertion_point(field_get:Tango.PMR.Hardware.HardwareConfiguration.Dancers)
return dancers_.Get(index);
}
::Tango::PMR::Hardware::HardwareDancer* HardwareConfiguration::mutable_dancers(int index) {
// @@protoc_insertion_point(field_mutable:Tango.PMR.Hardware.HardwareConfiguration.Dancers)
return dancers_.Mutable(index);
}
::Tango::PMR::Hardware::HardwareDancer* HardwareConfiguration::add_dancers() {
// @@protoc_insertion_point(field_add:Tango.PMR.Hardware.HardwareConfiguration.Dancers)
return dancers_.Add();
}
::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareDancer >*
HardwareConfiguration::mutable_dancers() {
// @@protoc_insertion_point(field_mutable_list:Tango.PMR.Hardware.HardwareConfiguration.Dancers)
return &dancers_;
}
const ::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareDancer >&
HardwareConfiguration::dancers() const {
// @@protoc_insertion_point(field_list:Tango.PMR.Hardware.HardwareConfiguration.Dancers)
return dancers_;
}
// repeated .Tango.PMR.Hardware.HardwareDispenser Dispensers = 2;
int HardwareConfiguration::dispensers_size() const {
return dispensers_.size();
}
void HardwareConfiguration::clear_dispensers() {
dispensers_.Clear();
}
const ::Tango::PMR::Hardware::HardwareDispenser& HardwareConfiguration::dispensers(int index) const {
// @@protoc_insertion_point(field_get:Tango.PMR.Hardware.HardwareConfiguration.Dispensers)
return dispensers_.Get(index);
}
::Tango::PMR::Hardware::HardwareDispenser* HardwareConfiguration::mutable_dispensers(int index) {
// @@protoc_insertion_point(field_mutable:Tango.PMR.Hardware.HardwareConfiguration.Dispensers)
return dispensers_.Mutable(index);
}
::Tango::PMR::Hardware::HardwareDispenser* HardwareConfiguration::add_dispensers() {
// @@protoc_insertion_point(field_add:Tango.PMR.Hardware.HardwareConfiguration.Dispensers)
return dispensers_.Add();
}
::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareDispenser >*
HardwareConfiguration::mutable_dispensers() {
// @@protoc_insertion_point(field_mutable_list:Tango.PMR.Hardware.HardwareConfiguration.Dispensers)
return &dispensers_;
}
const ::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareDispenser >&
HardwareConfiguration::dispensers() const {
// @@protoc_insertion_point(field_list:Tango.PMR.Hardware.HardwareConfiguration.Dispensers)
return dispensers_;
}
// repeated .Tango.PMR.Hardware.HardwareMotor Motors = 3;
int HardwareConfiguration::motors_size() const {
return motors_.size();
}
void HardwareConfiguration::clear_motors() {
motors_.Clear();
}
const ::Tango::PMR::Hardware::HardwareMotor& HardwareConfiguration::motors(int index) const {
// @@protoc_insertion_point(field_get:Tango.PMR.Hardware.HardwareConfiguration.Motors)
return motors_.Get(index);
}
::Tango::PMR::Hardware::HardwareMotor* HardwareConfiguration::mutable_motors(int index) {
// @@protoc_insertion_point(field_mutable:Tango.PMR.Hardware.HardwareConfiguration.Motors)
return motors_.Mutable(index);
}
::Tango::PMR::Hardware::HardwareMotor* HardwareConfiguration::add_motors() {
// @@protoc_insertion_point(field_add:Tango.PMR.Hardware.HardwareConfiguration.Motors)
return motors_.Add();
}
::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareMotor >*
HardwareConfiguration::mutable_motors() {
// @@protoc_insertion_point(field_mutable_list:Tango.PMR.Hardware.HardwareConfiguration.Motors)
return &motors_;
}
const ::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareMotor >&
HardwareConfiguration::motors() const {
// @@protoc_insertion_point(field_list:Tango.PMR.Hardware.HardwareConfiguration.Motors)
return motors_;
}
// repeated .Tango.PMR.Hardware.HardwarePidControl PidControls = 4;
int HardwareConfiguration::pidcontrols_size() const {
return pidcontrols_.size();
}
void HardwareConfiguration::clear_pidcontrols() {
pidcontrols_.Clear();
}
const ::Tango::PMR::Hardware::HardwarePidControl& HardwareConfiguration::pidcontrols(int index) const {
// @@protoc_insertion_point(field_get:Tango.PMR.Hardware.HardwareConfiguration.PidControls)
return pidcontrols_.Get(index);
}
::Tango::PMR::Hardware::HardwarePidControl* HardwareConfiguration::mutable_pidcontrols(int index) {
// @@protoc_insertion_point(field_mutable:Tango.PMR.Hardware.HardwareConfiguration.PidControls)
return pidcontrols_.Mutable(index);
}
::Tango::PMR::Hardware::HardwarePidControl* HardwareConfiguration::add_pidcontrols() {
// @@protoc_insertion_point(field_add:Tango.PMR.Hardware.HardwareConfiguration.PidControls)
return pidcontrols_.Add();
}
::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwarePidControl >*
HardwareConfiguration::mutable_pidcontrols() {
// @@protoc_insertion_point(field_mutable_list:Tango.PMR.Hardware.HardwareConfiguration.PidControls)
return &pidcontrols_;
}
const ::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwarePidControl >&
HardwareConfiguration::pidcontrols() const {
// @@protoc_insertion_point(field_list:Tango.PMR.Hardware.HardwareConfiguration.PidControls)
return pidcontrols_;
}
// repeated .Tango.PMR.Hardware.HardwareWinder Winders = 5;
int HardwareConfiguration::winders_size() const {
return winders_.size();
}
void HardwareConfiguration::clear_winders() {
winders_.Clear();
}
const ::Tango::PMR::Hardware::HardwareWinder& HardwareConfiguration::winders(int index) const {
// @@protoc_insertion_point(field_get:Tango.PMR.Hardware.HardwareConfiguration.Winders)
return winders_.Get(index);
}
::Tango::PMR::Hardware::HardwareWinder* HardwareConfiguration::mutable_winders(int index) {
// @@protoc_insertion_point(field_mutable:Tango.PMR.Hardware.HardwareConfiguration.Winders)
return winders_.Mutable(index);
}
::Tango::PMR::Hardware::HardwareWinder* HardwareConfiguration::add_winders() {
// @@protoc_insertion_point(field_add:Tango.PMR.Hardware.HardwareConfiguration.Winders)
return winders_.Add();
}
::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareWinder >*
HardwareConfiguration::mutable_winders() {
// @@protoc_insertion_point(field_mutable_list:Tango.PMR.Hardware.HardwareConfiguration.Winders)
return &winders_;
}
const ::google::protobuf::RepeatedPtrField< ::Tango::PMR::Hardware::HardwareWinder >&
HardwareConfiguration::winders() const {
// @@protoc_insertion_point(field_list:Tango.PMR.Hardware.HardwareConfiguration.Winders)
return winders_;
}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)
} // namespace Hardware
} // namespace PMR
} // namespace Tango
// @@protoc_insertion_point(global_scope)