libmusicbrainz4  4.0.3
Relation.h
Go to the documentation of this file.
1 /* --------------------------------------------------------------------------
2 
3  libmusicbrainz4 - Client library to access MusicBrainz
4 
5  Copyright (C) 2011 Andrew Hawkins
6 
7  This file is part of libmusicbrainz4.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of v2 of the GNU Lesser General Public
11  License as published by the Free Software Foundation.
12 
13  libmusicbrainz4 is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21  $Id$
22 
23 ----------------------------------------------------------------------------*/
24 
25 #ifndef _MUSICBRAINZ4_RELATION_H
26 #define _MUSICBRAINZ4_RELATION_H
27 
28 #include <string>
29 #include <iostream>
30 
31 #include "musicbrainz4/Entity.h"
33 
34 #include "musicbrainz4/xmlParser.h"
35 
36 namespace MusicBrainz4
37 {
38  class CRelationPrivate;
39 
40  class CArtist;
41  class CRelease;
42  class CReleaseGroup;
43  class CRecording;
44  class CLabel;
45  class CWork;
46 
47  class CRelation: public CEntity
48  {
49  public:
50  CRelation(const XMLNode& Node=XMLNode::emptyNode());
51  CRelation(const CRelation& Other);
52  CRelation& operator =(const CRelation& Other);
53  virtual ~CRelation();
54 
55  virtual CRelation *Clone();
56 
57  std::string Type() const;
58  std::string Target() const;
59  std::string Direction() const;
61  std::string Begin() const;
62  std::string End() const;
63  CArtist *Artist() const;
64  CRelease *Release() const;
65  CReleaseGroup *ReleaseGroup() const;
66  CRecording *Recording() const;
67  CLabel *Label() const;
68  CWork *Work() const;
69 
70  virtual std::ostream& Serialise(std::ostream& os) const;
71  static std::string GetElementName();
72 
73  protected:
74  virtual void ParseAttribute(const std::string& Name, const std::string& Value);
75  virtual void ParseElement(const XMLNode& Node);
76 
77  private:
78  void Cleanup();
79 
80  CRelationPrivate * const m_d;
81  };
82 }
83 
84 #endif
Definition: Artist.h:52
CRelease * Release() const
CArtist * Artist() const
Definition: Entity.h:41
virtual void ParseAttribute(const std::string &Name, const std::string &Value)
CRelation & operator=(const CRelation &Other)
CAttributeList * AttributeList() const
CReleaseGroup * ReleaseGroup() const
CLabel * Label() const
Definition: Label.h:49
virtual std::ostream & Serialise(std::ostream &os) const
CWork * Work() const
Definition: ReleaseGroup.h:49
CRecording * Recording() const
Definition: Work.h:48
virtual CRelation * Clone()
std::string Direction() const
Definition: Relation.h:47
std::string Begin() const
std::string End() const
Definition: Recording.h:54
virtual void ParseElement(const XMLNode &Node)
Definition: Release.h:48
std::string Target() const
static std::string GetElementName()
Definition: Alias.h:35
CRelation(const XMLNode &Node=XMLNode::emptyNode())
std::string Type() const
Definition: ListImpl.h:33