|
Kitlist
A list manager for maintaining kit lists
|
Represents a Category having a many-to-many relationship to zero or more Item instances. More...
#include "category.hpp"
Public Member Functions | |
| Category () | |
| Default constructor. | |
| int32_t | get_id () const |
| const std::string | get_name () const |
| void | sort_items () |
| Sorts the list of items using the Item::operator< for comparison. | |
Public Attributes | |
| std::string | name |
| The descriptive name of the Category. | |
Protected Member Functions | |
| Category (int32_t id, std::string name) | |
| Constructor taking the id and name of the Category. | |
| void | set_name (const std::string &name) |
| Sets the descriptive name of the Category instance. | |
Private Attributes | |
| int32_t | id |
| The unique ID of the Category within the Model instance. | |
| std::vector< std::shared_ptr< Item > > | items |
| Zero or more related Item instances. | |
| std::map< int32_t, std::shared_ptr< Item > > | item_map |
| A map containing all the items, keyed by id. | |
Friends | |
| class | KitParser |
| class | Model |
| class | XmlWriter |
| bool | operator< (const Category &lhs, const Category &rhs) |
| Compares two Category instances. | |
| bool | operator< (std::shared_ptr< Category > lhs, std::shared_ptr< Category > rhs) |
| Compares two std::shared_ptr references to Category instances. | |
| bool | operator< (std::weak_ptr< Category > lhs, std::weak_ptr< Category > rhs) |
| Compares two std::weak_ptr references to Category instances. | |
Represents a Category having a many-to-many relationship to zero or more Item instances.
Definition at line 41 of file category.hpp.
|
inline |
Default constructor.
Definition at line 51 of file category.hpp.
|
inlineprotected |
Constructor taking the id and name of the Category.
This constructor is intended to only be used by the process reading from the Kitlist XML file, hence it has protected scope.
| id | the unique ID of the Category. |
| name | the category's descriptive name. |
Definition at line 120 of file category.hpp.
|
inline |
The unique ID of this Category.
Definition at line 61 of file category.hpp.
|
inline |
This category's name.
Definition at line 69 of file category.hpp.
|
inlineprotected |
Sets the descriptive name of the Category instance.
Definition at line 125 of file category.hpp.
|
inline |
Sorts the list of items using the Item::operator< for comparison.
Definition at line 77 of file category.hpp.
|
friend |
Definition at line 42 of file category.hpp.
|
friend |
Definition at line 43 of file category.hpp.
Compares two Category instances.
Definition at line 87 of file category.hpp.
Compares two std::shared_ptr references to Category instances.
Definition at line 94 of file category.hpp.
Compares two std::weak_ptr references to Category instances.
Definition at line 101 of file category.hpp.
|
friend |
Definition at line 44 of file category.hpp.
|
private |
The unique ID of the Category within the Model instance.
Definition at line 47 of file category.hpp.
|
private |
A map containing all the items, keyed by id.
Definition at line 134 of file category.hpp.
|
private |
Zero or more related Item instances.
Definition at line 131 of file category.hpp.
| std::string Category::name |
The descriptive name of the Category.
Definition at line 55 of file category.hpp.