Commit c510093c authored by Stanislav Bohm's avatar Stanislav Bohm

ENH: ClientMessage

parent 818fc0f6
from loomcomm_pb2 import Register, Data, DataPrologue
from loomcomm_pb2 import Register, Data, ClientMessage
import socket
from connection import Connection
......@@ -40,8 +40,10 @@ class Client(object):
data = {}
while expected != len(data):
msg = self.connection.receive_message()
prologue = DataPrologue()
prologue.ParseFromString(msg)
cmsg = ClientMessage()
cmsg.ParseFromString(msg)
assert cmsg.type == ClientMessage.DATA
prologue = cmsg.data
data[prologue.id] = self._receive_data()
if single_result:
return data[results.id]
......
......@@ -18,7 +18,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='loomcomm.proto',
package='loomcomm',
serialized_pb=_b('\n\x0eloomcomm.proto\x12\x08loomcomm\"\x9f\x01\n\x08Register\x12\x18\n\x10protocol_version\x18\x01 \x02(\x05\x12%\n\x04type\x18\x02 \x02(\x0e\x32\x17.loomcomm.Register.Type\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x12\n\ntask_types\x18\x04 \x03(\t\"0\n\x04Type\x12\x13\n\x0fREGISTER_WORKER\x10\x01\x12\x13\n\x0fREGISTER_CLIENT\x10\x02\"&\n\rServerMessage\"\x15\n\x04Type\x12\r\n\tSTART_JOB\x10\x01\"\xc4\x01\n\rWorkerCommand\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.WorkerCommand.Type\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x11\n\ttask_type\x18\x03 \x01(\x05\x12\x13\n\x0btask_config\x18\x04 \x01(\t\x12\x13\n\x0btask_inputs\x18\x05 \x03(\x05\x12\x0f\n\x07\x61\x64\x64ress\x18\n \x01(\t\x12\x11\n\twith_size\x18\x0b \x01(\x08\"\x1a\n\x04Type\x12\x08\n\x04TASK\x10\x01\x12\x08\n\x04SEND\x10\x02\"\x1c\n\x0eWorkerResponse\x12\n\n\x02id\x18\x02 \x01(\x05\"\x18\n\x08\x41nnounce\x12\x0c\n\x04port\x18\x01 \x02(\x05\"-\n\x0c\x44\x61taPrologue\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x11\n\tdata_size\x18\x03 \x01(\x04\"%\n\x04\x44\x61ta\x12\x0f\n\x07type_id\x18\x01 \x02(\x05\x12\x0c\n\x04size\x18\x02 \x01(\x04\x42\x02H\x03')
serialized_pb=_b('\n\x0eloomcomm.proto\x12\x08loomcomm\"\x9f\x01\n\x08Register\x12\x18\n\x10protocol_version\x18\x01 \x02(\x05\x12%\n\x04type\x18\x02 \x02(\x0e\x32\x17.loomcomm.Register.Type\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12\x12\n\ntask_types\x18\x04 \x03(\t\"0\n\x04Type\x12\x13\n\x0fREGISTER_WORKER\x10\x01\x12\x13\n\x0fREGISTER_CLIENT\x10\x02\"&\n\rServerMessage\"\x15\n\x04Type\x12\r\n\tSTART_JOB\x10\x01\"\xc4\x01\n\rWorkerCommand\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.WorkerCommand.Type\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x11\n\ttask_type\x18\x03 \x01(\x05\x12\x13\n\x0btask_config\x18\x04 \x01(\t\x12\x13\n\x0btask_inputs\x18\x05 \x03(\x05\x12\x0f\n\x07\x61\x64\x64ress\x18\n \x01(\t\x12\x11\n\twith_size\x18\x0b \x01(\x08\"\x1a\n\x04Type\x12\x08\n\x04TASK\x10\x01\x12\x08\n\x04SEND\x10\x02\"\x1c\n\x0eWorkerResponse\x12\n\n\x02id\x18\x02 \x01(\x05\"\x18\n\x08\x41nnounce\x12\x0c\n\x04port\x18\x01 \x02(\x05\"-\n\x0c\x44\x61taPrologue\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x11\n\tdata_size\x18\x03 \x01(\x04\"%\n\x04\x44\x61ta\x12\x0f\n\x07type_id\x18\x01 \x02(\x05\x12\x0c\n\x04size\x18\x02 \x01(\x04\"&\n\x08\x46\x65\x65\x64\x62\x61\x63k\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0e\n\x06worker\x18\x02 \x02(\t\"\xa7\x01\n\rClientMessage\x12*\n\x04type\x18\x01 \x02(\x0e\x32\x1c.loomcomm.ClientMessage.Type\x12$\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x16.loomcomm.DataPrologue\x12$\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x03 \x01(\x0b\x32\x12.loomcomm.Feedback\"\x1e\n\x04Type\x12\x08\n\x04\x44\x41TA\x10\x01\x12\x0c\n\x08\x46\x45\x45\x44\x42\x41\x43K\x10\x02\x42\x02H\x03')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
......@@ -86,6 +86,28 @@ _WORKERCOMMAND_TYPE = _descriptor.EnumDescriptor(
)
_sym_db.RegisterEnumDescriptor(_WORKERCOMMAND_TYPE)
_CLIENTMESSAGE_TYPE = _descriptor.EnumDescriptor(
name='Type',
full_name='loomcomm.ClientMessage.Type',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DATA', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='FEEDBACK', index=1, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=749,
serialized_end=779,
)
_sym_db.RegisterEnumDescriptor(_CLIENTMESSAGE_TYPE)
_REGISTER = _descriptor.Descriptor(
name='Register',
......@@ -369,11 +391,97 @@ _DATA = _descriptor.Descriptor(
serialized_end=569,
)
_FEEDBACK = _descriptor.Descriptor(
name='Feedback',
full_name='loomcomm.Feedback',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='loomcomm.Feedback.id', index=0,
number=1, type=5, cpp_type=1, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='worker', full_name='loomcomm.Feedback.worker', index=1,
number=2, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
extension_ranges=[],
oneofs=[
],
serialized_start=571,
serialized_end=609,
)
_CLIENTMESSAGE = _descriptor.Descriptor(
name='ClientMessage',
full_name='loomcomm.ClientMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='type', full_name='loomcomm.ClientMessage.type', index=0,
number=1, type=14, cpp_type=8, label=2,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='data', full_name='loomcomm.ClientMessage.data', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='feedback', full_name='loomcomm.ClientMessage.feedback', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_CLIENTMESSAGE_TYPE,
],
options=None,
is_extendable=False,
extension_ranges=[],
oneofs=[
],
serialized_start=612,
serialized_end=779,
)
_REGISTER.fields_by_name['type'].enum_type = _REGISTER_TYPE
_REGISTER_TYPE.containing_type = _REGISTER
_SERVERMESSAGE_TYPE.containing_type = _SERVERMESSAGE
_WORKERCOMMAND.fields_by_name['type'].enum_type = _WORKERCOMMAND_TYPE
_WORKERCOMMAND_TYPE.containing_type = _WORKERCOMMAND
_CLIENTMESSAGE.fields_by_name['type'].enum_type = _CLIENTMESSAGE_TYPE
_CLIENTMESSAGE.fields_by_name['data'].message_type = _DATAPROLOGUE
_CLIENTMESSAGE.fields_by_name['feedback'].message_type = _FEEDBACK
_CLIENTMESSAGE_TYPE.containing_type = _CLIENTMESSAGE
DESCRIPTOR.message_types_by_name['Register'] = _REGISTER
DESCRIPTOR.message_types_by_name['ServerMessage'] = _SERVERMESSAGE
DESCRIPTOR.message_types_by_name['WorkerCommand'] = _WORKERCOMMAND
......@@ -381,6 +489,8 @@ DESCRIPTOR.message_types_by_name['WorkerResponse'] = _WORKERRESPONSE
DESCRIPTOR.message_types_by_name['Announce'] = _ANNOUNCE
DESCRIPTOR.message_types_by_name['DataPrologue'] = _DATAPROLOGUE
DESCRIPTOR.message_types_by_name['Data'] = _DATA
DESCRIPTOR.message_types_by_name['Feedback'] = _FEEDBACK
DESCRIPTOR.message_types_by_name['ClientMessage'] = _CLIENTMESSAGE
Register = _reflection.GeneratedProtocolMessageType('Register', (_message.Message,), dict(
DESCRIPTOR = _REGISTER,
......@@ -431,6 +541,20 @@ Data = _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), dic
))
_sym_db.RegisterMessage(Data)
Feedback = _reflection.GeneratedProtocolMessageType('Feedback', (_message.Message,), dict(
DESCRIPTOR = _FEEDBACK,
__module__ = 'loomcomm_pb2'
# @@protoc_insertion_point(class_scope:loomcomm.Feedback)
))
_sym_db.RegisterMessage(Feedback)
ClientMessage = _reflection.GeneratedProtocolMessageType('ClientMessage', (_message.Message,), dict(
DESCRIPTOR = _CLIENTMESSAGE,
__module__ = 'loomcomm_pb2'
# @@protoc_insertion_point(class_scope:loomcomm.ClientMessage)
))
_sym_db.RegisterMessage(ClientMessage)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('H\003'))
......
......@@ -23,6 +23,8 @@ void protobuf_ShutdownFile_loomcomm_2eproto() {
delete Announce::default_instance_;
delete DataPrologue::default_instance_;
delete Data::default_instance_;
delete Feedback::default_instance_;
delete ClientMessage::default_instance_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
......@@ -44,6 +46,8 @@ void protobuf_AddDesc_loomcomm_2eproto() {
Announce::default_instance_ = new Announce();
DataPrologue::default_instance_ = new DataPrologue();
Data::default_instance_ = new Data();
Feedback::default_instance_ = new Feedback();
ClientMessage::default_instance_ = new ClientMessage();
Register::default_instance_->InitAsDefaultInstance();
ServerMessage::default_instance_->InitAsDefaultInstance();
WorkerCommand::default_instance_->InitAsDefaultInstance();
......@@ -51,6 +55,8 @@ void protobuf_AddDesc_loomcomm_2eproto() {
Announce::default_instance_->InitAsDefaultInstance();
DataPrologue::default_instance_->InitAsDefaultInstance();
Data::default_instance_->InitAsDefaultInstance();
Feedback::default_instance_->InitAsDefaultInstance();
ClientMessage::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_loomcomm_2eproto);
}
......@@ -1860,6 +1866,548 @@ void Data::Swap(Data* other) {
}
// ===================================================================
#ifndef _MSC_VER
const int Feedback::kIdFieldNumber;
const int Feedback::kWorkerFieldNumber;
#endif // !_MSC_VER
Feedback::Feedback()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:loomcomm.Feedback)
}
void Feedback::InitAsDefaultInstance() {
}
Feedback::Feedback(const Feedback& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:loomcomm.Feedback)
}
void Feedback::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
id_ = 0;
worker_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Feedback::~Feedback() {
// @@protoc_insertion_point(destructor:loomcomm.Feedback)
SharedDtor();
}
void Feedback::SharedDtor() {
if (worker_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete worker_;
}
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
}
}
void Feedback::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const Feedback& Feedback::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_loomcomm_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_loomcomm_2eproto();
#endif
return *default_instance_;
}
Feedback* Feedback::default_instance_ = NULL;
Feedback* Feedback::New() const {
return new Feedback;
}
void Feedback::Clear() {
if (_has_bits_[0 / 32] & 3) {
id_ = 0;
if (has_worker()) {
if (worker_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
worker_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool Feedback::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:loomcomm.Feedback)
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)) {
// required int32 id = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &id_)));
set_has_id();
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_worker;
break;
}
// required string worker = 2;
case 2: {
if (tag == 18) {
parse_worker:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_worker()));
} 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, &unknown_fields_stream));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:loomcomm.Feedback)
return true;
failure:
// @@protoc_insertion_point(parse_failure:loomcomm.Feedback)
return false;
#undef DO_
}
void Feedback::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:loomcomm.Feedback)
// required int32 id = 1;
if (has_id()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output);
}
// required string worker = 2;
if (has_worker()) {
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->worker(), output);
}
output->WriteRaw(unknown_fields().data(),
unknown_fields().size());
// @@protoc_insertion_point(serialize_end:loomcomm.Feedback)
}
int Feedback::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required int32 id = 1;
if (has_id()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->id());
}
// required string worker = 2;
if (has_worker()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->worker());
}
}
total_size += unknown_fields().size();
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Feedback::CheckTypeAndMergeFrom(
const ::google::protobuf::MessageLite& from) {
MergeFrom(*::google::protobuf::down_cast<const Feedback*>(&from));
}
void Feedback::MergeFrom(const Feedback& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_id()) {
set_id(from.id());
}
if (from.has_worker()) {
set_worker(from.worker());
}
}
mutable_unknown_fields()->append(from.unknown_fields());
}
void Feedback::CopyFrom(const Feedback& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Feedback::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void Feedback::Swap(Feedback* other) {
if (other != this) {
std::swap(id_, other->id_);
std::swap(worker_, other->worker_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.swap(other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::std::string Feedback::GetTypeName() const {
return "loomcomm.Feedback";
}
// ===================================================================
bool ClientMessage_Type_IsValid(int value) {
switch(value) {
case 1:
case 2:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const ClientMessage_Type ClientMessage::DATA;
const ClientMessage_Type ClientMessage::FEEDBACK;
const ClientMessage_Type ClientMessage::Type_MIN;
const ClientMessage_Type ClientMessage::Type_MAX;
const int ClientMessage::Type_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int ClientMessage::kTypeFieldNumber;
const int ClientMessage::kDataFieldNumber;
const int ClientMessage::kFeedbackFieldNumber;
#endif // !_MSC_VER
ClientMessage::ClientMessage()
: ::google::protobuf::MessageLite() {
SharedCtor();
// @@protoc_insertion_point(constructor:loomcomm.ClientMessage)
}
void ClientMessage::InitAsDefaultInstance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
data_ = const_cast< ::loomcomm::DataPrologue*>(
::loomcomm::DataPrologue::internal_default_instance());
#else
data_ = const_cast< ::loomcomm::DataPrologue*>(&::loomcomm::DataPrologue::default_instance());
#endif
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
feedback_ = const_cast< ::loomcomm::Feedback*>(
::loomcomm::Feedback::internal_default_instance());
#else
feedback_ = const_cast< ::loomcomm::Feedback*>(&::loomcomm::Feedback::default_instance());
#endif
}
ClientMessage::ClientMessage(const ClientMessage& from)
: ::google::protobuf::MessageLite() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:loomcomm.ClientMessage)
}
void ClientMessage::SharedCtor() {
_cached_size_ = 0;
type_ = 1;
data_ = NULL;
feedback_ = NULL;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
ClientMessage::~ClientMessage() {
// @@protoc_insertion_point(destructor:loomcomm.ClientMessage)
SharedDtor();
}
void ClientMessage::SharedDtor() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
if (this != &default_instance()) {
#else
if (this != default_instance_) {
#endif
delete data_;
delete feedback_;
}
}
void ClientMessage::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ClientMessage& ClientMessage::default_instance() {
#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_AddDesc_loomcomm_2eproto();
#else
if (default_instance_ == NULL) protobuf_AddDesc_loomcomm_2eproto();
#endif
return *default_instance_;
}
ClientMessage* ClientMessage::default_instance_ = NULL;
ClientMessage* ClientMessage::New() const {
return new ClientMessage;
}
void ClientMessage::Clear() {
if (_has_bits_[0 / 32] & 7) {
type_ = 1;
if (has_data()) {
if (data_ != NULL) data_->::loomcomm::DataPrologue::Clear();
}
if (has_feedback()) {
if (feedback_ != NULL) feedback_->::loomcomm::Feedback::Clear();
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->clear();
}
bool ClientMessage::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
::google::protobuf::io::StringOutputStream unknown_fields_string(
mutable_unknown_fields());
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
&unknown_fields_string);
// @@protoc_insertion_point(parse_start:loomcomm.ClientMessage)
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)) {
// required .loomcomm.ClientMessage.Type type = 1;
case 1: {
if (tag == 8) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::loomcomm::ClientMessage_Type_IsValid(value)) {
set_type(static_cast< ::loomcomm::ClientMessage_Type >(value));
} else {
unknown_fields_stream.WriteVarint32(tag);
unknown_fields_stream.WriteVarint32(value);
}
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_data;
break;
}
// optional .loomcomm.DataPrologue data = 2;
case 2: {
if (tag == 18) {
parse_data:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_data()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(26)) goto parse_feedback;
break;
}
// optional .loomcomm.Feedback feedback = 3;
case 3: {
if (tag == 26) {
parse_feedback:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_feedback()));
} 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;
}