Rosetta Protocols  2014.35
Public Types | Public Member Functions | Private Member Functions | List of all members
protocols::loops::LoopsFileFallbackConfiguration Class Reference

LoopsFileFallbackConfiguration provides instructions to the ResourceManager for loading loops_files in the absence of a resource definition file. More...

#include <LoopsFileFallbackConfiguration.hh>

Public Types

typedef
basic::resource_manager::ResourceDescription 
ResourceDescription
 

Public Member Functions

 LoopsFileFallbackConfiguration ()
 Construct the LoopsFileFallbackConfiguration. More...
 
virtual bool fallback_specified (ResourceDescription const &desc) const
 Determine if the fallback configuration has been specified and return true or false. More...
 
virtual
basic::resource_manager::LoaderType 
get_resource_loader (ResourceDescription const &desc) const
 Return the type of loader that is required for this resource. More...
 
virtual
basic::resource_manager::LocatorID 
get_locator_id (ResourceDescription const &desc) const
 Return the locator_id that will be used to construct this resource. More...
 
virtual
basic::resource_manager::ResourceOptionsOP 
get_resource_options (ResourceDescription const &desc) const
 Return an owning pointer to a ResourceOptions instance to configure this resource. More...
 
virtual std::string could_not_create_resource_error_message (ResourceDescription const &desc) const
 Return a string that should be displayed if the resource could not be created. More...
 
- Public Member Functions inherited from basic::resource_manager::FallbackConfiguration
 FallbackConfiguration ()
 
virtual ~FallbackConfiguration ()
 

Private Member Functions

basic::resource_manager::LocatorID get_loops_filename_from_options () const
 Find and return the locator_id for this resource from the options system. More...
 

Detailed Description

LoopsFileFallbackConfiguration provides instructions to the ResourceManager for loading loops_files in the absence of a resource definition file.

The class will confirm that a fallback can be created and will provide the necessary information to the ResourceManager to fully construct the resource.

Member Typedef Documentation

Constructor & Destructor Documentation

protocols::loops::LoopsFileFallbackConfiguration::LoopsFileFallbackConfiguration ( )

Construct the LoopsFileFallbackConfiguration.

Member Function Documentation

std::string protocols::loops::LoopsFileFallbackConfiguration::could_not_create_resource_error_message ( ResourceDescription const &  desc) const
virtual

Return a string that should be displayed if the resource could not be created.

Return a string that provides a helpful message to the user so s/he can determine how to correctly use the loops_file resource.

Implements basic::resource_manager::FallbackConfiguration.

bool protocols::loops::LoopsFileFallbackConfiguration::fallback_specified ( ResourceDescription const &  desc) const
virtual

Determine if the fallback configuration has been specified and return true or false.

Return true if the user has set the "-loops:loop_file" flag and false otherwise.

Implements basic::resource_manager::FallbackConfiguration.

References basic::options::OptionKeys::loops::loop_file, and basic::options::option.

basic::resource_manager::LocatorID protocols::loops::LoopsFileFallbackConfiguration::get_locator_id ( ResourceDescription const &  desc) const
virtual

Return the locator_id that will be used to construct this resource.

The locator_id for the fallback configuration is set by the options system. The get_loops_filename_from_options() helper method is used to handle complex cases.

Implements basic::resource_manager::FallbackConfiguration.

References get_loops_filename_from_options().

basic::resource_manager::LocatorID protocols::loops::LoopsFileFallbackConfiguration::get_loops_filename_from_options ( ) const
private

Find and return the locator_id for this resource from the options system.

There are three options system scenarios this method can handle. Each scenario and the corresponding behavior is outlined below:

  • A single filename is specified - return the filename as a string
  • Several filenames are specified - return one of the filenames, chosen at random, as a string
  • No filename is specified - throw an exception requesting that the user double check his/her flags.
    Exceptions
    EXCN_Msg_Exception

References basic::options::OptionKeys::loops::loop_file, basic::options::option, numeric::random::RandomGenerator::random_range(), and protocols::loops::RG.

Referenced by get_locator_id().

basic::resource_manager::LoaderType protocols::loops::LoopsFileFallbackConfiguration::get_resource_loader ( ResourceDescription const &  desc) const
virtual

Return the type of loader that is required for this resource.

The return value is "loops_file" to indicate that a LoopsFileLoader is required.

Implements basic::resource_manager::FallbackConfiguration.

basic::resource_manager::ResourceOptionsOP protocols::loops::LoopsFileFallbackConfiguration::get_resource_options ( ResourceDescription const &  desc) const
virtual

Return an owning pointer to a ResourceOptions instance to configure this resource.

Return a NULL pointer to trigger the creation of a default LoopsFileOptions later in the resource creation process.

Implements basic::resource_manager::FallbackConfiguration.


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