Represents a Item having a many-to-many relationship to zero or more Category instances.
More...
#include "item.hpp"
|
| std::string | name |
| | The descriptive name of the Item.
|
| bool | checked |
| | Whether the item is in a checked state.
|
Represents a Item having a many-to-many relationship to zero or more Category instances.
Definition at line 41 of file item.hpp.
◆ Item() [1/2]
Default constructor.
Definition at line 48 of file item.hpp.
◆ Item() [2/2]
| Item::Item |
( |
int32_t | id, |
|
|
std::string | name, |
|
|
bool | checked ) |
|
inlineprotected |
Constructor taking the id and name of the Item.
This constructor is intended to only be used by the process reading from the Kitlist XML file, hence it has protected scope.
- Parameters
-
| id | the unique ID of the Item. |
| name | the item's descriptive name. |
| checked | the item's checked state. |
Definition at line 112 of file item.hpp.
◆ get_id()
| int32_t Item::get_id |
( |
| ) |
const |
|
inline |
The unique ID of this Item.
- Returns
- the unique ID of the Item instance.
Definition at line 65 of file item.hpp.
◆ get_name()
| const std::string Item::get_name |
( |
| ) |
const |
|
inline |
This item's name.
- Returns
- the descriptive name of the Item instance.
Definition at line 73 of file item.hpp.
◆ is_checked()
| bool Item::is_checked |
( |
| ) |
const |
|
inline |
Whether this Item is checked.
- Returns
- the checked state of the Item instance.
Definition at line 82 of file item.hpp.
◆ set_checked()
| void Item::set_checked |
( |
bool | state | ) |
|
|
inlineprotected |
Sets the checked state of the Item instance.
Definition at line 118 of file item.hpp.
◆ set_name()
| void Item::set_name |
( |
const std::string & | name | ) |
|
|
inlineprotected |
Sets the descriptive name of the Item instance.
Definition at line 123 of file item.hpp.
◆ KitParser
◆ Model
◆ operator< [1/2]
| bool operator< |
( |
Item & | lhs, |
|
|
Item & | rhs ) |
|
friend |
◆ operator< [2/2]
| bool operator< |
( |
std::shared_ptr< Item > | lhs, |
|
|
std::shared_ptr< Item > | rhs ) |
|
friend |
Compares two std::shared_ptr references to Item instances.
Definition at line 96 of file item.hpp.
◆ categories
| std::vector<std::weak_ptr<Category> > Item::categories |
|
private |
◆ category_map
| std::map<int32_t, std::weak_ptr<Category> > Item::category_map |
|
private |
◆ checked
Whether the item is in a checked state.
This allows the user to choose operations that only operate on checked items and to filter the list of items using the checked state.
Definition at line 59 of file item.hpp.
◆ id
◆ name
The descriptive name of the Item.
Definition at line 51 of file item.hpp.
The documentation for this class was generated from the following file:
- /Users/frank/Projects/kitlist/src/item.hpp