#ifndef LABEL_H #define LABEL_H #include #include class File; class Label; #include "ILabel.h" #include "Cache.h" namespace policy { struct LabelTable { static const std::string Name; static const std::string CacheColumn; static unsigned int Label::*const PrimaryKey; }; struct LabelCachePolicy { typedef std::string KeyType; static const std::string& key(const std::shared_ptr self ); static std::string key( sqlite3_stmt* stmt ); }; } class Label : public ILabel, public Cache { private: typedef Cache _Cache; public: Label(sqlite3* dbConnection, sqlite3_stmt* stmt); Label( const std::string& name ); public: virtual unsigned int id() const; virtual const std::string& name(); virtual bool files( std::vector& files ); static LabelPtr create(sqlite3* dbConnection, const std::string& name ); static bool createTable( sqlite3* dbConnection ); private: sqlite3* m_dbConnection; unsigned int m_id; std::string m_name; friend class Cache; friend struct policy::LabelTable; }; #endif // LABEL_H