Platform.Data.Doublets C++
Loading...
Searching...
No Matches
LinksUsagesValidator.h
Go to the documentation of this file.
2{
3 template <typename...>
5 template <std::integral TLinkAddress>
6 class LinksUsagesValidator<TLinkAddress> : public DecoratorBase<TFacade, TDecorated>
7 {
8 public:
9 LinksUsagesValidator(ILinks<TLinkAddress>& storage) : DecoratorBase(storage) {}
10
11 public:
12 TLinkAddress Update(const LinkType& restriction, const LinkType& substitution)
13 {
14 storage.EnsureNoUsages(restriction[_constants.IndexPart]);
15 return storage.Update(restriction, substitution);
16 }
17
18 public:
19 void Delete(const LinkType& restriction)
20 {
21 auto link = restriction[_constants.IndexPart];
22 storage.EnsureNoUsages(link);
23 storage.Delete(link);
24 }
25 };
26} // namespace Platform::Data::Doublets::Decorators
void Delete(const LinkType &restriction)
Definition LinksUsagesValidator.h:19
TLinkAddress Update(const LinkType &restriction, const LinkType &substitution)
Definition LinksUsagesValidator.h:12
LinksUsagesValidator(ILinks< TLinkAddress > &storage)
Definition LinksUsagesValidator.h:9
Definition Decorators.h:4