96 inline friend bool operator< (std::shared_ptr<Item> lhs, std::shared_ptr<Item> rhs) {
Represents a Category having a many-to-many relationship to zero or more Item instances.
void set_name(const std::string &name)
Sets the descriptive name of the Item instance.
friend bool operator<(Item &lhs, Item &rhs)
Compares two Item instances.
Item()
Default constructor.
std::string name
The descriptive name of the Item.
std::map< int32_t, std::weak_ptr< Category > > category_map
A map containing all the categories, keyed by id.
bool is_checked() const
Whether this Item is checked.
Item(int32_t id, std::string name, bool checked)
Constructor taking the id and name of the Item.
bool checked
Whether the item is in a checked state.
int32_t id
The unique ID of the Item within the Model instance.
std::vector< std::weak_ptr< Category > > categories
List of Category instances this item belongs to.
const std::string get_name() const
void set_checked(bool state)
Sets the checked state of the Item instance.