Commit c7a9e9bc authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Properly mark methods as virtual/override, or as not virtual

parent 329e15d0
......@@ -36,6 +36,7 @@ class IAlbum
virtual time_t releaseDate() const = 0;
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkUrl() const = 0;
virtual time_t lastSyncDate() const = 0;
virtual std::vector<std::shared_ptr<IAlbumTrack>> tracks() const = 0;
virtual std::vector<ArtistPtr> artists() const = 0;
};
......
......@@ -37,7 +37,6 @@ class IAlbumTrack
virtual const std::string& title() = 0;
virtual unsigned int trackNumber() = 0;
virtual std::shared_ptr<IAlbum> album() = 0;
virtual bool addArtist( ArtistPtr artist ) = 0;
virtual std::vector<ArtistPtr> artists() const = 0;
virtual std::vector<MediaPtr> files() = 0;
};
......
......@@ -32,6 +32,7 @@ class IShow
virtual unsigned int id() const = 0;
virtual const std::string& name() const = 0;
virtual time_t releaseDate() const = 0;
virtual time_t lastSyncDate() const = 0;
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkUrl() const = 0;
virtual const std::string& tvdbId() = 0;
......
......@@ -53,22 +53,22 @@ class Album : public IAlbum, public Cache<Album, IAlbum, policy::AlbumTable>
Album( DBConnection dbConnection, sqlite3_stmt* stmt );
Album( const std::string& title );
virtual unsigned int id() const;
virtual const std::string& title() const;
virtual time_t releaseDate() const;
virtual bool setReleaseDate( time_t date );
virtual const std::string& shortSummary() const;
virtual bool setShortSummary( const std::string& summary );
virtual const std::string& artworkUrl() const;
virtual bool setArtworkUrl( const std::string& artworkUrl );
virtual time_t lastSyncDate() const;
virtual std::vector<std::shared_ptr<IAlbumTrack> > tracks() const;
virtual unsigned int id() const override;
virtual const std::string& title() const override;
virtual time_t releaseDate() const override;
bool setReleaseDate( time_t date );
virtual const std::string& shortSummary() const override;
bool setShortSummary( const std::string& summary );
virtual const std::string& artworkUrl() const override;
bool setArtworkUrl( const std::string& artworkUrl );
virtual time_t lastSyncDate() const override;
virtual std::vector<std::shared_ptr<IAlbumTrack> > tracks() const override;
std::shared_ptr<AlbumTrack> addTrack( const std::string& title, unsigned int trackNb );
virtual std::vector<ArtistPtr> artists() const override;
virtual bool addArtist( std::shared_ptr<Artist> artist );
bool addArtist( std::shared_ptr<Artist> artist );
virtual bool destroy();
bool destroy();
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<Album> create(DBConnection dbConnection, const std::string& title );
......
......@@ -51,16 +51,16 @@ class AlbumTrack : public IAlbumTrack, public Cache<AlbumTrack, IAlbumTrack, pol
AlbumTrack( DBConnection dbConnection, sqlite3_stmt* stmt );
AlbumTrack( const std::string& title, unsigned int trackNumber, unsigned int albumId );
virtual unsigned int id() const;
virtual const std::string& genre();
virtual bool setGenre( const std::string& genre );
virtual const std::string& title();
virtual unsigned int trackNumber();
virtual std::shared_ptr<IAlbum> album();
virtual bool destroy();
virtual bool addArtist( ArtistPtr artist ) override;
virtual unsigned int id() const override;
virtual const std::string& genre() override;
bool setGenre( const std::string& genre );
virtual const std::string& title() override;
virtual unsigned int trackNumber() override;
virtual std::shared_ptr<IAlbum> album() override;
bool destroy();
bool addArtist( ArtistPtr artist );
virtual std::vector<ArtistPtr> artists() const override;
virtual std::vector<MediaPtr> files();
virtual std::vector<MediaPtr> files() override;
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<AlbumTrack> create( DBConnection dbConnection, unsigned int albumId,
......
......@@ -55,7 +55,7 @@ public:
virtual unsigned int id() const override;
virtual const std::string &name() const override;
virtual const std::string& shortBio() const override;
virtual bool setShortBio( const std::string& shortBio );
bool setShortBio( const std::string& shortBio );
virtual std::vector<AlbumPtr> albums() const override;
virtual std::vector<AlbumTrackPtr> tracks() const override;
......
......@@ -45,11 +45,11 @@ class AudioTrack : public IAudioTrack, public Cache<AudioTrack, IAudioTrack, pol
AudioTrack( DBConnection dbConnection, sqlite3_stmt* stmt );
AudioTrack( const std::string& codec, unsigned int bitrate, unsigned int sampleRate, unsigned int nbChannels );
virtual unsigned int id() const;
virtual const std::string&codec() const;
virtual unsigned int bitrate() const;
virtual unsigned int sampleRate() const;
virtual unsigned int nbChannels() const;
virtual unsigned int id() const override;
virtual const std::string&codec() const override;
virtual unsigned int bitrate() const override;
virtual unsigned int sampleRate() const override;
virtual unsigned int nbChannels() const override;
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<AudioTrack> fetch( DBConnection dbConnection, const std::string& codec,
......
......@@ -69,8 +69,8 @@ public:
virtual std::vector<FolderPtr> folders() override;
virtual FolderPtr parent() override;
virtual unsigned int lastModificationDate() override;
virtual bool setLastModificationDate(unsigned int lastModificationDate);
virtual bool isRemovable() override;
bool setLastModificationDate(unsigned int lastModificationDate);
bool isRemovable();
private:
DBConnection m_dbConection;
......
......@@ -59,9 +59,9 @@ class Label : public ILabel, public Cache<Label, ILabel, policy::LabelTable, pol
Label( const std::string& name );
public:
virtual unsigned int id() const;
virtual const std::string& name();
virtual std::vector<MediaPtr> files();
virtual unsigned int id() const override;
virtual const std::string& name() override;
virtual std::vector<MediaPtr> files() override;
static LabelPtr create( DBConnection dbConnection, const std::string& name );
static bool createTable( DBConnection dbConnection );
......
......@@ -67,40 +67,40 @@ class Media : public IMedia, public Cache<Media, IMedia, policy::MediaTable, pol
static std::shared_ptr<Media> create(DBConnection dbConnection, Type type, const fs::IFile* file , unsigned int folderId);
static bool createTable( DBConnection connection );
virtual unsigned int id() const;
virtual unsigned int id() const override;
virtual Type type() override;
virtual bool setType( Type type );
bool setType( Type type );
virtual const std::string& name() override;
virtual bool setName( const std::string& name );
virtual AlbumTrackPtr albumTrack();
virtual bool setAlbumTrack( AlbumTrackPtr albumTrack );
virtual int64_t duration() const;
virtual bool setDuration( int64_t duration);
virtual std::shared_ptr<IShowEpisode> showEpisode();
virtual bool setShowEpisode( ShowEpisodePtr showEpisode );
virtual bool addLabel( LabelPtr label );
virtual bool removeLabel( LabelPtr label );
virtual std::vector<std::shared_ptr<ILabel> > labels();
virtual int playCount() const;
virtual const std::string& mrl() const;
virtual MoviePtr movie();
virtual bool setMovie( MoviePtr movie );
virtual bool addVideoTrack( const std::string& codec, unsigned int width,
bool setName( const std::string& name );
virtual AlbumTrackPtr albumTrack() override;
bool setAlbumTrack( AlbumTrackPtr albumTrack );
virtual int64_t duration() const override;
bool setDuration( int64_t duration);
virtual std::shared_ptr<IShowEpisode> showEpisode() override;
bool setShowEpisode( ShowEpisodePtr showEpisode );
virtual bool addLabel( LabelPtr label ) override;
virtual bool removeLabel( LabelPtr label ) override;
virtual std::vector<std::shared_ptr<ILabel> > labels() override;
virtual int playCount() const override;
virtual const std::string& mrl() const override;
virtual MoviePtr movie() override;
bool setMovie( MoviePtr movie );
bool addVideoTrack( const std::string& codec, unsigned int width,
unsigned int height, float fps );
virtual std::vector<VideoTrackPtr> videoTracks();
virtual bool addAudioTrack(const std::string& codec, unsigned int bitrate , unsigned int sampleRate, unsigned int nbChannels);
virtual std::vector<AudioTrackPtr> audioTracks();
virtual std::vector<VideoTrackPtr> videoTracks() override;
bool addAudioTrack(const std::string& codec, unsigned int bitrate , unsigned int sampleRate, unsigned int nbChannels);
virtual std::vector<AudioTrackPtr> audioTracks() override;
virtual const std::string& snapshot() override;
virtual bool setSnapshot( const std::string& snapshot );
bool setSnapshot( const std::string& snapshot );
virtual bool isStandAlone();
virtual unsigned int lastModificationDate();
bool isStandAlone();
unsigned int lastModificationDate();
/// Explicitely mark a file as fully parsed, meaning no metadata service needs to run anymore.
//FIXME: This lacks granularity as we don't have a straight forward way to know which service
//needs to run or not.
virtual bool markParsed();
virtual bool isParsed() const;
bool markParsed();
bool isParsed() const;
private:
DBConnection m_dbConnection;
......
......@@ -62,14 +62,14 @@ class MediaLibrary : public IMediaLibrary
virtual bool deleteLabel( LabelPtr label ) override;
virtual AlbumPtr album( const std::string& title ) override;
virtual std::shared_ptr<Album> createAlbum( const std::string& title );
std::shared_ptr<Album> createAlbum( const std::string& title );
virtual std::vector<AlbumPtr> albums() override;
virtual ShowPtr show( const std::string& name ) override;
virtual std::shared_ptr<Show> createShow( const std::string& name );
std::shared_ptr<Show> createShow( const std::string& name );
virtual MoviePtr movie( const std::string& title ) override;
virtual std::shared_ptr<Movie> createMovie( const std::string& title );
std::shared_ptr<Movie> createMovie( const std::string& title );
virtual ArtistPtr artist( const std::string& name ) override;
virtual ArtistPtr unknownArtist() override;
......
......@@ -45,18 +45,19 @@ class Movie : public IMovie, public Cache<Movie, IMovie, policy::MovieTable>
Movie( DBConnection dbConnection, sqlite3_stmt* stmt );
Movie( const std::string& title );
virtual unsigned int id() const;
virtual const std::string& title() const;
virtual time_t releaseDate() const;
virtual bool setReleaseDate(time_t date);
virtual const std::string& shortSummary() const;
virtual bool setShortSummary(const std::string& summary);
virtual const std::string& artworkUrl() const;
virtual bool setArtworkUrl(const std::string& artworkUrl);
virtual const std::string& imdbId() const;
virtual bool setImdbId(const std::string& imdbId);
virtual bool destroy();
virtual std::vector<MediaPtr> files();
virtual unsigned int id() const override;
virtual const std::string& title() const override;
virtual time_t releaseDate() const override;
bool setReleaseDate(time_t date);
virtual const std::string& shortSummary() const override;
bool setShortSummary(const std::string& summary);
virtual const std::string& artworkUrl() const override;
bool setArtworkUrl(const std::string& artworkUrl);
virtual const std::string& imdbId() const override;
bool setImdbId(const std::string& imdbId);
virtual std::vector<MediaPtr> files() override;
bool destroy();
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<Movie> create( DBConnection dbConnection, const std::string& title );
......
......@@ -44,7 +44,7 @@ class Parser : public IMetadataServiceCb
void parse( std::shared_ptr<Media> file, IMediaLibraryCb* cb );
private:
virtual void done( std::shared_ptr<Media> file, ServiceStatus status, void* data );
virtual void done( std::shared_ptr<Media> file, ServiceStatus status, void* data ) override;
void run();
private:
......
......@@ -48,21 +48,21 @@ class Show : public IShow, public Cache<Show, IShow, policy::ShowTable>
Show( DBConnection dbConnection, sqlite3_stmt* stmt );
Show( const std::string& name );
virtual unsigned int id() const;
virtual const std::string& name() const;
virtual time_t releaseDate() const;
virtual bool setReleaseDate( time_t date );
virtual const std::string& shortSummary() const;
virtual bool setShortSummary( const std::string& summary );
virtual const std::string& artworkUrl() const;
virtual bool setArtworkUrl( const std::string& artworkUrl );
virtual time_t lastSyncDate() const;
virtual const std::string& tvdbId();
virtual bool setTvdbId( const std::string& summary );
virtual std::shared_ptr<ShowEpisode> addEpisode( const std::string& title, unsigned int episodeNumber );
virtual std::vector<ShowEpisodePtr> episodes();
virtual bool destroy();
virtual unsigned int id() const override;
virtual const std::string& name() const override;
virtual time_t releaseDate() const override;
bool setReleaseDate( time_t date );
virtual const std::string& shortSummary() const override;
bool setShortSummary( const std::string& summary );
virtual const std::string& artworkUrl() const override;
bool setArtworkUrl( const std::string& artworkUrl );
virtual time_t lastSyncDate() const override;
virtual const std::string& tvdbId() override;
bool setTvdbId( const std::string& summary );
std::shared_ptr<ShowEpisode> addEpisode( const std::string& title, unsigned int episodeNumber );
virtual std::vector<ShowEpisodePtr> episodes() override;
bool destroy();
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<Show> create( DBConnection dbConnection, const std::string& name );
......
......@@ -49,20 +49,20 @@ class ShowEpisode : public IShowEpisode, public Cache<ShowEpisode, IShowEpisode,
ShowEpisode( DBConnection dbConnection, sqlite3_stmt* stmt );
ShowEpisode(const std::string& name, unsigned int episodeNumber, unsigned int showId );
virtual unsigned int id() const;
virtual const std::string& artworkUrl() const;
virtual unsigned int id() const override;
virtual const std::string& artworkUrl() const override;
bool setArtworkUrl( const std::string& artworkUrl );
virtual unsigned int episodeNumber() const;
virtual time_t lastSyncDate() const;
virtual const std::string& name() const;
virtual unsigned int episodeNumber() const override;
virtual time_t lastSyncDate() const override;
virtual const std::string& name() const override;
unsigned int seasonNumber() const;
bool setSeasonNumber(unsigned int seasonNumber);
virtual const std::string& shortSummary() const;
virtual const std::string& shortSummary() const override;
bool setShortSummary( const std::string& summary );
virtual const std::string& tvdbId() const;
virtual const std::string& tvdbId() const override;
bool setTvdbId( const std::string& tvdbId );
virtual std::shared_ptr<IShow> show();
virtual std::vector<MediaPtr> files();
virtual std::shared_ptr<IShow> show() override;
virtual std::vector<MediaPtr> files() override;
bool destroy();
static bool createTable( DBConnection dbConnection );
......
......@@ -46,11 +46,11 @@ class VideoTrack : public IVideoTrack, public Cache<VideoTrack, IVideoTrack, pol
VideoTrack( DBConnection dbConnection, sqlite3_stmt* stmt );
VideoTrack( const std::string& codec, unsigned int width, unsigned int height, float fps );
virtual unsigned int id() const;
virtual const std::string& codec() const;
virtual unsigned int width() const;
virtual unsigned int height() const;
virtual float fps() const;
virtual unsigned int id() const override;
virtual const std::string& codec() const override;
virtual unsigned int width() const override;
virtual unsigned int height() const override;
virtual float fps() const override;
static bool createTable( DBConnection dbConnection );
static std::shared_ptr<VideoTrack> fetch( DBConnection dbConnection, const std::string& codec,
......
......@@ -43,8 +43,9 @@ TEST_F( AlbumTracks, Artists )
ASSERT_NE( artist2, nullptr );
auto tracks = album->tracks();
for ( auto& t : tracks )
for ( auto& it : tracks )
{
auto t = std::static_pointer_cast<AlbumTrack>( it );
t->addArtist( artist1 );
t->addArtist( artist2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment