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

Manages and tracks associations between budget items and their tags. More...

#include <BudgetTagManager.hpp>

Collaboration diagram for drn::tagging::BudgetTagManager:

Public Member Functions

 BudgetTagManager ()=default
 BudgetTagManager (BudgetItemTags associations)
 Full initialisation constructor for associating and tracking budget items and their tags.
BudgetItemTags associated (const budgeting::BudgetItemTypes &type) const
 Retrieves the tag associations for budget items of a specified type.
const BudgetItemTagsassociations () const noexcept
 Retrieves the current associations between budget items and their tags.
void changeAssociation (const BudgetItemTags::ItemTags &itemTags)
 Updates the association between a budget item and its descriptive tags.
bool hasAssociation (const budgeting::BudgetItemIdentifier &id) const noexcept
 Checks whether a specific budget item has any associated tags.
bool isAssociated (const Tag &check) const noexcept
 Determines if a given tag is currently associated with any budget item.
const Tagspossible () const noexcept
 Retrieves the complete set of possible tags for the budget items.
void remove (const Tags &forRemoval)
 Removes the specified tags from the global set of possible tags.
void removeAssociation (const budgeting::BudgetItemIdentifier &id)
 Removes the association for a specific budget item identifier and its tags.
void renameAssociation (const budgeting::BudgetItemIdentifier &original, const budgeting::BudgetSource &changed)
 Renames an existing association between a budget item and its tags.

Detailed Description

Manages and tracks associations between budget items and their tags.

It provides an interface to manage and query tags associated with budget items. It also identifies the set of possible tags across all budget items based on the provided data. The primary purpose is to facilitate the organisation of budget items with their tags and enable querying operations such as retrieving tag associations based on specific attributes.

Constructor & Destructor Documentation

◆ BudgetTagManager() [1/2]

drn::tagging::BudgetTagManager::BudgetTagManager ( )
default

◆ BudgetTagManager() [2/2]

drn::tagging::BudgetTagManager::BudgetTagManager ( BudgetItemTags associations)
explicit

Full initialisation constructor for associating and tracking budget items and their tags.

It initialises the internal structures for managing budget items and their tag associations. It also determines all possible tags based on the provided associations.

Parameters
associationsA collection of budget items and their associated tags. This provides the foundation for managing and querying tag associations.
Here is the call graph for this function:

Member Function Documentation

◆ associated()

BudgetItemTags drn::tagging::BudgetTagManager::associated ( const budgeting::BudgetItemTypes & type) const
nodiscard

Retrieves the tag associations for budget items of a specified type.

Parameters
typeThe type of budget items to filter the tag associations by. This specifies the category of items for which the tags need to be retrieved.
Returns
A collection of budget item identifiers and their associated tags filtered by the specified type.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ associations()

const BudgetItemTags & drn::tagging::BudgetTagManager::associations ( ) const
nodiscardnoexcept

Retrieves the current associations between budget items and their tags.

Returns
The collection of budget items and their associated tags.
Here is the caller graph for this function:

◆ changeAssociation()

void drn::tagging::BudgetTagManager::changeAssociation ( const BudgetItemTags::ItemTags & itemTags)

Updates the association between a budget item and its descriptive tags.

Parameters
itemTagsA collection containing the budget item’s identifier and its updated set of descriptive tags.
Postcondition
Updates the internal structure to reflect the new association for the specified budget item.
Modifies the global set of possible tags to include the newly added tags and remove any tags no longer associated with any budget item.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasAssociation()

bool drn::tagging::BudgetTagManager::hasAssociation ( const budgeting::BudgetItemIdentifier & id) const
nodiscardnoexcept

Checks whether a specific budget item has any associated tags.

Example use case includes verifying the existence of an association before performing operations such as renaming or updating a tag.

Parameters
idThe identifier of the budget item whose association is to be checked.
Returns
True if an association exists for the specified budget item identifier, otherwise false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAssociated()

bool drn::tagging::BudgetTagManager::isAssociated ( const Tag & check) const
nodiscardnoexcept

Determines if a given tag is currently associated with any budget item.

Parameters
checkThe tag to verify for current associations.
Returns
True if the tag is found within the current associations; otherwise, false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ possible()

const Tags & drn::tagging::BudgetTagManager::possible ( ) const
nodiscardnoexcept

Retrieves the complete set of possible tags for the budget items.

Returns
The collection of all known tags available within the scope of this manager.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

void drn::tagging::BudgetTagManager::remove ( const Tags & forRemoval)

Removes the specified tags from the global set of possible tags.

Parameters
forRemovalThe tags to be removed from the global set.
Postcondition
The internal structure is updated to exclude associations for all budget items containing the specified tags.
The global set of possible tags is updated to exclude the specified tags.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeAssociation()

void drn::tagging::BudgetTagManager::removeAssociation ( const budgeting::BudgetItemIdentifier & id)

Removes the association for a specific budget item identifier and its tags.

Exceptions
ErrorIf the specified budget item does not have an existing association. This ensures that only valid identifiers with active associations can be processed.
Parameters
idThe unique identifier of the budget item whose association is being removed.
Postcondition
The internal structure is updated to exclude the association for the specified budget item.
The global set of possible tags is adjusted to reflect the removal of tags no longer in use.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renameAssociation()

void drn::tagging::BudgetTagManager::renameAssociation ( const budgeting::BudgetItemIdentifier & original,
const budgeting::BudgetSource & changed )

Renames an existing association between a budget item and its tags.

Exceptions
ErrorIf the specified budget item does not have an existing association.
Parameters
originalThe identifier representing the budget item whose association will be renamed.
changedThe new source information to associate with the budget item.
Postcondition
Moves the tags from the original budget item identifier to the new identifier with the updated source.
Removes the original association from the internal structure.
Here is the call graph for this function:
Here is the caller graph for this function: