Class NamedValueComparatorsAndCopiersRepository

Class Documentation

class NamedValueComparatorsAndCopiersRepository
[source]

Stores NamedValueComparator and NamedValueCopier instances keyed by type name.

Install comparators and copiers via install_comparator() / install_copier() before running tests that pass custom types as mock parameters. Support delegates to this repository when comparing or copying parameter values of custom types.

Public Functions

NamedValueComparatorsAndCopiersRepository() = default
[source]
virtual ~NamedValueComparatorsAndCopiersRepository()
[source]
virtual void install_comparator(StringView name, NamedValueComparator &comparator)

Register a comparator for a custom type.

Parameters:
  • name – Type name used as the lookup key.

  • comparator – Comparator to register.

virtual void install_copier(StringView name, NamedValueCopier &copier)

Register a copier for a custom type.

Parameters:
  • name – Type name used as the lookup key.

  • copier – Copier to register.

virtual void install_comparators_and_copiers(const NamedValueComparatorsAndCopiersRepository &repository)

Copy all comparators and copiers from repository into this one.

Parameters:

repository – Source repository to merge from.

virtual NamedValueComparator *get_comparator_for_type(StringView name)

Look up the comparator registered for a type.

Parameters:

name – Type name to look up.

Returns:

Pointer to the registered NamedValueComparator, or nullptr.

virtual NamedValueCopier *get_copier_for_type(StringView name)

Look up the copier registered for a type.

Parameters:

name – Type name to look up.

Returns:

Pointer to the registered NamedValueCopier, or nullptr.

void clear()
[source]

Remove all installed comparators and copiers.