libmusicbrainz3  3.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
entity.h
Go to the documentation of this file.
1 /*
2  * MusicBrainz -- The Internet music metadatabase
3  *
4  * Copyright (C) 2006 Lukas Lalinsky
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  * $Id: entity.h 9216 2007-06-25 19:42:20Z luks $
21  */
22 
23 #ifndef __MUSICBRAINZ3_ENTITY_H__
24 #define __MUSICBRAINZ3_ENTITY_H__
25 
26 #include <string>
28 #include <musicbrainz3/lists.h>
29 #include <musicbrainz3/relation.h>
30 #include <musicbrainz3/tag.h>
31 
32 namespace MusicBrainz
33 {
34 
56  class MB_API Entity
57  {
58  protected:
59 
67  Entity(const std::string &id);
68 
69  public:
70 
74  virtual ~Entity();
75 
81  virtual std::string getId() const;
82 
88  virtual void setId(const std::string &value);
89 
117  RelationList getRelations(const std::string &targetType = std::string(),
118  const std::string &relationType = std::string()) const;
119 
129  void addRelation(Relation *relation);
130 
140  int getNumRelations() const;
141 
151  Relation *getRelation(int index);
152 
153  TagList &getTags();
154  int getNumTags() const;
155  Tag *getTag(int index);
156 
157  private:
158 
159  class EntityPrivate;
160  EntityPrivate *d;
161  };
162 
163 }
164 
165 #endif
166 
std::vector< Tag * > TagList
A vector of pointers to Tag objects.
Definition: lists.h:72
A first-level MusicBrainz class.
Definition: entity.h:56
Definition: tag.h:35
std::vector< Relation * > RelationList
A vector of pointers to Relation objects.
Definition: lists.h:56
Represents a relation between two Entities.
Definition: relation.h:46
#define MB_API
Definition: defines.h:40