Kitlist
1.1.0
|
Defines the methods that an implementation of this class must implement. More...
#include <kitlistdao.hpp>
Public Member Functions | |
KitListDao (int verbose=0) | |
Constructor which will use default database connection parameters. More... | |
virtual | ~KitListDao () |
virtual KitModel * | get_model ()=0 |
Loads the data model. More... | |
virtual void | save_model (KitModel *model)=0 |
Saves the current data model. More... | |
void | set_verbose (int verbose_flag) |
int | is_verbose () |
virtual Category * | get_category (long cat_id, item_choice choice=ALL_ITEMS)=0 |
Loads a category. More... | |
virtual ItemContainer * | get_all_items (item_choice choice=ALL_ITEMS)=0 |
Returns a list of all items. More... | |
virtual long | add_item (const std::string name)=0 |
virtual long | add_item (const std::string name, long cat_id)=0 |
virtual void | append_items_to_category (long to_cat_id, long from_cat_id=-1, item_choice choice=ALL_ITEMS)=0 |
Copies items from one category to another. More... | |
virtual void | associate_item_with_category (long id, long cat_id)=0 |
Associates an existing item with an existing category. More... | |
virtual CategoryContainer | get_categories ()=0 |
virtual long | new_category (const std::string name)=0 |
Creates a new category. More... | |
virtual void | delete_item (long id)=0 |
virtual void | update_item_checked_state (ItemContainer &items)=0 |
Persists the state of the 'checked' flag of each item. More... | |
virtual void | remove_item_from_category (long id, long cat_id)=0 |
virtual long | get_next_item_id ()=0 |
virtual long | get_next_category_id ()=0 |
virtual void | delete_category (long id)=0 |
virtual void | set_item_flag (long id)=0 |
virtual void | unset_item_flag (long id)=0 |
virtual void | set_category_flag (long id)=0 |
virtual void | unset_category_flag (long id)=0 |
virtual void | set_all_flags ()=0 |
virtual void | unset_all_flags ()=0 |
virtual bool | require_filename () |
Indicates whether the implementation of the data model requires a filename. More... | |
Protected Attributes | |
int | m_verbose_flag |
Defines the methods that an implementation of this class must implement.
Definition at line 46 of file kitlistdao.hpp.
|
inline |
Constructor which will use default database connection parameters.
verbose | Optional parameter indicating whether to include verbose output to STDOUT. Defaults to false. |
Definition at line 59 of file kitlistdao.hpp.
|
inlinevirtual |
Definition at line 61 of file kitlistdao.hpp.
References get_model(), and save_model().
|
pure virtual |
Creates a new item.
name | The name of the new item. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Creates a new item and associates it with a category.
name | The name of the new item. |
Implemented in XmlDao.
|
pure virtual |
Copies items from one category to another.
Optionally, only checked or unchecked items are copied.
from_cat_id | The ID of the source category. |
to_cat_id | The ID of the target category. |
choice | One of ALL_ITEMS, CHECKED_ITEMS or UNCHECKED_ITEMS. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Associates an existing item with an existing category.
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
|
pure virtual |
Deletes an item by it's ID.
id | the ID of the item to delete. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Returns a list of all items.
choice | Which items to load. One of ALL_ITEMS, CHECKED_ITEMS or UNCHECKED_ITEMS. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
|
pure virtual |
Loads a category.
choice | Which items to load for the category. One of ALL_ITEMS, CHECKED_ITEMS or UNCHECKED_ITEMS. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Loads the data model.
The data model holds a rich graph of objects, representing the entire list of categories and items.
Implemented in XmlDao.
Referenced by Service::create_default_model(), Service::load_model(), and ~KitListDao().
|
pure virtual |
Returns the next unused unique id for categories.
Implemented in XmlDao.
Referenced by Service::get_next_category_id(), and is_verbose().
|
pure virtual |
Returns the next unused unique id for items.
Implemented in XmlDao.
Referenced by Service::get_next_item_id(), and is_verbose().
|
inline |
Indicates whether verbose output should be written to STDOUT.
Definition at line 92 of file kitlistdao.hpp.
References add_item(), ALL_ITEMS, append_items_to_category(), associate_item_with_category(), delete_category(), delete_item(), get_all_items(), get_categories(), get_category(), get_next_category_id(), get_next_item_id(), m_verbose_flag, new_category(), remove_item_from_category(), set_all_flags(), set_category_flag(), set_item_flag(), unset_all_flags(), unset_category_flag(), unset_item_flag(), and update_item_checked_state().
|
pure virtual |
Creates a new category.
name | the name of the new category. |
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Un-associates the specified item from the specified category.
Implemented in XmlDao.
Referenced by is_verbose().
|
inlinevirtual |
Indicates whether the implementation of the data model requires a filename.
Some persistence models may require a filename to be chosen, others (e.g. database) may be defined through another mechanism. If a filename has not been set, then fire up save-as instead.
Reimplemented in XmlDao.
Definition at line 225 of file kitlistdao.hpp.
Referenced by Service::require_filename().
|
pure virtual |
Saves the current data model.
Note: The data model will only be saved if it is dirty. Further, only items that are individually flagged as dirty will be saved.
Implemented in XmlDao.
Referenced by Service::save(), and ~KitListDao().
|
pure virtual |
|
pure virtual |
Checks/ticks all items in the specified Category.
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
Sets the checked flag for an item.
id | The id of the item to change. |
Implemented in XmlDao.
Referenced by is_verbose().
|
inline |
Indicates whether verbose output should be written to STDOUT.
Definition at line 85 of file kitlistdao.hpp.
References verbose_flag.
|
pure virtual |
|
pure virtual |
Unchecks/unticks all items in the specified Category.
Implemented in XmlDao.
Referenced by is_verbose().
|
pure virtual |
|
pure virtual |
Persists the state of the 'checked' flag of each item.
Implemented in XmlDao.
Referenced by is_verbose().
|
protected |
Optional parameter indicating whether to include verbose output to STDOUT. Defaults to false.
Definition at line 50 of file kitlistdao.hpp.
Referenced by is_verbose().