First draft of the remote API

This commit is contained in:
emeric
2014-03-25 14:08:51 +01:00
parent ce14803964
commit cbebcf63f0
16 changed files with 16922 additions and 0 deletions
Binary file not shown.
+625
View File
@@ -0,0 +1,625 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: auth.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "auth.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.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* AuthRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
AuthRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* AuthResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
AuthResponse_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_auth_2eproto() {
protobuf_AddDesc_auth_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"auth.proto");
GOOGLE_CHECK(file != NULL);
AuthRequest_descriptor_ = file->message_type(0);
static const int AuthRequest_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthRequest, user_name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthRequest, user_password_),
};
AuthRequest_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
AuthRequest_descriptor_,
AuthRequest::default_instance_,
AuthRequest_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthRequest, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthRequest, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(AuthRequest));
AuthResponse_descriptor_ = file->message_type(1);
static const int AuthResponse_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthResponse, error_),
};
AuthResponse_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
AuthResponse_descriptor_,
AuthResponse::default_instance_,
AuthResponse_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthResponse, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AuthResponse, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(AuthResponse));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_auth_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
AuthRequest_descriptor_, &AuthRequest::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
AuthResponse_descriptor_, &AuthResponse::default_instance());
}
} // namespace
void protobuf_ShutdownFile_auth_2eproto() {
delete AuthRequest::default_instance_;
delete AuthRequest_reflection_;
delete AuthResponse::default_instance_;
delete AuthResponse_reflection_;
}
void protobuf_AddDesc_auth_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::protobuf_AddDesc_common_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\nauth.proto\032\014common.proto\"7\n\013AuthReques"
"t\022\021\n\tuser_name\030\001 \002(\t\022\025\n\ruser_password\030\002 "
"\002(\t\"%\n\014AuthResponse\022\025\n\005error\030\001 \002(\0132\006.Err"
"or", 122);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"auth.proto", &protobuf_RegisterTypes);
AuthRequest::default_instance_ = new AuthRequest();
AuthResponse::default_instance_ = new AuthResponse();
AuthRequest::default_instance_->InitAsDefaultInstance();
AuthResponse::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_auth_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_auth_2eproto {
StaticDescriptorInitializer_auth_2eproto() {
protobuf_AddDesc_auth_2eproto();
}
} static_descriptor_initializer_auth_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int AuthRequest::kUserNameFieldNumber;
const int AuthRequest::kUserPasswordFieldNumber;
#endif // !_MSC_VER
AuthRequest::AuthRequest()
: ::google::protobuf::Message() {
SharedCtor();
}
void AuthRequest::InitAsDefaultInstance() {
}
AuthRequest::AuthRequest(const AuthRequest& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void AuthRequest::SharedCtor() {
_cached_size_ = 0;
user_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
user_password_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
AuthRequest::~AuthRequest() {
SharedDtor();
}
void AuthRequest::SharedDtor() {
if (user_name_ != &::google::protobuf::internal::kEmptyString) {
delete user_name_;
}
if (user_password_ != &::google::protobuf::internal::kEmptyString) {
delete user_password_;
}
if (this != default_instance_) {
}
}
void AuthRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AuthRequest::descriptor() {
protobuf_AssignDescriptorsOnce();
return AuthRequest_descriptor_;
}
const AuthRequest& AuthRequest::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_auth_2eproto();
return *default_instance_;
}
AuthRequest* AuthRequest::default_instance_ = NULL;
AuthRequest* AuthRequest::New() const {
return new AuthRequest;
}
void AuthRequest::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_user_name()) {
if (user_name_ != &::google::protobuf::internal::kEmptyString) {
user_name_->clear();
}
}
if (has_user_password()) {
if (user_password_ != &::google::protobuf::internal::kEmptyString) {
user_password_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool AuthRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required string user_name = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_user_name()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_name().data(), this->user_name().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_user_password;
break;
}
// required string user_password = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_user_password:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_user_password()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_password().data(), this->user_password().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void AuthRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required string user_name = 1;
if (has_user_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_name().data(), this->user_name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->user_name(), output);
}
// required string user_password = 2;
if (has_user_password()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_password().data(), this->user_password().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->user_password(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* AuthRequest::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required string user_name = 1;
if (has_user_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_name().data(), this->user_name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->user_name(), target);
}
// required string user_password = 2;
if (has_user_password()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->user_password().data(), this->user_password().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->user_password(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int AuthRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required string user_name = 1;
if (has_user_name()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->user_name());
}
// required string user_password = 2;
if (has_user_password()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->user_password());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void AuthRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const AuthRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const AuthRequest*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void AuthRequest::MergeFrom(const AuthRequest& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_user_name()) {
set_user_name(from.user_name());
}
if (from.has_user_password()) {
set_user_password(from.user_password());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void AuthRequest::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AuthRequest::CopyFrom(const AuthRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AuthRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void AuthRequest::Swap(AuthRequest* other) {
if (other != this) {
std::swap(user_name_, other->user_name_);
std::swap(user_password_, other->user_password_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata AuthRequest::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = AuthRequest_descriptor_;
metadata.reflection = AuthRequest_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int AuthResponse::kErrorFieldNumber;
#endif // !_MSC_VER
AuthResponse::AuthResponse()
: ::google::protobuf::Message() {
SharedCtor();
}
void AuthResponse::InitAsDefaultInstance() {
error_ = const_cast< ::Error*>(&::Error::default_instance());
}
AuthResponse::AuthResponse(const AuthResponse& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void AuthResponse::SharedCtor() {
_cached_size_ = 0;
error_ = NULL;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
AuthResponse::~AuthResponse() {
SharedDtor();
}
void AuthResponse::SharedDtor() {
if (this != default_instance_) {
delete error_;
}
}
void AuthResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AuthResponse::descriptor() {
protobuf_AssignDescriptorsOnce();
return AuthResponse_descriptor_;
}
const AuthResponse& AuthResponse::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_auth_2eproto();
return *default_instance_;
}
AuthResponse* AuthResponse::default_instance_ = NULL;
AuthResponse* AuthResponse::New() const {
return new AuthResponse;
}
void AuthResponse::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_error()) {
if (error_ != NULL) error_->::Error::Clear();
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool AuthResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .Error error = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_error()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void AuthResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required .Error error = 1;
if (has_error()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->error(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* AuthResponse::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required .Error error = 1;
if (has_error()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
1, this->error(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int AuthResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .Error error = 1;
if (has_error()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->error());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void AuthResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const AuthResponse* source =
::google::protobuf::internal::dynamic_cast_if_available<const AuthResponse*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void AuthResponse::MergeFrom(const AuthResponse& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_error()) {
mutable_error()->::Error::MergeFrom(from.error());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void AuthResponse::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void AuthResponse::CopyFrom(const AuthResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool AuthResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (has_error()) {
if (!this->error().IsInitialized()) return false;
}
return true;
}
void AuthResponse::Swap(AuthResponse* other) {
if (other != this) {
std::swap(error_, other->error_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata AuthResponse::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = AuthResponse_descriptor_;
metadata.reflection = AuthResponse_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
// @@protoc_insertion_point(global_scope)
+427
View File
@@ -0,0 +1,427 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: auth.proto
#ifndef PROTOBUF_auth_2eproto__INCLUDED
#define PROTOBUF_auth_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
#include "common.pb.h"
// @@protoc_insertion_point(includes)
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_auth_2eproto();
void protobuf_AssignDesc_auth_2eproto();
void protobuf_ShutdownFile_auth_2eproto();
class AuthRequest;
class AuthResponse;
// ===================================================================
class AuthRequest : public ::google::protobuf::Message {
public:
AuthRequest();
virtual ~AuthRequest();
AuthRequest(const AuthRequest& from);
inline AuthRequest& operator=(const AuthRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const AuthRequest& default_instance();
void Swap(AuthRequest* other);
// implements Message ----------------------------------------------
AuthRequest* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const AuthRequest& from);
void MergeFrom(const AuthRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required string user_name = 1;
inline bool has_user_name() const;
inline void clear_user_name();
static const int kUserNameFieldNumber = 1;
inline const ::std::string& user_name() const;
inline void set_user_name(const ::std::string& value);
inline void set_user_name(const char* value);
inline void set_user_name(const char* value, size_t size);
inline ::std::string* mutable_user_name();
inline ::std::string* release_user_name();
inline void set_allocated_user_name(::std::string* user_name);
// required string user_password = 2;
inline bool has_user_password() const;
inline void clear_user_password();
static const int kUserPasswordFieldNumber = 2;
inline const ::std::string& user_password() const;
inline void set_user_password(const ::std::string& value);
inline void set_user_password(const char* value);
inline void set_user_password(const char* value, size_t size);
inline ::std::string* mutable_user_password();
inline ::std::string* release_user_password();
inline void set_allocated_user_password(::std::string* user_password);
// @@protoc_insertion_point(class_scope:AuthRequest)
private:
inline void set_has_user_name();
inline void clear_has_user_name();
inline void set_has_user_password();
inline void clear_has_user_password();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* user_name_;
::std::string* user_password_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_auth_2eproto();
friend void protobuf_AssignDesc_auth_2eproto();
friend void protobuf_ShutdownFile_auth_2eproto();
void InitAsDefaultInstance();
static AuthRequest* default_instance_;
};
// -------------------------------------------------------------------
class AuthResponse : public ::google::protobuf::Message {
public:
AuthResponse();
virtual ~AuthResponse();
AuthResponse(const AuthResponse& from);
inline AuthResponse& operator=(const AuthResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const AuthResponse& default_instance();
void Swap(AuthResponse* other);
// implements Message ----------------------------------------------
AuthResponse* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const AuthResponse& from);
void MergeFrom(const AuthResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required .Error error = 1;
inline bool has_error() const;
inline void clear_error();
static const int kErrorFieldNumber = 1;
inline const ::Error& error() const;
inline ::Error* mutable_error();
inline ::Error* release_error();
inline void set_allocated_error(::Error* error);
// @@protoc_insertion_point(class_scope:AuthResponse)
private:
inline void set_has_error();
inline void clear_has_error();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::Error* error_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
friend void protobuf_AddDesc_auth_2eproto();
friend void protobuf_AssignDesc_auth_2eproto();
friend void protobuf_ShutdownFile_auth_2eproto();
void InitAsDefaultInstance();
static AuthResponse* default_instance_;
};
// ===================================================================
// ===================================================================
// AuthRequest
// required string user_name = 1;
inline bool AuthRequest::has_user_name() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void AuthRequest::set_has_user_name() {
_has_bits_[0] |= 0x00000001u;
}
inline void AuthRequest::clear_has_user_name() {
_has_bits_[0] &= ~0x00000001u;
}
inline void AuthRequest::clear_user_name() {
if (user_name_ != &::google::protobuf::internal::kEmptyString) {
user_name_->clear();
}
clear_has_user_name();
}
inline const ::std::string& AuthRequest::user_name() const {
return *user_name_;
}
inline void AuthRequest::set_user_name(const ::std::string& value) {
set_has_user_name();
if (user_name_ == &::google::protobuf::internal::kEmptyString) {
user_name_ = new ::std::string;
}
user_name_->assign(value);
}
inline void AuthRequest::set_user_name(const char* value) {
set_has_user_name();
if (user_name_ == &::google::protobuf::internal::kEmptyString) {
user_name_ = new ::std::string;
}
user_name_->assign(value);
}
inline void AuthRequest::set_user_name(const char* value, size_t size) {
set_has_user_name();
if (user_name_ == &::google::protobuf::internal::kEmptyString) {
user_name_ = new ::std::string;
}
user_name_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* AuthRequest::mutable_user_name() {
set_has_user_name();
if (user_name_ == &::google::protobuf::internal::kEmptyString) {
user_name_ = new ::std::string;
}
return user_name_;
}
inline ::std::string* AuthRequest::release_user_name() {
clear_has_user_name();
if (user_name_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = user_name_;
user_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void AuthRequest::set_allocated_user_name(::std::string* user_name) {
if (user_name_ != &::google::protobuf::internal::kEmptyString) {
delete user_name_;
}
if (user_name) {
set_has_user_name();
user_name_ = user_name;
} else {
clear_has_user_name();
user_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// required string user_password = 2;
inline bool AuthRequest::has_user_password() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void AuthRequest::set_has_user_password() {
_has_bits_[0] |= 0x00000002u;
}
inline void AuthRequest::clear_has_user_password() {
_has_bits_[0] &= ~0x00000002u;
}
inline void AuthRequest::clear_user_password() {
if (user_password_ != &::google::protobuf::internal::kEmptyString) {
user_password_->clear();
}
clear_has_user_password();
}
inline const ::std::string& AuthRequest::user_password() const {
return *user_password_;
}
inline void AuthRequest::set_user_password(const ::std::string& value) {
set_has_user_password();
if (user_password_ == &::google::protobuf::internal::kEmptyString) {
user_password_ = new ::std::string;
}
user_password_->assign(value);
}
inline void AuthRequest::set_user_password(const char* value) {
set_has_user_password();
if (user_password_ == &::google::protobuf::internal::kEmptyString) {
user_password_ = new ::std::string;
}
user_password_->assign(value);
}
inline void AuthRequest::set_user_password(const char* value, size_t size) {
set_has_user_password();
if (user_password_ == &::google::protobuf::internal::kEmptyString) {
user_password_ = new ::std::string;
}
user_password_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* AuthRequest::mutable_user_password() {
set_has_user_password();
if (user_password_ == &::google::protobuf::internal::kEmptyString) {
user_password_ = new ::std::string;
}
return user_password_;
}
inline ::std::string* AuthRequest::release_user_password() {
clear_has_user_password();
if (user_password_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = user_password_;
user_password_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void AuthRequest::set_allocated_user_password(::std::string* user_password) {
if (user_password_ != &::google::protobuf::internal::kEmptyString) {
delete user_password_;
}
if (user_password) {
set_has_user_password();
user_password_ = user_password;
} else {
clear_has_user_password();
user_password_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// -------------------------------------------------------------------
// AuthResponse
// required .Error error = 1;
inline bool AuthResponse::has_error() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void AuthResponse::set_has_error() {
_has_bits_[0] |= 0x00000001u;
}
inline void AuthResponse::clear_has_error() {
_has_bits_[0] &= ~0x00000001u;
}
inline void AuthResponse::clear_error() {
if (error_ != NULL) error_->::Error::Clear();
clear_has_error();
}
inline const ::Error& AuthResponse::error() const {
return error_ != NULL ? *error_ : *default_instance_->error_;
}
inline ::Error* AuthResponse::mutable_error() {
set_has_error();
if (error_ == NULL) error_ = new ::Error;
return error_;
}
inline ::Error* AuthResponse::release_error() {
clear_has_error();
::Error* temp = error_;
error_ = NULL;
return temp;
}
inline void AuthResponse::set_allocated_error(::Error* error) {
delete error_;
error_ = error;
if (error) {
set_has_error();
} else {
clear_has_error();
}
}
// @@protoc_insertion_point(namespace_scope)
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_auth_2eproto__INCLUDED
+13
View File
@@ -0,0 +1,13 @@
import "common.proto";
message AuthRequest
{
required string user_name = 1;
required string user_password = 2;
}
message AuthResponse
{
required Error error = 1;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+155
View File
@@ -0,0 +1,155 @@
import "common.proto";
message CollectionRequest
{
message GetGenreList
{
optional string filter_name = 1; // Genre that contains 'filterName' in its name
optional uint32 preferred_batch_size = 2;
}
message GetArtistList
{
// Search Filters
optional string filter_name = 1; // Artist that contains 'filterName' in its name
repeated string filter_genre = 2; // Artist that has at least a track of the genre
optional uint32 preferred_batch_size = 3;
}
message GetReleaseList
{
// Search filters
optional string filter_name = 1; // Release that contains 'filterName' in its name
repeated string artist_name = 2; // Release that contains at least a track of this artist
repeated string filter_genre = 3; // Release that has at least a track of the genre
optional bool get_cover = 4; // Request cover art for each release
optional uint32 preferred_batch_size = 5;
}
message GetTrackList
{
// Search filters
optional string filter_name = 1; // Track that contains 'filterName' in its name
repeated string release_name = 2; // Track that is part of the release
repeated string artist_name = 3; // Track made by this artist
repeated string filter_genre = 4; // Track that has at least a track of the genre
optional uint32 disc_number = 5; // Track number
optional uint32 track_number = 6; // Disc number
optional bool get_cover = 7; // Request cover art for each track
optional uint32 preferred_batch_size = 8;
}
enum Type
{
TypeGetArtistList = 0;
TypeGetReleaseList = 1;
TypeGetTrackList = 2;
}
required Type type = 1;
optional GetArtistList get_artists = 2;
optional GetReleaseList get_releases = 3;
optional GetTrackList get_tracks = 4;
}
message CollectionResponse
{
enum Type {
TypeGenreList = 1;
TypeArtistList = 2;
TypeReleaseList = 3;
TypeTrackList = 4;
}
required Error error = 1;
required Type type = 2;
optional GenreList genre_list = 3;
optional ArtistList artist_list = 4;
optional ReleaseList release_list = 5;
optional TrackList track_list = 6;
}
message GenreList
{
required bool last = 1;
repeated Genre genres = 2;
}
message ArtistList
{
required bool last = 1;
repeated Artist artists = 2;
}
message ReleaseList
{
required bool last = 1;
repeated Release releases = 2;
}
message TrackList
{
required bool last = 1;
repeated Track tracks = 2;
}
message Genre
{
required string name = 1;
}
message CoverArt
{
optional string mime_type = 1;
repeated bytes data = 2;
}
message Artist
{
required string name = 1;
required uint32 nb_releases = 2;
}
message Release
{
required string name = 1;
required uint32 nb_tracks = 2;
required uint32 duration_secs = 3;
optional CoverArt coverArt = 4;
}
message Track
{
required int64 media_id = 1;
optional uint32 disc_number = 2;
optional uint32 track_number = 3;
optional string artist = 4;
optional string release = 5;
required string name = 6;
required uint32 duration_secs = 7;
optional string release_date = 8;
optional string original_release_date = 9;
repeated string genres = 10;
optional bytes coverArt = 11;
}
+362
View File
@@ -0,0 +1,362 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: common.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "common.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.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* Error_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Error_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_common_2eproto() {
protobuf_AddDesc_common_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"common.proto");
GOOGLE_CHECK(file != NULL);
Error_descriptor_ = file->message_type(0);
static const int Error_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Error, error_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Error, message_),
};
Error_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Error_descriptor_,
Error::default_instance_,
Error_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Error, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Error, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Error));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_common_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Error_descriptor_, &Error::default_instance());
}
} // namespace
void protobuf_ShutdownFile_common_2eproto() {
delete Error::default_instance_;
delete Error_reflection_;
}
void protobuf_AddDesc_common_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\014common.proto\"\'\n\005Error\022\r\n\005error\030\001 \002(\010\022\017"
"\n\007message\030\002 \001(\t", 55);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"common.proto", &protobuf_RegisterTypes);
Error::default_instance_ = new Error();
Error::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_common_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_common_2eproto {
StaticDescriptorInitializer_common_2eproto() {
protobuf_AddDesc_common_2eproto();
}
} static_descriptor_initializer_common_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int Error::kErrorFieldNumber;
const int Error::kMessageFieldNumber;
#endif // !_MSC_VER
Error::Error()
: ::google::protobuf::Message() {
SharedCtor();
}
void Error::InitAsDefaultInstance() {
}
Error::Error(const Error& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void Error::SharedCtor() {
_cached_size_ = 0;
error_ = false;
message_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Error::~Error() {
SharedDtor();
}
void Error::SharedDtor() {
if (message_ != &::google::protobuf::internal::kEmptyString) {
delete message_;
}
if (this != default_instance_) {
}
}
void Error::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Error::descriptor() {
protobuf_AssignDescriptorsOnce();
return Error_descriptor_;
}
const Error& Error::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_common_2eproto();
return *default_instance_;
}
Error* Error::default_instance_ = NULL;
Error* Error::New() const {
return new Error;
}
void Error::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
error_ = false;
if (has_message()) {
if (message_ != &::google::protobuf::internal::kEmptyString) {
message_->clear();
}
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Error::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required bool error = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &error_)));
set_has_error();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_message;
break;
}
// optional string message = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_message:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_message()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void Error::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required bool error = 1;
if (has_error()) {
::google::protobuf::internal::WireFormatLite::WriteBool(1, this->error(), output);
}
// optional string message = 2;
if (has_message()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
2, this->message(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* Error::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required bool error = 1;
if (has_error()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->error(), target);
}
// optional string message = 2;
if (has_message()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->message(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int Error::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required bool error = 1;
if (has_error()) {
total_size += 1 + 1;
}
// optional string message = 2;
if (has_message()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->message());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Error::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Error* source =
::google::protobuf::internal::dynamic_cast_if_available<const Error*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Error::MergeFrom(const Error& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_error()) {
set_error(from.error());
}
if (from.has_message()) {
set_message(from.message());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Error::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Error::CopyFrom(const Error& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Error::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void Error::Swap(Error* other) {
if (other != this) {
std::swap(error_, other->error_);
std::swap(message_, other->message_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata Error::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Error_descriptor_;
metadata.reflection = Error_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
// @@protoc_insertion_point(global_scope)
+246
View File
@@ -0,0 +1,246 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: common.proto
#ifndef PROTOBUF_common_2eproto__INCLUDED
#define PROTOBUF_common_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_common_2eproto();
void protobuf_AssignDesc_common_2eproto();
void protobuf_ShutdownFile_common_2eproto();
class Error;
// ===================================================================
class Error : public ::google::protobuf::Message {
public:
Error();
virtual ~Error();
Error(const Error& from);
inline Error& operator=(const Error& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Error& default_instance();
void Swap(Error* other);
// implements Message ----------------------------------------------
Error* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Error& from);
void MergeFrom(const Error& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required bool error = 1;
inline bool has_error() const;
inline void clear_error();
static const int kErrorFieldNumber = 1;
inline bool error() const;
inline void set_error(bool value);
// optional string message = 2;
inline bool has_message() const;
inline void clear_message();
static const int kMessageFieldNumber = 2;
inline const ::std::string& message() const;
inline void set_message(const ::std::string& value);
inline void set_message(const char* value);
inline void set_message(const char* value, size_t size);
inline ::std::string* mutable_message();
inline ::std::string* release_message();
inline void set_allocated_message(::std::string* message);
// @@protoc_insertion_point(class_scope:Error)
private:
inline void set_has_error();
inline void clear_has_error();
inline void set_has_message();
inline void clear_has_message();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* message_;
bool error_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_common_2eproto();
friend void protobuf_AssignDesc_common_2eproto();
friend void protobuf_ShutdownFile_common_2eproto();
void InitAsDefaultInstance();
static Error* default_instance_;
};
// ===================================================================
// ===================================================================
// Error
// required bool error = 1;
inline bool Error::has_error() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Error::set_has_error() {
_has_bits_[0] |= 0x00000001u;
}
inline void Error::clear_has_error() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Error::clear_error() {
error_ = false;
clear_has_error();
}
inline bool Error::error() const {
return error_;
}
inline void Error::set_error(bool value) {
set_has_error();
error_ = value;
}
// optional string message = 2;
inline bool Error::has_message() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Error::set_has_message() {
_has_bits_[0] |= 0x00000002u;
}
inline void Error::clear_has_message() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Error::clear_message() {
if (message_ != &::google::protobuf::internal::kEmptyString) {
message_->clear();
}
clear_has_message();
}
inline const ::std::string& Error::message() const {
return *message_;
}
inline void Error::set_message(const ::std::string& value) {
set_has_message();
if (message_ == &::google::protobuf::internal::kEmptyString) {
message_ = new ::std::string;
}
message_->assign(value);
}
inline void Error::set_message(const char* value) {
set_has_message();
if (message_ == &::google::protobuf::internal::kEmptyString) {
message_ = new ::std::string;
}
message_->assign(value);
}
inline void Error::set_message(const char* value, size_t size) {
set_has_message();
if (message_ == &::google::protobuf::internal::kEmptyString) {
message_ = new ::std::string;
}
message_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* Error::mutable_message() {
set_has_message();
if (message_ == &::google::protobuf::internal::kEmptyString) {
message_ = new ::std::string;
}
return message_;
}
inline ::std::string* Error::release_message() {
clear_has_message();
if (message_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = message_;
message_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void Error::set_allocated_message(::std::string* message) {
if (message_ != &::google::protobuf::internal::kEmptyString) {
delete message_;
}
if (message) {
set_has_message();
message_ = message;
} else {
clear_has_message();
message_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// @@protoc_insertion_point(namespace_scope)
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_common_2eproto__INCLUDED
+7
View File
@@ -0,0 +1,7 @@
message Error
{
required bool error = 1;
optional string message = 2;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+73
View File
@@ -0,0 +1,73 @@
import "common.proto";
enum CodecType
{
CodecTypeOGG = 1;
}
message MediaRequest
{
message Prepare
{
required int64 id = 1; // Id if the media
required uint32 offset_secs = 2; // Offset in seconds
optional CodecType codec_type = 3; // Codec of the media
optional uint32 audio_bitrate = 4;
// Video specifics
optional uint32 video_bitrate = 5;
optional uint32 audio_stream_idx = 6;
optional uint32 video_stream_idx = 7;
optional uint32 subtitle_stream_idx = 8;
}
message GetPart
{
required uint32 requested_data_size = 1; // Amount of data requested. May receive more or less
}
message Terminate
{
}
enum Type
{
TypeMediaPrepare = 1;
TypeMediaGet = 2;
TypeMediaTerminate = 3;
}
required Type request_type = 1;
optional Prepare prepare = 2;
optional GetPart get_part = 3;
optional Terminate terminate = 4;
} // MediaRequest
message MediaResponse
{
message MediaPart
{
required uint64 byte_offset = 1;
repeated bytes data = 2;
}
enum Type
{
TypeMediaPart = 1;
}
required Error error = 1;
required Type response_type = 2;
optional MediaPart part = 3;
}
+912
View File
@@ -0,0 +1,912 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: messages.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "messages.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.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* ClientMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ClientMessage_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* ClientMessage_Type_descriptor_ = NULL;
const ::google::protobuf::Descriptor* ServerMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
ServerMessage_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* ServerMessage_Type_descriptor_ = NULL;
} // namespace
void protobuf_AssignDesc_messages_2eproto() {
protobuf_AddDesc_messages_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"messages.proto");
GOOGLE_CHECK(file != NULL);
ClientMessage_descriptor_ = file->message_type(0);
static const int ClientMessage_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, auth_request_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, collection_request_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, media_request_),
};
ClientMessage_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
ClientMessage_descriptor_,
ClientMessage::default_instance_,
ClientMessage_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientMessage, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ClientMessage));
ClientMessage_Type_descriptor_ = ClientMessage_descriptor_->enum_type(0);
ServerMessage_descriptor_ = file->message_type(1);
static const int ServerMessage_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, auth_response_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, collection_response_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, media_response_),
};
ServerMessage_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
ServerMessage_descriptor_,
ServerMessage::default_instance_,
ServerMessage_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerMessage, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(ServerMessage));
ServerMessage_Type_descriptor_ = ServerMessage_descriptor_->enum_type(0);
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_messages_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ClientMessage_descriptor_, &ClientMessage::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ServerMessage_descriptor_, &ServerMessage::default_instance());
}
} // namespace
void protobuf_ShutdownFile_messages_2eproto() {
delete ClientMessage::default_instance_;
delete ClientMessage_reflection_;
delete ServerMessage::default_instance_;
delete ServerMessage_reflection_;
}
void protobuf_AddDesc_messages_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::protobuf_AddDesc_common_2eproto();
::protobuf_AddDesc_auth_2eproto();
::protobuf_AddDesc_collection_2eproto();
::protobuf_AddDesc_media_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\016messages.proto\032\014common.proto\032\nauth.pro"
"to\032\020collection.proto\032\013media.proto\"\356\001\n\rCl"
"ientMessage\022!\n\004type\030\001 \002(\0162\023.ClientMessag"
"e.Type\022\"\n\014auth_request\030\002 \001(\0132\014.AuthReque"
"st\022.\n\022collection_request\030\003 \001(\0132\022.Collect"
"ionRequest\022$\n\rmedia_request\030\004 \001(\0132\r.Medi"
"aRequest\"@\n\004Type\022\017\n\013AuthRequest\020\001\022\025\n\021Col"
"lectionRequest\020\002\022\020\n\014MediaRequest\020\003\"\367\001\n\rS"
"erverMessage\022!\n\004type\030\001 \002(\0162\023.ServerMessa"
"ge.Type\022$\n\rauth_response\030\002 \001(\0132\r.AuthRes"
"ponse\0220\n\023collection_response\030\003 \001(\0132\023.Col"
"lectionResponse\022&\n\016media_response\030\004 \001(\0132"
"\016.MediaResponse\"C\n\004Type\022\020\n\014AuthResponse\020"
"\001\022\026\n\022CollectionResponse\020\002\022\021\n\rMediaRespon"
"se\020\003", 564);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"messages.proto", &protobuf_RegisterTypes);
ClientMessage::default_instance_ = new ClientMessage();
ServerMessage::default_instance_ = new ServerMessage();
ClientMessage::default_instance_->InitAsDefaultInstance();
ServerMessage::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_messages_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_messages_2eproto {
StaticDescriptorInitializer_messages_2eproto() {
protobuf_AddDesc_messages_2eproto();
}
} static_descriptor_initializer_messages_2eproto_;
// ===================================================================
const ::google::protobuf::EnumDescriptor* ClientMessage_Type_descriptor() {
protobuf_AssignDescriptorsOnce();
return ClientMessage_Type_descriptor_;
}
bool ClientMessage_Type_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const ClientMessage_Type ClientMessage::AuthRequest;
const ClientMessage_Type ClientMessage::CollectionRequest;
const ClientMessage_Type ClientMessage::MediaRequest;
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::kAuthRequestFieldNumber;
const int ClientMessage::kCollectionRequestFieldNumber;
const int ClientMessage::kMediaRequestFieldNumber;
#endif // !_MSC_VER
ClientMessage::ClientMessage()
: ::google::protobuf::Message() {
SharedCtor();
}
void ClientMessage::InitAsDefaultInstance() {
auth_request_ = const_cast< ::AuthRequest*>(&::AuthRequest::default_instance());
collection_request_ = const_cast< ::CollectionRequest*>(&::CollectionRequest::default_instance());
media_request_ = const_cast< ::MediaRequest*>(&::MediaRequest::default_instance());
}
ClientMessage::ClientMessage(const ClientMessage& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void ClientMessage::SharedCtor() {
_cached_size_ = 0;
type_ = 1;
auth_request_ = NULL;
collection_request_ = NULL;
media_request_ = NULL;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
ClientMessage::~ClientMessage() {
SharedDtor();
}
void ClientMessage::SharedDtor() {
if (this != default_instance_) {
delete auth_request_;
delete collection_request_;
delete media_request_;
}
}
void ClientMessage::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ClientMessage::descriptor() {
protobuf_AssignDescriptorsOnce();
return ClientMessage_descriptor_;
}
const ClientMessage& ClientMessage::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_messages_2eproto();
return *default_instance_;
}
ClientMessage* ClientMessage::default_instance_ = NULL;
ClientMessage* ClientMessage::New() const {
return new ClientMessage;
}
void ClientMessage::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
type_ = 1;
if (has_auth_request()) {
if (auth_request_ != NULL) auth_request_->::AuthRequest::Clear();
}
if (has_collection_request()) {
if (collection_request_ != NULL) collection_request_->::CollectionRequest::Clear();
}
if (has_media_request()) {
if (media_request_ != NULL) media_request_->::MediaRequest::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)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .ClientMessage.Type type = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::ClientMessage_Type_IsValid(value)) {
set_type(static_cast< ::ClientMessage_Type >(value));
} else {
mutable_unknown_fields()->AddVarint(1, value);
}
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_auth_request;
break;
}
// optional .AuthRequest auth_request = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_auth_request:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_auth_request()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_collection_request;
break;
}
// optional .CollectionRequest collection_request = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_collection_request:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_collection_request()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_media_request;
break;
}
// optional .MediaRequest media_request = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_media_request:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_media_request()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void ClientMessage::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required .ClientMessage.Type type = 1;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->type(), output);
}
// optional .AuthRequest auth_request = 2;
if (has_auth_request()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->auth_request(), output);
}
// optional .CollectionRequest collection_request = 3;
if (has_collection_request()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->collection_request(), output);
}
// optional .MediaRequest media_request = 4;
if (has_media_request()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->media_request(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* ClientMessage::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required .ClientMessage.Type type = 1;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->type(), target);
}
// optional .AuthRequest auth_request = 2;
if (has_auth_request()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->auth_request(), target);
}
// optional .CollectionRequest collection_request = 3;
if (has_collection_request()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
3, this->collection_request(), target);
}
// optional .MediaRequest media_request = 4;
if (has_media_request()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->media_request(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int ClientMessage::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .ClientMessage.Type type = 1;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
}
// optional .AuthRequest auth_request = 2;
if (has_auth_request()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->auth_request());
}
// optional .CollectionRequest collection_request = 3;
if (has_collection_request()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->collection_request());
}
// optional .MediaRequest media_request = 4;
if (has_media_request()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->media_request());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ClientMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const ClientMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const ClientMessage*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void ClientMessage::MergeFrom(const ClientMessage& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_type()) {
set_type(from.type());
}
if (from.has_auth_request()) {
mutable_auth_request()->::AuthRequest::MergeFrom(from.auth_request());
}
if (from.has_collection_request()) {
mutable_collection_request()->::CollectionRequest::MergeFrom(from.collection_request());
}
if (from.has_media_request()) {
mutable_media_request()->::MediaRequest::MergeFrom(from.media_request());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void ClientMessage::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ClientMessage::CopyFrom(const ClientMessage& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ClientMessage::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (has_auth_request()) {
if (!this->auth_request().IsInitialized()) return false;
}
if (has_collection_request()) {
if (!this->collection_request().IsInitialized()) return false;
}
if (has_media_request()) {
if (!this->media_request().IsInitialized()) return false;
}
return true;
}
void ClientMessage::Swap(ClientMessage* other) {
if (other != this) {
std::swap(type_, other->type_);
std::swap(auth_request_, other->auth_request_);
std::swap(collection_request_, other->collection_request_);
std::swap(media_request_, other->media_request_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata ClientMessage::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ClientMessage_descriptor_;
metadata.reflection = ClientMessage_reflection_;
return metadata;
}
// ===================================================================
const ::google::protobuf::EnumDescriptor* ServerMessage_Type_descriptor() {
protobuf_AssignDescriptorsOnce();
return ServerMessage_Type_descriptor_;
}
bool ServerMessage_Type_IsValid(int value) {
switch(value) {
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const ServerMessage_Type ServerMessage::AuthResponse;
const ServerMessage_Type ServerMessage::CollectionResponse;
const ServerMessage_Type ServerMessage::MediaResponse;
const ServerMessage_Type ServerMessage::Type_MIN;
const ServerMessage_Type ServerMessage::Type_MAX;
const int ServerMessage::Type_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int ServerMessage::kTypeFieldNumber;
const int ServerMessage::kAuthResponseFieldNumber;
const int ServerMessage::kCollectionResponseFieldNumber;
const int ServerMessage::kMediaResponseFieldNumber;
#endif // !_MSC_VER
ServerMessage::ServerMessage()
: ::google::protobuf::Message() {
SharedCtor();
}
void ServerMessage::InitAsDefaultInstance() {
auth_response_ = const_cast< ::AuthResponse*>(&::AuthResponse::default_instance());
collection_response_ = const_cast< ::CollectionResponse*>(&::CollectionResponse::default_instance());
media_response_ = const_cast< ::MediaResponse*>(&::MediaResponse::default_instance());
}
ServerMessage::ServerMessage(const ServerMessage& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void ServerMessage::SharedCtor() {
_cached_size_ = 0;
type_ = 1;
auth_response_ = NULL;
collection_response_ = NULL;
media_response_ = NULL;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
ServerMessage::~ServerMessage() {
SharedDtor();
}
void ServerMessage::SharedDtor() {
if (this != default_instance_) {
delete auth_response_;
delete collection_response_;
delete media_response_;
}
}
void ServerMessage::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ServerMessage::descriptor() {
protobuf_AssignDescriptorsOnce();
return ServerMessage_descriptor_;
}
const ServerMessage& ServerMessage::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_messages_2eproto();
return *default_instance_;
}
ServerMessage* ServerMessage::default_instance_ = NULL;
ServerMessage* ServerMessage::New() const {
return new ServerMessage;
}
void ServerMessage::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
type_ = 1;
if (has_auth_response()) {
if (auth_response_ != NULL) auth_response_->::AuthResponse::Clear();
}
if (has_collection_response()) {
if (collection_response_ != NULL) collection_response_->::CollectionResponse::Clear();
}
if (has_media_response()) {
if (media_response_ != NULL) media_response_->::MediaResponse::Clear();
}
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool ServerMessage::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .ServerMessage.Type type = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::ServerMessage_Type_IsValid(value)) {
set_type(static_cast< ::ServerMessage_Type >(value));
} else {
mutable_unknown_fields()->AddVarint(1, value);
}
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(18)) goto parse_auth_response;
break;
}
// optional .AuthResponse auth_response = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_auth_response:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_auth_response()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_collection_response;
break;
}
// optional .CollectionResponse collection_response = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_collection_response:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_collection_response()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(34)) goto parse_media_response;
break;
}
// optional .MediaResponse media_response = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_media_response:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_media_response()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void ServerMessage::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required .ServerMessage.Type type = 1;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->type(), output);
}
// optional .AuthResponse auth_response = 2;
if (has_auth_response()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->auth_response(), output);
}
// optional .CollectionResponse collection_response = 3;
if (has_collection_response()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->collection_response(), output);
}
// optional .MediaResponse media_response = 4;
if (has_media_response()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->media_response(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* ServerMessage::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required .ServerMessage.Type type = 1;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->type(), target);
}
// optional .AuthResponse auth_response = 2;
if (has_auth_response()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->auth_response(), target);
}
// optional .CollectionResponse collection_response = 3;
if (has_collection_response()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
3, this->collection_response(), target);
}
// optional .MediaResponse media_response = 4;
if (has_media_response()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->media_response(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int ServerMessage::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .ServerMessage.Type type = 1;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
}
// optional .AuthResponse auth_response = 2;
if (has_auth_response()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->auth_response());
}
// optional .CollectionResponse collection_response = 3;
if (has_collection_response()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->collection_response());
}
// optional .MediaResponse media_response = 4;
if (has_media_response()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->media_response());
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ServerMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const ServerMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const ServerMessage*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void ServerMessage::MergeFrom(const ServerMessage& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_type()) {
set_type(from.type());
}
if (from.has_auth_response()) {
mutable_auth_response()->::AuthResponse::MergeFrom(from.auth_response());
}
if (from.has_collection_response()) {
mutable_collection_response()->::CollectionResponse::MergeFrom(from.collection_response());
}
if (from.has_media_response()) {
mutable_media_response()->::MediaResponse::MergeFrom(from.media_response());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void ServerMessage::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ServerMessage::CopyFrom(const ServerMessage& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ServerMessage::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (has_auth_response()) {
if (!this->auth_response().IsInitialized()) return false;
}
if (has_collection_response()) {
if (!this->collection_response().IsInitialized()) return false;
}
if (has_media_response()) {
if (!this->media_response().IsInitialized()) return false;
}
return true;
}
void ServerMessage::Swap(ServerMessage* other) {
if (other != this) {
std::swap(type_, other->type_);
std::swap(auth_response_, other->auth_response_);
std::swap(collection_response_, other->collection_response_);
std::swap(media_response_, other->media_response_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata ServerMessage::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ServerMessage_descriptor_;
metadata.reflection = ServerMessage_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
// @@protoc_insertion_point(global_scope)
+675
View File
@@ -0,0 +1,675 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: messages.proto
#ifndef PROTOBUF_messages_2eproto__INCLUDED
#define PROTOBUF_messages_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
#include "common.pb.h"
#include "auth.pb.h"
#include "collection.pb.h"
#include "media.pb.h"
// @@protoc_insertion_point(includes)
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_messages_2eproto();
void protobuf_AssignDesc_messages_2eproto();
void protobuf_ShutdownFile_messages_2eproto();
class ClientMessage;
class ServerMessage;
enum ClientMessage_Type {
ClientMessage_Type_AuthRequest = 1,
ClientMessage_Type_CollectionRequest = 2,
ClientMessage_Type_MediaRequest = 3
};
bool ClientMessage_Type_IsValid(int value);
const ClientMessage_Type ClientMessage_Type_Type_MIN = ClientMessage_Type_AuthRequest;
const ClientMessage_Type ClientMessage_Type_Type_MAX = ClientMessage_Type_MediaRequest;
const int ClientMessage_Type_Type_ARRAYSIZE = ClientMessage_Type_Type_MAX + 1;
const ::google::protobuf::EnumDescriptor* ClientMessage_Type_descriptor();
inline const ::std::string& ClientMessage_Type_Name(ClientMessage_Type value) {
return ::google::protobuf::internal::NameOfEnum(
ClientMessage_Type_descriptor(), value);
}
inline bool ClientMessage_Type_Parse(
const ::std::string& name, ClientMessage_Type* value) {
return ::google::protobuf::internal::ParseNamedEnum<ClientMessage_Type>(
ClientMessage_Type_descriptor(), name, value);
}
enum ServerMessage_Type {
ServerMessage_Type_AuthResponse = 1,
ServerMessage_Type_CollectionResponse = 2,
ServerMessage_Type_MediaResponse = 3
};
bool ServerMessage_Type_IsValid(int value);
const ServerMessage_Type ServerMessage_Type_Type_MIN = ServerMessage_Type_AuthResponse;
const ServerMessage_Type ServerMessage_Type_Type_MAX = ServerMessage_Type_MediaResponse;
const int ServerMessage_Type_Type_ARRAYSIZE = ServerMessage_Type_Type_MAX + 1;
const ::google::protobuf::EnumDescriptor* ServerMessage_Type_descriptor();
inline const ::std::string& ServerMessage_Type_Name(ServerMessage_Type value) {
return ::google::protobuf::internal::NameOfEnum(
ServerMessage_Type_descriptor(), value);
}
inline bool ServerMessage_Type_Parse(
const ::std::string& name, ServerMessage_Type* value) {
return ::google::protobuf::internal::ParseNamedEnum<ServerMessage_Type>(
ServerMessage_Type_descriptor(), name, value);
}
// ===================================================================
class ClientMessage : public ::google::protobuf::Message {
public:
ClientMessage();
virtual ~ClientMessage();
ClientMessage(const ClientMessage& from);
inline ClientMessage& operator=(const ClientMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const ClientMessage& default_instance();
void Swap(ClientMessage* other);
// implements Message ----------------------------------------------
ClientMessage* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ClientMessage& from);
void MergeFrom(const ClientMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef ClientMessage_Type Type;
static const Type AuthRequest = ClientMessage_Type_AuthRequest;
static const Type CollectionRequest = ClientMessage_Type_CollectionRequest;
static const Type MediaRequest = ClientMessage_Type_MediaRequest;
static inline bool Type_IsValid(int value) {
return ClientMessage_Type_IsValid(value);
}
static const Type Type_MIN =
ClientMessage_Type_Type_MIN;
static const Type Type_MAX =
ClientMessage_Type_Type_MAX;
static const int Type_ARRAYSIZE =
ClientMessage_Type_Type_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Type_descriptor() {
return ClientMessage_Type_descriptor();
}
static inline const ::std::string& Type_Name(Type value) {
return ClientMessage_Type_Name(value);
}
static inline bool Type_Parse(const ::std::string& name,
Type* value) {
return ClientMessage_Type_Parse(name, value);
}
// accessors -------------------------------------------------------
// required .ClientMessage.Type type = 1;
inline bool has_type() const;
inline void clear_type();
static const int kTypeFieldNumber = 1;
inline ::ClientMessage_Type type() const;
inline void set_type(::ClientMessage_Type value);
// optional .AuthRequest auth_request = 2;
inline bool has_auth_request() const;
inline void clear_auth_request();
static const int kAuthRequestFieldNumber = 2;
inline const ::AuthRequest& auth_request() const;
inline ::AuthRequest* mutable_auth_request();
inline ::AuthRequest* release_auth_request();
inline void set_allocated_auth_request(::AuthRequest* auth_request);
// optional .CollectionRequest collection_request = 3;
inline bool has_collection_request() const;
inline void clear_collection_request();
static const int kCollectionRequestFieldNumber = 3;
inline const ::CollectionRequest& collection_request() const;
inline ::CollectionRequest* mutable_collection_request();
inline ::CollectionRequest* release_collection_request();
inline void set_allocated_collection_request(::CollectionRequest* collection_request);
// optional .MediaRequest media_request = 4;
inline bool has_media_request() const;
inline void clear_media_request();
static const int kMediaRequestFieldNumber = 4;
inline const ::MediaRequest& media_request() const;
inline ::MediaRequest* mutable_media_request();
inline ::MediaRequest* release_media_request();
inline void set_allocated_media_request(::MediaRequest* media_request);
// @@protoc_insertion_point(class_scope:ClientMessage)
private:
inline void set_has_type();
inline void clear_has_type();
inline void set_has_auth_request();
inline void clear_has_auth_request();
inline void set_has_collection_request();
inline void clear_has_collection_request();
inline void set_has_media_request();
inline void clear_has_media_request();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::AuthRequest* auth_request_;
::CollectionRequest* collection_request_;
::MediaRequest* media_request_;
int type_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
friend void protobuf_AddDesc_messages_2eproto();
friend void protobuf_AssignDesc_messages_2eproto();
friend void protobuf_ShutdownFile_messages_2eproto();
void InitAsDefaultInstance();
static ClientMessage* default_instance_;
};
// -------------------------------------------------------------------
class ServerMessage : public ::google::protobuf::Message {
public:
ServerMessage();
virtual ~ServerMessage();
ServerMessage(const ServerMessage& from);
inline ServerMessage& operator=(const ServerMessage& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const ServerMessage& default_instance();
void Swap(ServerMessage* other);
// implements Message ----------------------------------------------
ServerMessage* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ServerMessage& from);
void MergeFrom(const ServerMessage& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef ServerMessage_Type Type;
static const Type AuthResponse = ServerMessage_Type_AuthResponse;
static const Type CollectionResponse = ServerMessage_Type_CollectionResponse;
static const Type MediaResponse = ServerMessage_Type_MediaResponse;
static inline bool Type_IsValid(int value) {
return ServerMessage_Type_IsValid(value);
}
static const Type Type_MIN =
ServerMessage_Type_Type_MIN;
static const Type Type_MAX =
ServerMessage_Type_Type_MAX;
static const int Type_ARRAYSIZE =
ServerMessage_Type_Type_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Type_descriptor() {
return ServerMessage_Type_descriptor();
}
static inline const ::std::string& Type_Name(Type value) {
return ServerMessage_Type_Name(value);
}
static inline bool Type_Parse(const ::std::string& name,
Type* value) {
return ServerMessage_Type_Parse(name, value);
}
// accessors -------------------------------------------------------
// required .ServerMessage.Type type = 1;
inline bool has_type() const;
inline void clear_type();
static const int kTypeFieldNumber = 1;
inline ::ServerMessage_Type type() const;
inline void set_type(::ServerMessage_Type value);
// optional .AuthResponse auth_response = 2;
inline bool has_auth_response() const;
inline void clear_auth_response();
static const int kAuthResponseFieldNumber = 2;
inline const ::AuthResponse& auth_response() const;
inline ::AuthResponse* mutable_auth_response();
inline ::AuthResponse* release_auth_response();
inline void set_allocated_auth_response(::AuthResponse* auth_response);
// optional .CollectionResponse collection_response = 3;
inline bool has_collection_response() const;
inline void clear_collection_response();
static const int kCollectionResponseFieldNumber = 3;
inline const ::CollectionResponse& collection_response() const;
inline ::CollectionResponse* mutable_collection_response();
inline ::CollectionResponse* release_collection_response();
inline void set_allocated_collection_response(::CollectionResponse* collection_response);
// optional .MediaResponse media_response = 4;
inline bool has_media_response() const;
inline void clear_media_response();
static const int kMediaResponseFieldNumber = 4;
inline const ::MediaResponse& media_response() const;
inline ::MediaResponse* mutable_media_response();
inline ::MediaResponse* release_media_response();
inline void set_allocated_media_response(::MediaResponse* media_response);
// @@protoc_insertion_point(class_scope:ServerMessage)
private:
inline void set_has_type();
inline void clear_has_type();
inline void set_has_auth_response();
inline void clear_has_auth_response();
inline void set_has_collection_response();
inline void clear_has_collection_response();
inline void set_has_media_response();
inline void clear_has_media_response();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::AuthResponse* auth_response_;
::CollectionResponse* collection_response_;
::MediaResponse* media_response_;
int type_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
friend void protobuf_AddDesc_messages_2eproto();
friend void protobuf_AssignDesc_messages_2eproto();
friend void protobuf_ShutdownFile_messages_2eproto();
void InitAsDefaultInstance();
static ServerMessage* default_instance_;
};
// ===================================================================
// ===================================================================
// ClientMessage
// required .ClientMessage.Type type = 1;
inline bool ClientMessage::has_type() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void ClientMessage::set_has_type() {
_has_bits_[0] |= 0x00000001u;
}
inline void ClientMessage::clear_has_type() {
_has_bits_[0] &= ~0x00000001u;
}
inline void ClientMessage::clear_type() {
type_ = 1;
clear_has_type();
}
inline ::ClientMessage_Type ClientMessage::type() const {
return static_cast< ::ClientMessage_Type >(type_);
}
inline void ClientMessage::set_type(::ClientMessage_Type value) {
assert(::ClientMessage_Type_IsValid(value));
set_has_type();
type_ = value;
}
// optional .AuthRequest auth_request = 2;
inline bool ClientMessage::has_auth_request() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void ClientMessage::set_has_auth_request() {
_has_bits_[0] |= 0x00000002u;
}
inline void ClientMessage::clear_has_auth_request() {
_has_bits_[0] &= ~0x00000002u;
}
inline void ClientMessage::clear_auth_request() {
if (auth_request_ != NULL) auth_request_->::AuthRequest::Clear();
clear_has_auth_request();
}
inline const ::AuthRequest& ClientMessage::auth_request() const {
return auth_request_ != NULL ? *auth_request_ : *default_instance_->auth_request_;
}
inline ::AuthRequest* ClientMessage::mutable_auth_request() {
set_has_auth_request();
if (auth_request_ == NULL) auth_request_ = new ::AuthRequest;
return auth_request_;
}
inline ::AuthRequest* ClientMessage::release_auth_request() {
clear_has_auth_request();
::AuthRequest* temp = auth_request_;
auth_request_ = NULL;
return temp;
}
inline void ClientMessage::set_allocated_auth_request(::AuthRequest* auth_request) {
delete auth_request_;
auth_request_ = auth_request;
if (auth_request) {
set_has_auth_request();
} else {
clear_has_auth_request();
}
}
// optional .CollectionRequest collection_request = 3;
inline bool ClientMessage::has_collection_request() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void ClientMessage::set_has_collection_request() {
_has_bits_[0] |= 0x00000004u;
}
inline void ClientMessage::clear_has_collection_request() {
_has_bits_[0] &= ~0x00000004u;
}
inline void ClientMessage::clear_collection_request() {
if (collection_request_ != NULL) collection_request_->::CollectionRequest::Clear();
clear_has_collection_request();
}
inline const ::CollectionRequest& ClientMessage::collection_request() const {
return collection_request_ != NULL ? *collection_request_ : *default_instance_->collection_request_;
}
inline ::CollectionRequest* ClientMessage::mutable_collection_request() {
set_has_collection_request();
if (collection_request_ == NULL) collection_request_ = new ::CollectionRequest;
return collection_request_;
}
inline ::CollectionRequest* ClientMessage::release_collection_request() {
clear_has_collection_request();
::CollectionRequest* temp = collection_request_;
collection_request_ = NULL;
return temp;
}
inline void ClientMessage::set_allocated_collection_request(::CollectionRequest* collection_request) {
delete collection_request_;
collection_request_ = collection_request;
if (collection_request) {
set_has_collection_request();
} else {
clear_has_collection_request();
}
}
// optional .MediaRequest media_request = 4;
inline bool ClientMessage::has_media_request() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void ClientMessage::set_has_media_request() {
_has_bits_[0] |= 0x00000008u;
}
inline void ClientMessage::clear_has_media_request() {
_has_bits_[0] &= ~0x00000008u;
}
inline void ClientMessage::clear_media_request() {
if (media_request_ != NULL) media_request_->::MediaRequest::Clear();
clear_has_media_request();
}
inline const ::MediaRequest& ClientMessage::media_request() const {
return media_request_ != NULL ? *media_request_ : *default_instance_->media_request_;
}
inline ::MediaRequest* ClientMessage::mutable_media_request() {
set_has_media_request();
if (media_request_ == NULL) media_request_ = new ::MediaRequest;
return media_request_;
}
inline ::MediaRequest* ClientMessage::release_media_request() {
clear_has_media_request();
::MediaRequest* temp = media_request_;
media_request_ = NULL;
return temp;
}
inline void ClientMessage::set_allocated_media_request(::MediaRequest* media_request) {
delete media_request_;
media_request_ = media_request;
if (media_request) {
set_has_media_request();
} else {
clear_has_media_request();
}
}
// -------------------------------------------------------------------
// ServerMessage
// required .ServerMessage.Type type = 1;
inline bool ServerMessage::has_type() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void ServerMessage::set_has_type() {
_has_bits_[0] |= 0x00000001u;
}
inline void ServerMessage::clear_has_type() {
_has_bits_[0] &= ~0x00000001u;
}
inline void ServerMessage::clear_type() {
type_ = 1;
clear_has_type();
}
inline ::ServerMessage_Type ServerMessage::type() const {
return static_cast< ::ServerMessage_Type >(type_);
}
inline void ServerMessage::set_type(::ServerMessage_Type value) {
assert(::ServerMessage_Type_IsValid(value));
set_has_type();
type_ = value;
}
// optional .AuthResponse auth_response = 2;
inline bool ServerMessage::has_auth_response() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void ServerMessage::set_has_auth_response() {
_has_bits_[0] |= 0x00000002u;
}
inline void ServerMessage::clear_has_auth_response() {
_has_bits_[0] &= ~0x00000002u;
}
inline void ServerMessage::clear_auth_response() {
if (auth_response_ != NULL) auth_response_->::AuthResponse::Clear();
clear_has_auth_response();
}
inline const ::AuthResponse& ServerMessage::auth_response() const {
return auth_response_ != NULL ? *auth_response_ : *default_instance_->auth_response_;
}
inline ::AuthResponse* ServerMessage::mutable_auth_response() {
set_has_auth_response();
if (auth_response_ == NULL) auth_response_ = new ::AuthResponse;
return auth_response_;
}
inline ::AuthResponse* ServerMessage::release_auth_response() {
clear_has_auth_response();
::AuthResponse* temp = auth_response_;
auth_response_ = NULL;
return temp;
}
inline void ServerMessage::set_allocated_auth_response(::AuthResponse* auth_response) {
delete auth_response_;
auth_response_ = auth_response;
if (auth_response) {
set_has_auth_response();
} else {
clear_has_auth_response();
}
}
// optional .CollectionResponse collection_response = 3;
inline bool ServerMessage::has_collection_response() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void ServerMessage::set_has_collection_response() {
_has_bits_[0] |= 0x00000004u;
}
inline void ServerMessage::clear_has_collection_response() {
_has_bits_[0] &= ~0x00000004u;
}
inline void ServerMessage::clear_collection_response() {
if (collection_response_ != NULL) collection_response_->::CollectionResponse::Clear();
clear_has_collection_response();
}
inline const ::CollectionResponse& ServerMessage::collection_response() const {
return collection_response_ != NULL ? *collection_response_ : *default_instance_->collection_response_;
}
inline ::CollectionResponse* ServerMessage::mutable_collection_response() {
set_has_collection_response();
if (collection_response_ == NULL) collection_response_ = new ::CollectionResponse;
return collection_response_;
}
inline ::CollectionResponse* ServerMessage::release_collection_response() {
clear_has_collection_response();
::CollectionResponse* temp = collection_response_;
collection_response_ = NULL;
return temp;
}
inline void ServerMessage::set_allocated_collection_response(::CollectionResponse* collection_response) {
delete collection_response_;
collection_response_ = collection_response;
if (collection_response) {
set_has_collection_response();
} else {
clear_has_collection_response();
}
}
// optional .MediaResponse media_response = 4;
inline bool ServerMessage::has_media_response() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void ServerMessage::set_has_media_response() {
_has_bits_[0] |= 0x00000008u;
}
inline void ServerMessage::clear_has_media_response() {
_has_bits_[0] &= ~0x00000008u;
}
inline void ServerMessage::clear_media_response() {
if (media_response_ != NULL) media_response_->::MediaResponse::Clear();
clear_has_media_response();
}
inline const ::MediaResponse& ServerMessage::media_response() const {
return media_response_ != NULL ? *media_response_ : *default_instance_->media_response_;
}
inline ::MediaResponse* ServerMessage::mutable_media_response() {
set_has_media_response();
if (media_response_ == NULL) media_response_ = new ::MediaResponse;
return media_response_;
}
inline ::MediaResponse* ServerMessage::release_media_response() {
clear_has_media_response();
::MediaResponse* temp = media_response_;
media_response_ = NULL;
return temp;
}
inline void ServerMessage::set_allocated_media_response(::MediaResponse* media_response) {
delete media_response_;
media_response_ = media_response;
if (media_response) {
set_has_media_response();
} else {
clear_has_media_response();
}
}
// @@protoc_insertion_point(namespace_scope)
#ifndef SWIG
namespace google {
namespace protobuf {
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::ClientMessage_Type>() {
return ::ClientMessage_Type_descriptor();
}
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::ServerMessage_Type>() {
return ::ServerMessage_Type_descriptor();
}
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_messages_2eproto__INCLUDED
+39
View File
@@ -0,0 +1,39 @@
import "common.proto";
import "auth.proto";
import "collection.proto";
import "media.proto";
message ClientMessage
{
enum Type
{
AuthRequest = 1;
CollectionRequest = 2;
MediaRequest = 3;
}
required Type type = 1;
optional AuthRequest auth_request = 2;
optional CollectionRequest collection_request = 3;
optional MediaRequest media_request = 4;
}
message ServerMessage
{
enum Type
{
AuthResponse = 1;
CollectionResponse = 2;
MediaResponse = 3;
}
required Type type = 1;
optional AuthResponse auth_response = 2;
optional CollectionResponse collection_response = 3;
optional MediaResponse media_response = 4;
}