DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::tagging::BudgetItemTags Struct Reference

Represents a collection of budget items and their associated descriptive tags. More...

#include <BudgetItemTags.hpp>

Inheritance diagram for drn::tagging::BudgetItemTags:
Collaboration diagram for drn::tagging::BudgetItemTags:

Classes

struct  ItemTags
 Represents a budget item and its associated tags. More...
struct  ItemTagsViewRef
 Represents a view of a single budget item and its associated tags. More...

Public Member Functions

 BudgetItemTags ()=default
 BudgetItemTags (budgeting::BudgetItemIdentifier id) noexcept
 Full initialisation constructor from a specific budget item identifier.
 BudgetItemTags (const ItemTags &tag) noexcept
 Full initialisation constructor from a specific budget item identifier and its tags.
 BudgetItemTags (std::map< budgeting::BudgetItemIdentifier, Tags > tags)
 Full initialisation constructor using a mapping of budget item identifiers and their associated tags.
std::optional< ItemTagsfind (const budgeting::BudgetItemIdentifier &id) const noexcept
 Finds a budget item and its associated tags based on the specified identifier.
ItemTagsViewRef operator[] (const budgeting::BudgetItemIdentifier &id)
 An index operation into the collection of budget item tags.

Detailed Description

Represents a collection of budget items and their associated descriptive tags.

It is designed to facilitate the grouping and linkage of budget items with their respective tags.

Constructor & Destructor Documentation

◆ BudgetItemTags() [1/4]

drn::tagging::BudgetItemTags::BudgetItemTags ( )
default

◆ BudgetItemTags() [2/4]

drn::tagging::BudgetItemTags::BudgetItemTags ( budgeting::BudgetItemIdentifier id)
explicitnoexcept

Full initialisation constructor from a specific budget item identifier.

It ensures proper initialisation of the identifier and leaves the associated tags empty by default.

Parameters
idThe budget item to initialise an empty set of tags.

◆ BudgetItemTags() [3/4]

drn::tagging::BudgetItemTags::BudgetItemTags ( const ItemTags & tag)
explicitnoexcept

Full initialisation constructor from a specific budget item identifier and its tags.

It ensures proper initialisation of the identifier and leaves the associated tags empty by default.

Parameters
tagThe budget item tag to initialise from.

◆ BudgetItemTags() [4/4]

drn::tagging::BudgetItemTags::BudgetItemTags ( std::map< budgeting::BudgetItemIdentifier, Tags > tags)
explicit

Full initialisation constructor using a mapping of budget item identifiers and their associated tags.

Parameters
tagsA map where the key represents the unique identifier for a budget item, and the value represents the set of tags associated with the budget item.

Member Function Documentation

◆ find()

std::optional< ItemTags > drn::tagging::BudgetItemTags::find ( const budgeting::BudgetItemIdentifier & id) const
nodiscardnoexcept

Finds a budget item and its associated tags based on the specified identifier.

Parameters
idThe identifier of the budget item to search for within the collection.
Returns
If found, it returns the corresponding budget item and its associated tags. If the identifier does not exist, it returns no value.

◆ operator[]()

ItemTagsViewRef drn::tagging::BudgetItemTags::operator[] ( const budgeting::BudgetItemIdentifier & id)
nodiscard

An index operation into the collection of budget item tags.

Parameters
idThe unique identifier of the budget item tag.
Returns
A view into the budget item tag’s associated tags.