cgv
Loading...
Searching...
No Matches
cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT > Class Template Reference

A helper class to simplify registering color schemes in a registry and counting the number of successful registrations. More...

#include <color_scheme.h>

Public Member Functions

 color_scheme_registry_helper (RegistryT &registry, const std::set< ColorSchemeType > &types)
 Construct using a reference to the used registry and supported set of types.
 
void load (const std::string &name, const ColorSchemeT &scheme)
 Register a color scheme under the given name.
 
bool can_load (ColorSchemeType type) const
 Return whether the registry helper can load the given type of color scheme.
 
size_t loaded_count () const
 Return the count of successfully registered color schemes.
 

Detailed Description

template<typename RegistryT, typename ColorSchemeT>
class cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT >

A helper class to simplify registering color schemes in a registry and counting the number of successful registrations.

Can be configured to only accept certain color scheme types.

Template Parameters
RegistryTThe registry type. Must accept ColorSchemeT.
ColorSchemeTThe color scheme class type.

Definition at line 231 of file color_scheme.h.

Constructor & Destructor Documentation

◆ color_scheme_registry_helper()

template<typename RegistryT , typename ColorSchemeT >
cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT >::color_scheme_registry_helper ( RegistryT &  registry,
const std::set< ColorSchemeType > &  types 
)
inline

Construct using a reference to the used registry and supported set of types.

Parameters
registryThe used color scheme registry.
typesThe supported color scheme types.

Definition at line 237 of file color_scheme.h.

Member Function Documentation

◆ can_load()

template<typename RegistryT , typename ColorSchemeT >
bool cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT >::can_load ( ColorSchemeType  type) const
inline

Return whether the registry helper can load the given type of color scheme.

Parameters
typeThe color scheme type to query.
Returns
True if the scheme is supported, false otherwise.

Definition at line 251 of file color_scheme.h.

◆ load()

template<typename RegistryT , typename ColorSchemeT >
void cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT >::load ( const std::string &  name,
const ColorSchemeT &  scheme 
)
inline

Register a color scheme under the given name.

Parameters
nameThe color scheme name.
schemeThe color scheme.

Definition at line 243 of file color_scheme.h.

◆ loaded_count()

template<typename RegistryT , typename ColorSchemeT >
size_t cgv::media::color_scheme_registry_helper< RegistryT, ColorSchemeT >::loaded_count ( ) const
inline

Return the count of successfully registered color schemes.

Definition at line 256 of file color_scheme.h.


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