Add genre list and some comments

This commit is contained in:
emeric
2014-03-27 12:12:42 +01:00
parent a75dfd85b4
commit 7a36a746b9
3 changed files with 200 additions and 102 deletions
+120 -73
View File
@@ -76,8 +76,9 @@ void protobuf_AssignDesc_collection_2eproto() {
"collection.proto"); "collection.proto");
GOOGLE_CHECK(file != NULL); GOOGLE_CHECK(file != NULL);
CollectionRequest_descriptor_ = file->message_type(0); CollectionRequest_descriptor_ = file->message_type(0);
static const int CollectionRequest_offsets_[4] = { static const int CollectionRequest_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_genres_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_artists_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_artists_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_releases_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_releases_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_tracks_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CollectionRequest, get_tracks_),
@@ -430,51 +431,52 @@ void protobuf_AddDesc_collection_2eproto() {
::protobuf_AddDesc_common_2eproto(); ::protobuf_AddDesc_common_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile( ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\020collection.proto\032\014common.proto\"\220\006\n\021Col" "\n\020collection.proto\032\014common.proto\"\305\006\n\021Col"
"lectionRequest\022%\n\004type\030\001 \002(\0162\027.Collectio" "lectionRequest\022%\n\004type\030\001 \002(\0162\027.Collectio"
"nRequest.Type\0225\n\013get_artists\030\002 \001(\0132 .Col" "nRequest.Type\0223\n\nget_genres\030\002 \001(\0132\037.Coll"
"lectionRequest.GetArtistList\0227\n\014get_rele" "ectionRequest.GetGenreList\0225\n\013get_artist"
"ases\030\003 \001(\0132!.CollectionRequest.GetReleas" "s\030\003 \001(\0132 .CollectionRequest.GetArtistLis"
"eList\0223\n\nget_tracks\030\004 \001(\0132\037.CollectionRe" "t\0227\n\014get_releases\030\004 \001(\0132!.CollectionRequ"
"quest.GetTrackList\032A\n\014GetGenreList\022\023\n\013fi" "est.GetReleaseList\0223\n\nget_tracks\030\005 \001(\0132\037"
"lter_name\030\001 \001(\t\022\034\n\024preferred_batch_size\030" ".CollectionRequest.GetTrackList\032A\n\014GetGe"
"\002 \001(\r\032X\n\rGetArtistList\022\023\n\013filter_name\030\001 " "nreList\022\023\n\013filter_name\030\001 \001(\t\022\034\n\024preferre"
"\001(\t\022\024\n\014filter_genre\030\002 \003(\t\022\034\n\024preferred_b" "d_batch_size\030\002 \001(\r\032X\n\rGetArtistList\022\023\n\013f"
"atch_size\030\003 \001(\r\032\201\001\n\016GetReleaseList\022\023\n\013fi" "ilter_name\030\001 \001(\t\022\024\n\014filter_genre\030\002 \003(\t\022\034"
"lter_name\030\001 \001(\t\022\023\n\013artist_name\030\002 \003(\t\022\024\n\014" "\n\024preferred_batch_size\030\003 \001(\r\032\201\001\n\016GetRele"
"filter_genre\030\003 \003(\t\022\021\n\tget_cover\030\004 \001(\010\022\034\n" "aseList\022\023\n\013filter_name\030\001 \001(\t\022\023\n\013artist_n"
"\024preferred_batch_size\030\005 \001(\r\032\300\001\n\014GetTrack" "ame\030\002 \003(\t\022\024\n\014filter_genre\030\003 \003(\t\022\021\n\tget_c"
"List\022\023\n\013filter_name\030\001 \001(\t\022\024\n\014release_nam" "over\030\004 \001(\010\022\034\n\024preferred_batch_size\030\005 \001(\r"
"e\030\002 \003(\t\022\023\n\013artist_name\030\003 \003(\t\022\024\n\014filter_g" "\032\300\001\n\014GetTrackList\022\023\n\013filter_name\030\001 \001(\t\022\024"
"enre\030\004 \003(\t\022\023\n\013disc_number\030\005 \001(\r\022\024\n\014track" "\n\014release_name\030\002 \003(\t\022\023\n\013artist_name\030\003 \003("
"_number\030\006 \001(\r\022\021\n\tget_cover\030\007 \001(\010\022\034\n\024pref" "\t\022\024\n\014filter_genre\030\004 \003(\t\022\023\n\013disc_number\030\005"
"erred_batch_size\030\010 \001(\r\"K\n\004Type\022\025\n\021TypeGe" " \001(\r\022\024\n\014track_number\030\006 \001(\r\022\021\n\tget_cover\030"
"tArtistList\020\000\022\026\n\022TypeGetReleaseList\020\001\022\024\n" "\007 \001(\010\022\034\n\024preferred_batch_size\030\010 \001(\r\"K\n\004T"
"\020TypeGetTrackList\020\002\"\260\002\n\022CollectionRespon" "ype\022\025\n\021TypeGetArtistList\020\000\022\026\n\022TypeGetRel"
"se\022\025\n\005error\030\001 \002(\0132\006.Error\022&\n\004type\030\002 \002(\0162" "easeList\020\001\022\024\n\020TypeGetTrackList\020\002\"\260\002\n\022Col"
"\030.CollectionResponse.Type\022\036\n\ngenre_list\030" "lectionResponse\022\025\n\005error\030\001 \002(\0132\006.Error\022&"
"\003 \001(\0132\n.GenreList\022 \n\013artist_list\030\004 \001(\0132\013" "\n\004type\030\002 \001(\0162\030.CollectionResponse.Type\022\036"
".ArtistList\022\"\n\014release_list\030\005 \001(\0132\014.Rele" "\n\ngenre_list\030\003 \001(\0132\n.GenreList\022 \n\013artist"
"aseList\022\036\n\ntrack_list\030\006 \001(\0132\n.TrackList\"" "_list\030\004 \001(\0132\013.ArtistList\022\"\n\014release_list"
"U\n\004Type\022\021\n\rTypeGenreList\020\001\022\022\n\016TypeArtist" "\030\005 \001(\0132\014.ReleaseList\022\036\n\ntrack_list\030\006 \001(\013"
"List\020\002\022\023\n\017TypeReleaseList\020\003\022\021\n\rTypeTrack" "2\n.TrackList\"U\n\004Type\022\021\n\rTypeGenreList\020\001\022"
"List\020\004\"1\n\tGenreList\022\014\n\004last\030\001 \002(\010\022\026\n\006gen" "\022\n\016TypeArtistList\020\002\022\023\n\017TypeReleaseList\020\003"
"res\030\002 \003(\0132\006.Genre\"4\n\nArtistList\022\014\n\004last\030" "\022\021\n\rTypeTrackList\020\004\"1\n\tGenreList\022\014\n\004last"
"\001 \002(\010\022\030\n\007artists\030\002 \003(\0132\007.Artist\"7\n\013Relea" "\030\001 \002(\010\022\026\n\006genres\030\002 \003(\0132\006.Genre\"4\n\nArtist"
"seList\022\014\n\004last\030\001 \002(\010\022\032\n\010releases\030\002 \003(\0132\010" "List\022\014\n\004last\030\001 \002(\010\022\030\n\007artists\030\002 \003(\0132\007.Ar"
".Release\"1\n\tTrackList\022\014\n\004last\030\001 \002(\010\022\026\n\006t" "tist\"7\n\013ReleaseList\022\014\n\004last\030\001 \002(\010\022\032\n\010rel"
"racks\030\002 \003(\0132\006.Track\"\025\n\005Genre\022\014\n\004name\030\001 \002" "eases\030\002 \003(\0132\010.Release\"1\n\tTrackList\022\014\n\004la"
"(\t\"+\n\010CoverArt\022\021\n\tmime_type\030\001 \001(\t\022\014\n\004dat" "st\030\001 \002(\010\022\026\n\006tracks\030\002 \003(\0132\006.Track\"\025\n\005Genr"
"a\030\002 \003(\014\"+\n\006Artist\022\014\n\004name\030\001 \002(\t\022\023\n\013nb_re" "e\022\014\n\004name\030\001 \002(\t\"+\n\010CoverArt\022\021\n\tmime_type"
"leases\030\002 \002(\r\"^\n\007Release\022\014\n\004name\030\001 \002(\t\022\021\n" "\030\001 \001(\t\022\014\n\004data\030\002 \003(\014\"+\n\006Artist\022\014\n\004name\030\001"
"\tnb_tracks\030\002 \002(\r\022\025\n\rduration_secs\030\003 \002(\r\022" " \002(\t\022\023\n\013nb_releases\030\002 \002(\r\"^\n\007Release\022\014\n\004"
"\033\n\010coverArt\030\004 \001(\0132\t.CoverArt\"\341\001\n\005Track\022\020" "name\030\001 \002(\t\022\021\n\tnb_tracks\030\002 \002(\r\022\025\n\rduratio"
"\n\010media_id\030\001 \002(\003\022\023\n\013disc_number\030\002 \001(\r\022\024\n" "n_secs\030\003 \002(\r\022\033\n\010coverArt\030\004 \001(\0132\t.CoverAr"
"\014track_number\030\003 \001(\r\022\016\n\006artist\030\004 \001(\t\022\017\n\007r" "t\"\341\001\n\005Track\022\020\n\010media_id\030\001 \002(\003\022\023\n\013disc_nu"
"elease\030\005 \001(\t\022\014\n\004name\030\006 \002(\t\022\025\n\rduration_s" "mber\030\002 \001(\r\022\024\n\014track_number\030\003 \001(\r\022\016\n\006arti"
"ecs\030\007 \002(\r\022\024\n\014release_date\030\010 \001(\t\022\035\n\025origi" "st\030\004 \001(\t\022\017\n\007release\030\005 \001(\t\022\014\n\004name\030\006 \002(\t\022"
"nal_release_date\030\t \001(\t\022\016\n\006genres\030\n \003(\t\022\020" "\025\n\rduration_secs\030\007 \002(\r\022\024\n\014release_date\030\010"
"\n\010coverArt\030\013 \001(\014", 1776); " \001(\t\022\035\n\025original_release_date\030\t \001(\t\022\016\n\006g"
"enres\030\n \003(\t\022\020\n\010coverArt\030\013 \001(\014", 1829);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"collection.proto", &protobuf_RegisterTypes); "collection.proto", &protobuf_RegisterTypes);
CollectionRequest::default_instance_ = new CollectionRequest(); CollectionRequest::default_instance_ = new CollectionRequest();
@@ -2048,6 +2050,7 @@ void CollectionRequest_GetTrackList::Swap(CollectionRequest_GetTrackList* other)
#ifndef _MSC_VER #ifndef _MSC_VER
const int CollectionRequest::kTypeFieldNumber; const int CollectionRequest::kTypeFieldNumber;
const int CollectionRequest::kGetGenresFieldNumber;
const int CollectionRequest::kGetArtistsFieldNumber; const int CollectionRequest::kGetArtistsFieldNumber;
const int CollectionRequest::kGetReleasesFieldNumber; const int CollectionRequest::kGetReleasesFieldNumber;
const int CollectionRequest::kGetTracksFieldNumber; const int CollectionRequest::kGetTracksFieldNumber;
@@ -2059,6 +2062,7 @@ CollectionRequest::CollectionRequest()
} }
void CollectionRequest::InitAsDefaultInstance() { void CollectionRequest::InitAsDefaultInstance() {
get_genres_ = const_cast< ::CollectionRequest_GetGenreList*>(&::CollectionRequest_GetGenreList::default_instance());
get_artists_ = const_cast< ::CollectionRequest_GetArtistList*>(&::CollectionRequest_GetArtistList::default_instance()); get_artists_ = const_cast< ::CollectionRequest_GetArtistList*>(&::CollectionRequest_GetArtistList::default_instance());
get_releases_ = const_cast< ::CollectionRequest_GetReleaseList*>(&::CollectionRequest_GetReleaseList::default_instance()); get_releases_ = const_cast< ::CollectionRequest_GetReleaseList*>(&::CollectionRequest_GetReleaseList::default_instance());
get_tracks_ = const_cast< ::CollectionRequest_GetTrackList*>(&::CollectionRequest_GetTrackList::default_instance()); get_tracks_ = const_cast< ::CollectionRequest_GetTrackList*>(&::CollectionRequest_GetTrackList::default_instance());
@@ -2073,6 +2077,7 @@ CollectionRequest::CollectionRequest(const CollectionRequest& from)
void CollectionRequest::SharedCtor() { void CollectionRequest::SharedCtor() {
_cached_size_ = 0; _cached_size_ = 0;
type_ = 0; type_ = 0;
get_genres_ = NULL;
get_artists_ = NULL; get_artists_ = NULL;
get_releases_ = NULL; get_releases_ = NULL;
get_tracks_ = NULL; get_tracks_ = NULL;
@@ -2085,6 +2090,7 @@ CollectionRequest::~CollectionRequest() {
void CollectionRequest::SharedDtor() { void CollectionRequest::SharedDtor() {
if (this != default_instance_) { if (this != default_instance_) {
delete get_genres_;
delete get_artists_; delete get_artists_;
delete get_releases_; delete get_releases_;
delete get_tracks_; delete get_tracks_;
@@ -2115,6 +2121,9 @@ CollectionRequest* CollectionRequest::New() const {
void CollectionRequest::Clear() { void CollectionRequest::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
type_ = 0; type_ = 0;
if (has_get_genres()) {
if (get_genres_ != NULL) get_genres_->::CollectionRequest_GetGenreList::Clear();
}
if (has_get_artists()) { if (has_get_artists()) {
if (get_artists_ != NULL) get_artists_->::CollectionRequest_GetArtistList::Clear(); if (get_artists_ != NULL) get_artists_->::CollectionRequest_GetArtistList::Clear();
} }
@@ -2151,12 +2160,26 @@ bool CollectionRequest::MergePartialFromCodedStream(
} else { } else {
goto handle_uninterpreted; goto handle_uninterpreted;
} }
if (input->ExpectTag(18)) goto parse_get_artists; if (input->ExpectTag(18)) goto parse_get_genres;
break; break;
} }
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
case 2: { case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_get_genres:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_get_genres()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_get_artists;
break;
}
// optional .CollectionRequest.GetArtistList get_artists = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_get_artists: parse_get_artists:
@@ -2165,12 +2188,12 @@ bool CollectionRequest::MergePartialFromCodedStream(
} else { } else {
goto handle_uninterpreted; goto handle_uninterpreted;
} }
if (input->ExpectTag(26)) goto parse_get_releases; if (input->ExpectTag(34)) goto parse_get_releases;
break; break;
} }
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
case 3: { case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_get_releases: parse_get_releases:
@@ -2179,12 +2202,12 @@ bool CollectionRequest::MergePartialFromCodedStream(
} else { } else {
goto handle_uninterpreted; goto handle_uninterpreted;
} }
if (input->ExpectTag(34)) goto parse_get_tracks; if (input->ExpectTag(42)) goto parse_get_tracks;
break; break;
} }
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
case 4: { case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_get_tracks: parse_get_tracks:
@@ -2221,22 +2244,28 @@ void CollectionRequest::SerializeWithCachedSizes(
1, this->type(), output); 1, this->type(), output);
} }
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
if (has_get_genres()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->get_genres(), output);
}
// optional .CollectionRequest.GetArtistList get_artists = 3;
if (has_get_artists()) { if (has_get_artists()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->get_artists(), output); 3, this->get_artists(), output);
} }
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
if (has_get_releases()) { if (has_get_releases()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->get_releases(), output); 4, this->get_releases(), output);
} }
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
if (has_get_tracks()) { if (has_get_tracks()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->get_tracks(), output); 5, this->get_tracks(), output);
} }
if (!unknown_fields().empty()) { if (!unknown_fields().empty()) {
@@ -2253,25 +2282,32 @@ void CollectionRequest::SerializeWithCachedSizes(
1, this->type(), target); 1, this->type(), target);
} }
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
if (has_get_genres()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, this->get_genres(), target);
}
// optional .CollectionRequest.GetArtistList get_artists = 3;
if (has_get_artists()) { if (has_get_artists()) {
target = ::google::protobuf::internal::WireFormatLite:: target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray( WriteMessageNoVirtualToArray(
2, this->get_artists(), target); 3, this->get_artists(), target);
} }
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
if (has_get_releases()) { if (has_get_releases()) {
target = ::google::protobuf::internal::WireFormatLite:: target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray( WriteMessageNoVirtualToArray(
3, this->get_releases(), target); 4, this->get_releases(), target);
} }
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
if (has_get_tracks()) { if (has_get_tracks()) {
target = ::google::protobuf::internal::WireFormatLite:: target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray( WriteMessageNoVirtualToArray(
4, this->get_tracks(), target); 5, this->get_tracks(), target);
} }
if (!unknown_fields().empty()) { if (!unknown_fields().empty()) {
@@ -2291,21 +2327,28 @@ int CollectionRequest::ByteSize() const {
::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
} }
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
if (has_get_genres()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->get_genres());
}
// optional .CollectionRequest.GetArtistList get_artists = 3;
if (has_get_artists()) { if (has_get_artists()) {
total_size += 1 + total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->get_artists()); this->get_artists());
} }
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
if (has_get_releases()) { if (has_get_releases()) {
total_size += 1 + total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->get_releases()); this->get_releases());
} }
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
if (has_get_tracks()) { if (has_get_tracks()) {
total_size += 1 + total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
@@ -2342,6 +2385,9 @@ void CollectionRequest::MergeFrom(const CollectionRequest& from) {
if (from.has_type()) { if (from.has_type()) {
set_type(from.type()); set_type(from.type());
} }
if (from.has_get_genres()) {
mutable_get_genres()->::CollectionRequest_GetGenreList::MergeFrom(from.get_genres());
}
if (from.has_get_artists()) { if (from.has_get_artists()) {
mutable_get_artists()->::CollectionRequest_GetArtistList::MergeFrom(from.get_artists()); mutable_get_artists()->::CollectionRequest_GetArtistList::MergeFrom(from.get_artists());
} }
@@ -2376,6 +2422,7 @@ bool CollectionRequest::IsInitialized() const {
void CollectionRequest::Swap(CollectionRequest* other) { void CollectionRequest::Swap(CollectionRequest* other) {
if (other != this) { if (other != this) {
std::swap(type_, other->type_); std::swap(type_, other->type_);
std::swap(get_genres_, other->get_genres_);
std::swap(get_artists_, other->get_artists_); std::swap(get_artists_, other->get_artists_);
std::swap(get_releases_, other->get_releases_); std::swap(get_releases_, other->get_releases_);
std::swap(get_tracks_, other->get_tracks_); std::swap(get_tracks_, other->get_tracks_);
@@ -2537,7 +2584,7 @@ bool CollectionResponse::MergePartialFromCodedStream(
break; break;
} }
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
case 2: { case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
@@ -2638,7 +2685,7 @@ void CollectionResponse::SerializeWithCachedSizes(
1, this->error(), output); 1, this->error(), output);
} }
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
if (has_type()) { if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum( ::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->type(), output); 2, this->type(), output);
@@ -2683,7 +2730,7 @@ void CollectionResponse::SerializeWithCachedSizes(
1, this->error(), target); 1, this->error(), target);
} }
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
if (has_type()) { if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->type(), target); 2, this->type(), target);
@@ -2735,7 +2782,7 @@ int CollectionResponse::ByteSize() const {
this->error()); this->error());
} }
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
if (has_type()) { if (has_type()) {
total_size += 1 + total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
@@ -2831,7 +2878,7 @@ void CollectionResponse::CopyFrom(const CollectionResponse& from) {
} }
bool CollectionResponse::IsInitialized() const { bool CollectionResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
if (has_error()) { if (has_error()) {
if (!this->error().IsInitialized()) return false; if (!this->error().IsInitialized()) return false;
+71 -21
View File
@@ -713,28 +713,37 @@ class CollectionRequest : public ::google::protobuf::Message {
inline ::CollectionRequest_Type type() const; inline ::CollectionRequest_Type type() const;
inline void set_type(::CollectionRequest_Type value); inline void set_type(::CollectionRequest_Type value);
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
inline bool has_get_genres() const;
inline void clear_get_genres();
static const int kGetGenresFieldNumber = 2;
inline const ::CollectionRequest_GetGenreList& get_genres() const;
inline ::CollectionRequest_GetGenreList* mutable_get_genres();
inline ::CollectionRequest_GetGenreList* release_get_genres();
inline void set_allocated_get_genres(::CollectionRequest_GetGenreList* get_genres);
// optional .CollectionRequest.GetArtistList get_artists = 3;
inline bool has_get_artists() const; inline bool has_get_artists() const;
inline void clear_get_artists(); inline void clear_get_artists();
static const int kGetArtistsFieldNumber = 2; static const int kGetArtistsFieldNumber = 3;
inline const ::CollectionRequest_GetArtistList& get_artists() const; inline const ::CollectionRequest_GetArtistList& get_artists() const;
inline ::CollectionRequest_GetArtistList* mutable_get_artists(); inline ::CollectionRequest_GetArtistList* mutable_get_artists();
inline ::CollectionRequest_GetArtistList* release_get_artists(); inline ::CollectionRequest_GetArtistList* release_get_artists();
inline void set_allocated_get_artists(::CollectionRequest_GetArtistList* get_artists); inline void set_allocated_get_artists(::CollectionRequest_GetArtistList* get_artists);
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
inline bool has_get_releases() const; inline bool has_get_releases() const;
inline void clear_get_releases(); inline void clear_get_releases();
static const int kGetReleasesFieldNumber = 3; static const int kGetReleasesFieldNumber = 4;
inline const ::CollectionRequest_GetReleaseList& get_releases() const; inline const ::CollectionRequest_GetReleaseList& get_releases() const;
inline ::CollectionRequest_GetReleaseList* mutable_get_releases(); inline ::CollectionRequest_GetReleaseList* mutable_get_releases();
inline ::CollectionRequest_GetReleaseList* release_get_releases(); inline ::CollectionRequest_GetReleaseList* release_get_releases();
inline void set_allocated_get_releases(::CollectionRequest_GetReleaseList* get_releases); inline void set_allocated_get_releases(::CollectionRequest_GetReleaseList* get_releases);
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
inline bool has_get_tracks() const; inline bool has_get_tracks() const;
inline void clear_get_tracks(); inline void clear_get_tracks();
static const int kGetTracksFieldNumber = 4; static const int kGetTracksFieldNumber = 5;
inline const ::CollectionRequest_GetTrackList& get_tracks() const; inline const ::CollectionRequest_GetTrackList& get_tracks() const;
inline ::CollectionRequest_GetTrackList* mutable_get_tracks(); inline ::CollectionRequest_GetTrackList* mutable_get_tracks();
inline ::CollectionRequest_GetTrackList* release_get_tracks(); inline ::CollectionRequest_GetTrackList* release_get_tracks();
@@ -744,6 +753,8 @@ class CollectionRequest : public ::google::protobuf::Message {
private: private:
inline void set_has_type(); inline void set_has_type();
inline void clear_has_type(); inline void clear_has_type();
inline void set_has_get_genres();
inline void clear_has_get_genres();
inline void set_has_get_artists(); inline void set_has_get_artists();
inline void clear_has_get_artists(); inline void clear_has_get_artists();
inline void set_has_get_releases(); inline void set_has_get_releases();
@@ -753,13 +764,14 @@ class CollectionRequest : public ::google::protobuf::Message {
::google::protobuf::UnknownFieldSet _unknown_fields_; ::google::protobuf::UnknownFieldSet _unknown_fields_;
::CollectionRequest_GetGenreList* get_genres_;
::CollectionRequest_GetArtistList* get_artists_; ::CollectionRequest_GetArtistList* get_artists_;
::CollectionRequest_GetReleaseList* get_releases_; ::CollectionRequest_GetReleaseList* get_releases_;
::CollectionRequest_GetTrackList* get_tracks_; ::CollectionRequest_GetTrackList* get_tracks_;
int type_; int type_;
mutable int _cached_size_; mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32];
friend void protobuf_AddDesc_collection_2eproto(); friend void protobuf_AddDesc_collection_2eproto();
friend void protobuf_AssignDesc_collection_2eproto(); friend void protobuf_AssignDesc_collection_2eproto();
@@ -859,7 +871,7 @@ class CollectionResponse : public ::google::protobuf::Message {
inline ::Error* release_error(); inline ::Error* release_error();
inline void set_allocated_error(::Error* error); inline void set_allocated_error(::Error* error);
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
inline bool has_type() const; inline bool has_type() const;
inline void clear_type(); inline void clear_type();
static const int kTypeFieldNumber = 2; static const int kTypeFieldNumber = 2;
@@ -2708,16 +2720,54 @@ inline void CollectionRequest::set_type(::CollectionRequest_Type value) {
type_ = value; type_ = value;
} }
// optional .CollectionRequest.GetArtistList get_artists = 2; // optional .CollectionRequest.GetGenreList get_genres = 2;
inline bool CollectionRequest::has_get_artists() const { inline bool CollectionRequest::has_get_genres() const {
return (_has_bits_[0] & 0x00000002u) != 0; return (_has_bits_[0] & 0x00000002u) != 0;
} }
inline void CollectionRequest::set_has_get_artists() { inline void CollectionRequest::set_has_get_genres() {
_has_bits_[0] |= 0x00000002u; _has_bits_[0] |= 0x00000002u;
} }
inline void CollectionRequest::clear_has_get_artists() { inline void CollectionRequest::clear_has_get_genres() {
_has_bits_[0] &= ~0x00000002u; _has_bits_[0] &= ~0x00000002u;
} }
inline void CollectionRequest::clear_get_genres() {
if (get_genres_ != NULL) get_genres_->::CollectionRequest_GetGenreList::Clear();
clear_has_get_genres();
}
inline const ::CollectionRequest_GetGenreList& CollectionRequest::get_genres() const {
return get_genres_ != NULL ? *get_genres_ : *default_instance_->get_genres_;
}
inline ::CollectionRequest_GetGenreList* CollectionRequest::mutable_get_genres() {
set_has_get_genres();
if (get_genres_ == NULL) get_genres_ = new ::CollectionRequest_GetGenreList;
return get_genres_;
}
inline ::CollectionRequest_GetGenreList* CollectionRequest::release_get_genres() {
clear_has_get_genres();
::CollectionRequest_GetGenreList* temp = get_genres_;
get_genres_ = NULL;
return temp;
}
inline void CollectionRequest::set_allocated_get_genres(::CollectionRequest_GetGenreList* get_genres) {
delete get_genres_;
get_genres_ = get_genres;
if (get_genres) {
set_has_get_genres();
} else {
clear_has_get_genres();
}
}
// optional .CollectionRequest.GetArtistList get_artists = 3;
inline bool CollectionRequest::has_get_artists() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void CollectionRequest::set_has_get_artists() {
_has_bits_[0] |= 0x00000004u;
}
inline void CollectionRequest::clear_has_get_artists() {
_has_bits_[0] &= ~0x00000004u;
}
inline void CollectionRequest::clear_get_artists() { inline void CollectionRequest::clear_get_artists() {
if (get_artists_ != NULL) get_artists_->::CollectionRequest_GetArtistList::Clear(); if (get_artists_ != NULL) get_artists_->::CollectionRequest_GetArtistList::Clear();
clear_has_get_artists(); clear_has_get_artists();
@@ -2746,15 +2796,15 @@ inline void CollectionRequest::set_allocated_get_artists(::CollectionRequest_Get
} }
} }
// optional .CollectionRequest.GetReleaseList get_releases = 3; // optional .CollectionRequest.GetReleaseList get_releases = 4;
inline bool CollectionRequest::has_get_releases() const { inline bool CollectionRequest::has_get_releases() const {
return (_has_bits_[0] & 0x00000004u) != 0; return (_has_bits_[0] & 0x00000008u) != 0;
} }
inline void CollectionRequest::set_has_get_releases() { inline void CollectionRequest::set_has_get_releases() {
_has_bits_[0] |= 0x00000004u; _has_bits_[0] |= 0x00000008u;
} }
inline void CollectionRequest::clear_has_get_releases() { inline void CollectionRequest::clear_has_get_releases() {
_has_bits_[0] &= ~0x00000004u; _has_bits_[0] &= ~0x00000008u;
} }
inline void CollectionRequest::clear_get_releases() { inline void CollectionRequest::clear_get_releases() {
if (get_releases_ != NULL) get_releases_->::CollectionRequest_GetReleaseList::Clear(); if (get_releases_ != NULL) get_releases_->::CollectionRequest_GetReleaseList::Clear();
@@ -2784,15 +2834,15 @@ inline void CollectionRequest::set_allocated_get_releases(::CollectionRequest_Ge
} }
} }
// optional .CollectionRequest.GetTrackList get_tracks = 4; // optional .CollectionRequest.GetTrackList get_tracks = 5;
inline bool CollectionRequest::has_get_tracks() const { inline bool CollectionRequest::has_get_tracks() const {
return (_has_bits_[0] & 0x00000008u) != 0; return (_has_bits_[0] & 0x00000010u) != 0;
} }
inline void CollectionRequest::set_has_get_tracks() { inline void CollectionRequest::set_has_get_tracks() {
_has_bits_[0] |= 0x00000008u; _has_bits_[0] |= 0x00000010u;
} }
inline void CollectionRequest::clear_has_get_tracks() { inline void CollectionRequest::clear_has_get_tracks() {
_has_bits_[0] &= ~0x00000008u; _has_bits_[0] &= ~0x00000010u;
} }
inline void CollectionRequest::clear_get_tracks() { inline void CollectionRequest::clear_get_tracks() {
if (get_tracks_ != NULL) get_tracks_->::CollectionRequest_GetTrackList::Clear(); if (get_tracks_ != NULL) get_tracks_->::CollectionRequest_GetTrackList::Clear();
@@ -2864,7 +2914,7 @@ inline void CollectionResponse::set_allocated_error(::Error* error) {
} }
} }
// required .CollectionResponse.Type type = 2; // optional .CollectionResponse.Type type = 2;
inline bool CollectionResponse::has_type() const { inline bool CollectionResponse::has_type() const {
return (_has_bits_[0] & 0x00000002u) != 0; return (_has_bits_[0] & 0x00000002u) != 0;
} }
+9 -8
View File
@@ -54,9 +54,10 @@ message CollectionRequest
required Type type = 1; required Type type = 1;
optional GetArtistList get_artists = 2; optional GetGenreList get_genres = 2;
optional GetReleaseList get_releases = 3; optional GetArtistList get_artists = 3;
optional GetTrackList get_tracks = 4; optional GetReleaseList get_releases = 4;
optional GetTrackList get_tracks = 5;
} }
@@ -71,7 +72,7 @@ message CollectionResponse
required Error error = 1; required Error error = 1;
required Type type = 2; optional Type type = 2;
optional GenreList genre_list = 3; optional GenreList genre_list = 3;
optional ArtistList artist_list = 4; optional ArtistList artist_list = 4;
@@ -81,25 +82,25 @@ message CollectionResponse
message GenreList message GenreList
{ {
required bool last = 1; required bool last = 1; // More messages follow if last = 0
repeated Genre genres = 2; repeated Genre genres = 2;
} }
message ArtistList message ArtistList
{ {
required bool last = 1; required bool last = 1; // More messages follow if last = 0
repeated Artist artists = 2; repeated Artist artists = 2;
} }
message ReleaseList message ReleaseList
{ {
required bool last = 1; required bool last = 1; // More messages follow if last = 0
repeated Release releases = 2; repeated Release releases = 2;
} }
message TrackList message TrackList
{ {
required bool last = 1; required bool last = 1; // More messages follow if last = 0
repeated Track tracks = 2; repeated Track tracks = 2;
} }