Package rosetta :: Package basic :: Package resource_manager :: Module _basic_resource_manager_ :: Class FallbackConfiguration
[hide private]
[frames] | no frames]

Class FallbackConfiguration

 object --+    
          |    
??.instance --+
              |
             FallbackConfiguration
Known Subclasses:

The %FallbackConfiguration class describes how a resource should be created if the ResourceManager is not being used, i.e., if resources have been specified through flags on the command line instead of through a resource-definition file. A protocol will still query the ResourceManager for its desired resource in such a case (by its "resource_description") and if no resource has been provided for that description, then the ResourceManager will ask the FallbackConfigurationFactory for the %FallbackConfiguration that has been registered for that resource description (this registration logic is handled by the FallbackConfigurationCreator) and ask it to provide the information necessary to create the appropriate resource from the command line. For example, a user can define the loop they are interested in modeling to the loop-modeling protocol via the LoopsFileData resource. The loop modeling protocol once was but is no longer responsible for opening a text file and creating a LoopsFileData object from that text file; instead it asks the ResourceManager directly for the resource. For the sake of backwards compatibility, the ResourceManager must have some way of creating a LoopsFileData object from the command line. If someone is using the loop modeling application, but does not provide a resource definition, then the LoopsFileFallbackConfiguration (derived from %FallbackConfiguration) will be called upon by the ResourceManager for three things: 1) the name of the ResourceLoader to use to create the resource ("LoopsFile"), 2) the locator_id for the Resource (which it goes to the command line to find), and 3) a ResourceOptionsOP which is either null (meaning "use the default") or is in some way initialized with options from the command line. With these three bits, the ResourceManager will go the appropriate ResourceLoader and request the construction of the Resource as usual, opening the file using the default ResourceLocator (for the JD2ResourceManager, this is the FileSystemResourceLocator).

Instance Methods [hide private]
 
__init__(...)
__init__( (object)arg1) -> None :
 
__reduce__(...)
helper for pickle
 
could_not_create_resource_error_message(...)
could_not_create_resource_error_message( (FallbackConfiguration)arg1, (str)desc) -> str : If the %FallbackConfiguration has not been provided the appropriate set of command line flags needed to construct the Resource given the resource description, then return an error message informing the user what options must be provided on the command line.
 
fallback_specified(...)
fallback_specified( (FallbackConfiguration)arg1, (str)desc) -> bool : Return true if a fallback been provided for the given resource description.
 
get_locator_id(...)
get_locator_id( (FallbackConfiguration)arg1, (str)desc) -> str : Return the locator id that the resource locator should use to find the data used to construct the desired resource - e.g.
 
get_resource_loader(...)
get_resource_loader( (FallbackConfiguration)arg1, (str)desc) -> str : Return the name of the resource loader that should be used to instantiate the desired resource
 
get_resource_options(...)
get_resource_options( (FallbackConfiguration)arg1, (str)desc) -> ResourceOptions : Return a pointer to the ResourceOptions object that the ResourceLoader will use to instantiate the given resource.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __instance_size__ = 32
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

__init__( (object)arg1) -> None :

    C++ signature :
        void __init__(_object*)

Overrides: object.__init__

__reduce__(...)

 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

could_not_create_resource_error_message(...)

 

could_not_create_resource_error_message( (FallbackConfiguration)arg1, (str)desc) -> str :
    If the %FallbackConfiguration has not been provided the appropriate set
    of command line flags needed to construct the Resource given the
    resource description, then return an error message informing the user
    what options must be provided on the command line.
    

    C++ signature :
        std::string could_not_create_resource_error_message(basic::resource_manager::FallbackConfiguration {lvalue},std::string)

could_not_create_resource_error_message( (FallbackConfiguration)arg1, (str)arg2) -> None :

    C++ signature :
        void could_not_create_resource_error_message(boost::shared_ptr<FallbackConfiguration_exposer_callback> {lvalue},std::string)

fallback_specified(...)

 

fallback_specified( (FallbackConfiguration)arg1, (str)desc) -> bool :
    Return true if a fallback been provided for the given resource description.
    It is possible that the fallback configuration would be unable to deliver
    a requested resource, e.g. if the appropriate command line option has not been provided.
    

    C++ signature :
        bool fallback_specified(basic::resource_manager::FallbackConfiguration {lvalue},std::string)

fallback_specified( (FallbackConfiguration)arg1, (str)arg2) -> None :

    C++ signature :
        void fallback_specified(boost::shared_ptr<FallbackConfiguration_exposer_callback> {lvalue},std::string)

get_locator_id(...)

 

get_locator_id( (FallbackConfiguration)arg1, (str)desc) -> str :
    Return the locator id that the resource locator should use to
    find the data used to construct the desired resource - e.g. the file name.
    

    C++ signature :
        std::string get_locator_id(basic::resource_manager::FallbackConfiguration {lvalue},std::string)

get_locator_id( (FallbackConfiguration)arg1, (str)arg2) -> None :

    C++ signature :
        void get_locator_id(boost::shared_ptr<FallbackConfiguration_exposer_callback> {lvalue},std::string)

get_resource_loader(...)

 

get_resource_loader( (FallbackConfiguration)arg1, (str)desc) -> str :
    Return the name of the resource loader that should be used to instantiate the
    desired resource
    

    C++ signature :
        std::string get_resource_loader(basic::resource_manager::FallbackConfiguration {lvalue},std::string)

get_resource_loader( (FallbackConfiguration)arg1, (str)arg2) -> None :

    C++ signature :
        void get_resource_loader(boost::shared_ptr<FallbackConfiguration_exposer_callback> {lvalue},std::string)

get_resource_options(...)

 

get_resource_options( (FallbackConfiguration)arg1, (str)desc) -> ResourceOptions :
    Return a pointer to the ResourceOptions object that the
    ResourceLoader will use to instantiate the given resource.  Return 0
    if the default ResourceOptions specified by the appropriate ResourceLoader
    should be used.
    

    C++ signature :
        boost::shared_ptr<basic::resource_manager::ResourceOptions> get_resource_options(basic::resource_manager::FallbackConfiguration {lvalue},std::string)

get_resource_options( (FallbackConfiguration)arg1, (str)arg2) -> None :

    C++ signature :
        void get_resource_options(boost::shared_ptr<FallbackConfiguration_exposer_callback> {lvalue},std::string)