List of all members.
Detailed Description
A first-level MusicBrainz class.
All entities in MusicBrainz have unique IDs (which are absolute URIs) and may have any number of relations (Relation) to other entities. This class is abstract and should not be instantiated.
Relations are differentiated by their target type, that means, where they link to. MusicBrainz currently supports four target types (artists, releases, tracks, and URLs) each identified using a URI. To get all relations with a specific target type, you can use getRelations and pass one of the following constants as the parameter:
- See also:
- Relation
Constructor & Destructor Documentation
MusicBrainz::Entity::Entity |
( |
const std::string & |
id |
) |
[protected] |
Constructor.
This should only used by derived classes.
- Parameters:
-
| id | a string containing an absolute URI |
virtual MusicBrainz::Entity::~Entity |
( |
|
) |
[virtual] |
Member Function Documentation
void MusicBrainz::Entity::addRelation |
( |
Relation * |
relation |
) |
|
Adds a relation.
This method adds relation to the list of relations. The given relation has to be initialized, at least the target type has to be set.
- Parameters:
-
| relation | a pointer to Relation object to add |
virtual std::string MusicBrainz::Entity::getId |
( |
|
) |
const [virtual] |
Returns a MusicBrainz ID.
- Returns:
- a string containing a URI
int MusicBrainz::Entity::getNumRelations |
( |
|
) |
const |
Returns number of relations.
This is equivalent to getRelations()
.size()
- Returns:
- an int containing number of relations
- See also:
- getRelations
int MusicBrainz::Entity::getNumTags |
( |
|
) |
const |
float MusicBrainz::Entity::getRating |
( |
|
) |
const |
int MusicBrainz::Entity::getRatingVoteCount |
( |
|
) |
const |
Relation* MusicBrainz::Entity::getRelation |
( |
int |
index |
) |
|
RelationList MusicBrainz::Entity::getRelations |
( |
const std::string & |
targetType = std::string() , |
|
|
const std::string & |
relationType = std::string() | |
|
) |
| | const |
Returns a list of relations.
If targetType is given, only relations of that target type are returned. For MusicBrainz, the following target types are defined:
If targetType is Relation::TO_ARTIST, for example, this method returns all relations between this Entity and artists.
You may use the relationType parameter to further restrict the selection. If it is set, only relations with the given relation type are returned.
- Parameters:
-
| targetType | a string containing an absolute URI |
| relationType | a string containing an absolute URI |
- Returns:
- a list of pointers to Relation objects
- See also:
- Entity
Tag* MusicBrainz::Entity::getTag |
( |
int |
index |
) |
|
TagList& MusicBrainz::Entity::getTags |
( |
|
) |
|
virtual void MusicBrainz::Entity::setId |
( |
const std::string & |
value |
) |
[virtual] |
Sets a MusicBrainz ID.
- Parameters:
-
| value | a string containing an absolute URI |
void MusicBrainz::Entity::setRating |
( |
float |
rating |
) |
|
void MusicBrainz::Entity::setRatingVoteCount |
( |
int |
count |
) |
|