CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
history::SqlRetrieveTag< MixinT > Class Template Reference

#include <history_sql.h>

Inheritance diagram for history::SqlRetrieveTag< MixinT >:
Collaboration diagram for history::SqlRetrieveTag< MixinT >:

Public Member Functions

History::Tag RetrieveTag () const
 

Detailed Description

template<class MixinT>
class history::SqlRetrieveTag< MixinT >

A mixin that allows to inject the RetrieveTag() method if it is needed in an SQL query subclass.

This allows us to orchestrate specific functionality in those classes as we need it, without relying on multiple inheritance. Otherwise one would inherit from sqlite::Sql more than once when inheriting from more than one of those mixin classes in a query subclass. In contrast, the mixins produce a clear (single) inheritance graph for each of the derived classes by chaining the functionality as seen below.

Example: class SqlListRollbackTags : public SqlRetrieveTag<SqlRollback<SqlHistory>> {}

########## Note: both SqlRetrieveTag and SqlRollback need the

sqlite::Sql # functionality provided in sqlite::Sql, thus

########## would otherwise be derived from it individually

´|` |

SqlHistory # <— # SqlRetrieveTag # <— # SqlRollback

´|` |

SqlListRollbackTags

Note: MixinT needs to be eventually derived from sqlite::Sql as it uses Sql::Retrieve...() methods to extract information from SQLite rows.

Parameters
MixinTthe class that should gain RetrieveTag()'s functionality

Definition at line 96 of file history_sql.h.

Member Function Documentation

template<class MixinT>
History::Tag history::SqlRetrieveTag< MixinT >::RetrieveTag ( ) const
inline

Retrieves a tag from a database row See SqlHistory::db_fields for a listing of the used SQLite data fields

Returns
a tag retrieved from the SQLite database row

Definition at line 104 of file history_sql.h.


The documentation for this class was generated from the following file: