Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
SpecsCpp::ISpecDataValueCollection Struct Referenceabstract

#include <API.h>

Inheritance diagram for SpecsCpp::ISpecDataValueCollection:
SpecsCpp::SpecDataValueCollection

Public Types

using ForEachSpecDataFn = IFunctionPointer< void(ISpecDataValue *)>
 

Public Member Functions

virtual ~ISpecDataValueCollection ()=default
 
virtual void add (ISpecDataValue *)=0
 
virtual bool has (const char *name) const =0
 
virtual ISpecDataValueget (const char *name) const =0
 
virtual bool get_bool (const char *name) const
 
virtual int get_int (const char *name) const
 
virtual unsigned int get_unsigned_int (const char *name) const
 
virtual double get_float (const char *name) const
 
virtual const char * get_string (const char *name) const
 
virtual void * get_pointer (const char *name) const
 
virtual void foreach_value (ForEachSpecDataFn *) const =0
 
virtual void merge (ISpecDataValueCollection *)=0
 
virtual void clear ()=0
 
void foreach (std::function< void(ISpecDataValue *)> fn) const
 

Detailed Description

Definition at line 67 of file API.h.

Member Typedef Documentation

◆ ForEachSpecDataFn

Definition at line 68 of file API.h.

Constructor & Destructor Documentation

◆ ~ISpecDataValueCollection()

virtual SpecsCpp::ISpecDataValueCollection::~ISpecDataValueCollection ( )
virtualdefault

Member Function Documentation

◆ add()

virtual void SpecsCpp::ISpecDataValueCollection::add ( ISpecDataValue )
pure virtual

◆ clear()

virtual void SpecsCpp::ISpecDataValueCollection::clear ( )
pure virtual

◆ foreach()

void SpecsCpp::ISpecDataValueCollection::foreach ( std::function< void(ISpecDataValue *)>  fn) const
inline

Definition at line 105 of file API.h.

105 {
106 auto callback = unique_function_pointer(fn);
107 this->foreach_value(callback.get());
108 }
virtual void foreach_value(ForEachSpecDataFn *) const =0

◆ foreach_value()

virtual void SpecsCpp::ISpecDataValueCollection::foreach_value ( ForEachSpecDataFn ) const
pure virtual

◆ get()

virtual ISpecDataValue * SpecsCpp::ISpecDataValueCollection::get ( const char *  name) const
pure virtual

◆ get_bool()

virtual bool SpecsCpp::ISpecDataValueCollection::get_bool ( const char *  name) const
inlinevirtual

Definition at line 76 of file API.h.

76 {
77 if (!has(name)) return false;
78 return get(name)->bool_value();
79 }
virtual ISpecDataValue * get(const char *name) const =0
virtual bool has(const char *name) const =0
virtual bool bool_value() const =0

◆ get_float()

virtual double SpecsCpp::ISpecDataValueCollection::get_float ( const char *  name) const
inlinevirtual

Definition at line 88 of file API.h.

88 {
89 if (!has(name)) return 0.0;
90 return get(name)->float_value();
91 }
virtual double float_value() const =0

◆ get_int()

virtual int SpecsCpp::ISpecDataValueCollection::get_int ( const char *  name) const
inlinevirtual

Definition at line 80 of file API.h.

80 {
81 if (!has(name)) return 0;
82 return get(name)->int_value();
83 }
virtual int int_value() const =0

◆ get_pointer()

virtual void * SpecsCpp::ISpecDataValueCollection::get_pointer ( const char *  name) const
inlinevirtual

Definition at line 96 of file API.h.

96 {
97 if (!has(name)) return nullptr;
98 return get(name)->pointer_value();
99 }
virtual void * pointer_value() const =0

◆ get_string()

virtual const char * SpecsCpp::ISpecDataValueCollection::get_string ( const char *  name) const
inlinevirtual

Definition at line 92 of file API.h.

92 {
93 if (!has(name)) return nullptr;
94 return get(name)->string_value();
95 }
virtual const char * string_value() const =0

◆ get_unsigned_int()

virtual unsigned int SpecsCpp::ISpecDataValueCollection::get_unsigned_int ( const char *  name) const
inlinevirtual

Definition at line 84 of file API.h.

84 {
85 if (!has(name)) return 0;
86 return get(name)->unsigned_int_value();
87 }
virtual unsigned int unsigned_int_value() const =0

◆ has()

virtual bool SpecsCpp::ISpecDataValueCollection::has ( const char *  name) const
pure virtual

◆ merge()

virtual void SpecsCpp::ISpecDataValueCollection::merge ( ISpecDataValueCollection )
pure virtual

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