#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; }; 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 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; std::vector>* m_files; friend class Cache; }; #endif // LABEL_H