46 void set_name (
const std::string name) { m_name = name; }
53 virtual bool has_items() {
return !m_items.empty(); }
virtual bool has_items()
Returns true if there are any items associated with this category.
ItemContainer m_items
List of associated items.
CategoryContainer::iterator CategoryIter
virtual void add_item(Item *item)
Associates the passed item with this Category.
int operator()(Category *c1, Category *c2)
std::vector< Item * > ItemContainer
void foreach_item(const SlotForeachItem &slot)
Executes a callback function for each associated item.
void set_name(const std::string name)
virtual size_t item_count()
Returns the number of items associated with this category.
sigc::slot< bool, Item & > SlotForeachItem
std::string m_name
The category name.
virtual void remove_item(Item *item)
Removes the association of the passed item from this Category.
void execute(ItemFunctor &functor)
Executes the passed ItemFunctor.
Holds a rich graph of objects representing the application's data model.
Comparator used for sorting Categories by name.
std::vector< Category * > CategoryContainer
int operator()(Category *c1, Category *c2)
Functor for processing items.
Comparator used for comparing Categories by id.