Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
SpecsCpp::SpecTagCollection Class Reference

#include <SpecTagCollection.h>

Inheritance diagram for SpecsCpp::SpecTagCollection:
SpecsCpp::ISpecTagCollection

Public Member Functions

void add (const char *value) override
 
bool has (const char *key) const override
 
void foreach_tag (ForEachTagFn *fn) const override
 
void merge (ISpecTagCollection *other) override
 
void clear () override
 
- Public Member Functions inherited from SpecsCpp::ISpecTagCollection
virtual ~ISpecTagCollection ()=default
 
virtual void add (const char *)=0
 
virtual bool has (const char *) const =0
 
virtual void foreach_tag (ForEachTagFn *) const =0
 
virtual void merge (ISpecTagCollection *)=0
 
virtual void clear ()=0
 
void foreach (std::function< void(const char *)> fn) const
 

Additional Inherited Members

- Public Types inherited from SpecsCpp::ISpecTagCollection
using ForEachTagFn = IFunctionPointer< void(const char *)>
 

Detailed Description

Definition at line 10 of file SpecTagCollection.h.

Member Function Documentation

◆ add()

void SpecsCpp::SpecTagCollection::add ( const char *  value)
inlineoverridevirtual

Implements SpecsCpp::ISpecTagCollection.

Definition at line 19 of file SpecTagCollection.h.

19{ _tags.emplace(value); }

Referenced by SpecsCpp::GlobalSpecGroup::add_tag_for_next_component().

◆ clear()

void SpecsCpp::SpecTagCollection::clear ( )
inlineoverridevirtual

Implements SpecsCpp::ISpecTagCollection.

Definition at line 28 of file SpecTagCollection.h.

28{ _tags.clear(); }

◆ foreach_tag()

void SpecsCpp::SpecTagCollection::foreach_tag ( ForEachTagFn fn) const
inlineoverridevirtual

Implements SpecsCpp::ISpecTagCollection.

Definition at line 24 of file SpecTagCollection.h.

24 {
25 for (auto& tag : _tags) fn->invoke(tag.c_str());
26 }

◆ has()

bool SpecsCpp::SpecTagCollection::has ( const char *  key) const
inlineoverridevirtual

Implements SpecsCpp::ISpecTagCollection.

Definition at line 20 of file SpecTagCollection.h.

20 {
21 auto found = _tags.find(key);
22 return found != _tags.end();
23 }

◆ merge()

void SpecsCpp::SpecTagCollection::merge ( ISpecTagCollection other)
inlineoverridevirtual

Implements SpecsCpp::ISpecTagCollection.

Definition at line 27 of file SpecTagCollection.h.

27{ other->foreach_tag(&_merge_foreach); }

The documentation for this class was generated from the following file: