libinvdb/source/include/category.hh

45 lines
992 B
C++
Raw Normal View History

2015-11-07 18:42:28 +00:00
#ifndef INVENTORY_CATEGORY_HH_
#define INVENTORY_CATEGORY_HH_
2015-11-07 19:14:47 +00:00
#include "dbcontainer.hh"
#include "dbobjectvec.hh"
#include "dbobjectptr.hh"
#include "dbobject.hh"
#include "dbfield.hh"
#include "dbassocobject.hh"
2015-11-07 18:42:28 +00:00
namespace inventory {
2015-11-07 19:14:47 +00:00
namespace db {
class DBSession;
}
2015-11-07 18:42:28 +00:00
namespace datamodel {
2015-11-07 19:14:47 +00:00
class Item;
class Category : public DBAssocHierarchicalObject<Item, Category> {
2015-11-07 18:42:28 +00:00
public:
2015-11-07 19:14:47 +00:00
static const char *sc_table;
static const char *sc_view;
static const char *sc_membership_table;
static const char *sc_dbclass;
DBString<Category> description;
DBBlob<Category> symbol;
Category()
: description(this, &desc_desc),
symbol(this, &symbol_desc) {}
2015-11-07 18:42:28 +00:00
2015-11-07 19:14:47 +00:00
static void create_tables(db::DBSession &session);
static void validate_tables(db::DBSession &session);
static void remove_tables(db::DBSession &session);
2015-11-07 18:42:28 +00:00
2015-11-07 19:14:47 +00:00
private:
static const struct DBRecordElementDesc desc_desc;
static const struct DBRecordElementDesc symbol_desc;
2015-11-07 18:42:28 +00:00
};
}
}
2015-11-07 19:14:47 +00:00
#include "category_impl.hh"
2015-11-07 18:42:28 +00:00
#endif