libmusicbrainz3  3.0.3
entity.h
Go to the documentation of this file.
00001 /*
00002  * MusicBrainz -- The Internet music metadatabase
00003  *
00004  * Copyright (C) 2006 Lukas Lalinsky
00005  *      
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * 
00021  */
00022  
00023 #ifndef __MUSICBRAINZ3_ENTITY_H__
00024 #define __MUSICBRAINZ3_ENTITY_H__
00025 
00026 #include <string>
00027 #include <musicbrainz3/musicbrainz.h> 
00028 #include <musicbrainz3/lists.h> 
00029 #include <musicbrainz3/relation.h> 
00030 #include <musicbrainz3/tag.h> 
00031 
00032 namespace MusicBrainz
00033 {
00034 
00056         class MB_API Entity
00057         {
00058         protected:
00059         
00067                 Entity(const std::string &id);
00068                 
00069         public:
00070                 
00074                 virtual ~Entity();
00075                 
00081                 virtual std::string getId() const;
00082                 
00088                 virtual void setId(const std::string &value);
00089 
00117                 RelationList getRelations(const std::string &targetType = std::string(),
00118                                                                   const std::string &relationType = std::string()) const;
00119                 
00129                 void addRelation(Relation *relation);
00130                 
00140                 int getNumRelations() const;
00141                 
00151                 Relation *getRelation(int index);
00152 
00153                 TagList &getTags();
00154                 int getNumTags() const;
00155                 Tag *getTag(int index);
00156 
00157                 float getRating() const;
00158                 void setRating(float rating);
00159 
00160                 int getRatingVoteCount() const;
00161                 void setRatingVoteCount(int count);
00162 
00163         private:
00164 
00165                 class EntityPrivate;
00166                 EntityPrivate *d;
00167         };
00168         
00169 }
00170 
00171 #endif
00172 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines