![]() |
Rosetta Utilities
2014.16.56682
|
The FallbackConfigurationFactory is a singleton factory with which FallbackConfigurationCreator objects should be registered. The "fallback" system serves as a mechanism for preserving command-line functionality even while switching more protocols from requesting resources from the ResourceManager rather than reading directly from the command line. More...
#include <FallbackConfigurationFactory.hh>
Public Member Functions | |
| FallbackConfigurationOP | create_fallback_configuration (std::string const &resource_description) const |
| void | factory_register (FallbackConfigurationCreatorOP creator) |
| bool | has_fallback_for_resource (std::string const &desc) const |
| void | set_throw_on_double_registration () |
| Only useful for unit testing. Since factory registration happens (sometimes) at load time, there may be no one to catch a thrown exception in the event of a name collision two FallbackConfigurationCreators that register for the same. More... | |
Static Public Member Functions | |
| static FallbackConfigurationFactory * | get_instance () |
| static function to get the instance of ( pointer to) this singleton class More... | |
Private Types | |
| typedef std::map< std::string, FallbackConfigurationCreatorOP > | FallbackConfigurationCreatorsMap |
Private Member Functions | |
| FallbackConfigurationFactory () | |
Static Private Member Functions | |
| static FallbackConfigurationFactory * | create_singleton_instance () |
| private singleton creation function to be used with utility::thread::threadsafe_singleton More... | |
Private Attributes | |
| bool | throw_on_double_registration_ |
| FallbackConfigurationCreatorsMap | creators_map_ |
Static Private Attributes | |
| static FallbackConfigurationFactory * | instance_ |
The FallbackConfigurationFactory is a singleton factory with which FallbackConfigurationCreator objects should be registered. The "fallback" system serves as a mechanism for preserving command-line functionality even while switching more protocols from requesting resources from the ResourceManager rather than reading directly from the command line.
When a resource with a particular resource-description string is requested from the ResourceManager, and the ResourceManager does not have any instructions on how to load a resource matching that description, then the ResourceManager will then ask the FallbackConfigurationFactory for help. The FallbackConfigurationFactory can first answer "does this resource description match any resource descriptions for which you have a registered FallbackConfigurationCreator?" and if the answer is "yes", then the ResourceManager can request that FallbackConfigurationCreator and ask, first, if it is able to construct a resource (FallbackConfigurations often read from the command line, and it's possible that the required flags have not been put on the command line), and if so, then request data from the FallbackConfiguration needed to contruct that resource.
|
private |
|
private |
Referenced by create_singleton_instance().
| FallbackConfigurationOP basic::resource_manager::FallbackConfigurationFactory::create_fallback_configuration | ( | std::string const & | resource_description | ) | const |
References creators_map_.
|
staticprivate |
private singleton creation function to be used with utility::thread::threadsafe_singleton
References FallbackConfigurationFactory().
Referenced by get_instance().
| void basic::resource_manager::FallbackConfigurationFactory::factory_register | ( | FallbackConfigurationCreatorOP | creator | ) |
References creators_map_, throw_on_double_registration_, and utility_exit_with_message.
|
static |
static function to get the instance of ( pointer to) this singleton class
References create_singleton_instance(), instance_, and utility::thread::safely_create_singleton().
| bool basic::resource_manager::FallbackConfigurationFactory::has_fallback_for_resource | ( | std::string const & | desc | ) | const |
References creators_map_.
| void basic::resource_manager::FallbackConfigurationFactory::set_throw_on_double_registration | ( | ) |
Only useful for unit testing. Since factory registration happens (sometimes) at load time, there may be no one to catch a thrown exception in the event of a name collision two FallbackConfigurationCreators that register for the same.
References throw_on_double_registration_.
|
private |
Referenced by create_fallback_configuration(), factory_register(), and has_fallback_for_resource().
|
staticprivate |
Referenced by get_instance().
|
private |
Referenced by factory_register(), and set_throw_on_double_registration().
1.8.7