Package rosetta :: Package basic :: Package resource_manager :: Package locator :: Module _basic_resource_manager_locator_ :: Class DatabaseResourceLocator
[hide private]
[frames] | no frames]

Class DatabaseResourceLocator

                          object --+        
                                   |        
                         ??.instance --+    
                                       |    
_basic_resource_manager_.ResourceLocator --+
                                           |
                                          DatabaseResourceLocator

The %DatabaseResourceLocator class is responsible for retreiving data from a Database so that that data can then be used to construct a Resource. Upon construction or in its parse_my_tag method, the %DatabaseResourceLocator needs to be given the name of the database-session resource that it will use to communicate with the database and a partially formatted SQL command (a SELECT statement) that will be used to query the database for the resource that it will be pulling from the database. This SQL command should have a single question mark ("?") for the variable that will be replaced by the locator_id that will be given to the %DatabaseResourceLocator when its locate_resource_stream method is invoked. In that method, the %DatabaseResourceLocator will ask the ResourceManager for the database session object and then bind the input "locator_id" to the previously provided SQL command, and finally will query the database with that statement. The resulting output is packaged in a string stream and returned to the code that called locate_resource_stream (e.g. the ResourceManager) and then can be used to construct a resource.

Instance Methods [hide private]
 
__init__(...)
__init__( (object)arg1) -> None :
 
locate_resource_stream(...)
locate_resource_stream( (DatabaseResourceLocator)arg1, (str)locator_tag) -> ResourceStream : Create a ResourceStream object from the given resource source, so that its stream can be passed to the ResourceLoader using the input "locator_tag" which is bound to the partially formed SQL select statement that was provided at construction or in parse_my_tag
 
locator_tag(...)
locator_tag( (DatabaseResourceLocator)arg1) -> str : Return the name for this %ResourceLocator
 
parse_my_tag(...)
parse_my_tag( (DatabaseResourceLocator)arg1, (Tag)tag) -> None : Initialize the %DatabaseResourceLoader from the input set of tags which should contain both the name of the database session resource that will be used to talk to the database, and the partially formed SQL select statement that will be used to query the database.
 
show(...)
show( (DatabaseResourceLocator)arg1, (OStream)out) -> None : Describe the %DatabaseResourceLocator instance to the given output stream
 
type(...)
type( (DatabaseResourceLocator)arg1) -> str : Return the typename for this class: "DatabaseResourceLocator"

Inherited from _basic_resource_manager_.ResourceLocator: __reduce__

Inherited from unreachable.instance: __new__

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

Class Variables [hide private]

Inherited from _basic_resource_manager_.ResourceLocator: __instance_size__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

__init__( (object)arg1) -> None :

    C++ signature :
        void __init__(_object*)

__init__( (object)arg1, (str)database_session_resource_tag, (str)sql_command) -> None :
    Constructor that takes in both the name of the database session resource
    as well as the SQL command
    

    C++ signature :
        void __init__(_object*,std::string,std::string)

__init__( (object)arg1, (DatabaseResourceLocator)src) -> None :
    basic/resource_manager/locator/DatabaseResourceLocator.hh:69

    C++ signature :
        void __init__(_object*,basic::resource_manager::locator::DatabaseResourceLocator)

Overrides: object.__init__

locate_resource_stream(...)

 

locate_resource_stream( (DatabaseResourceLocator)arg1, (str)locator_tag) -> ResourceStream :
    Create a ResourceStream object from the given resource
    source, so that its stream can be passed to the ResourceLoader
    using the input "locator_tag" which is bound to the partially formed
    SQL select statement that was provided at construction or in
    parse_my_tag
    

    C++ signature :
        boost::shared_ptr<basic::resource_manager::ResourceStream> locate_resource_stream(basic::resource_manager::locator::DatabaseResourceLocator {lvalue},std::string)

locate_resource_stream( (DatabaseResourceLocator)arg1, (str)locator_tag) -> ResourceStream :

    C++ signature :
        boost::shared_ptr<basic::resource_manager::ResourceStream> locate_resource_stream(DatabaseResourceLocator_exposer_callback {lvalue},std::string)

Overrides: _basic_resource_manager_.ResourceLocator.locate_resource_stream

locator_tag(...)

 

locator_tag( (DatabaseResourceLocator)arg1) -> str :
    Return the name for this %ResourceLocator
    

    C++ signature :
        std::string locator_tag(basic::resource_manager::locator::DatabaseResourceLocator {lvalue})

locator_tag( (DatabaseResourceLocator)arg1) -> str :

    C++ signature :
        std::string locator_tag(DatabaseResourceLocator_exposer_callback {lvalue})

locator_tag( (DatabaseResourceLocator)arg1, (str)locator_tag) -> None :
    Set the name for this %ResourceLocator
    

    C++ signature :
        void locator_tag(basic::resource_manager::locator::DatabaseResourceLocator {lvalue},std::string)

locator_tag( (DatabaseResourceLocator)arg1, (str)locator_tag) -> None :

    C++ signature :
        void locator_tag(DatabaseResourceLocator_exposer_callback {lvalue},std::string)

Overrides: _basic_resource_manager_.ResourceLocator.locator_tag

parse_my_tag(...)

 

parse_my_tag( (DatabaseResourceLocator)arg1, (Tag)tag) -> None :
    Initialize the %DatabaseResourceLoader from the input set of tags
    which should contain both the name of the database session resource that
    will be used to talk to the database, and the partially formed SQL
    select statement that will be used to query the database.
    

    C++ signature :
        void parse_my_tag(basic::resource_manager::locator::DatabaseResourceLocator {lvalue},boost::shared_ptr<utility::tag::Tag const>)

parse_my_tag( (DatabaseResourceLocator)arg1, (Tag)tag) -> None :

    C++ signature :
        void parse_my_tag(DatabaseResourceLocator_exposer_callback {lvalue},boost::shared_ptr<utility::tag::Tag const>)

Overrides: _basic_resource_manager_.ResourceLocator.parse_my_tag

show(...)

 

show( (DatabaseResourceLocator)arg1, (OStream)out) -> None :
    Describe the %DatabaseResourceLocator instance to the given output stream
    

    C++ signature :
        void show(basic::resource_manager::locator::DatabaseResourceLocator {lvalue},std::ostream {lvalue})

show( (DatabaseResourceLocator)arg1, (OStream)out) -> None :

    C++ signature :
        void show(DatabaseResourceLocator_exposer_callback {lvalue},std::ostream {lvalue})

Overrides: _basic_resource_manager_.ResourceLocator.show

type(...)

 

type( (DatabaseResourceLocator)arg1) -> str :
    Return the typename for this class: "DatabaseResourceLocator"
    

    C++ signature :
        std::string type(basic::resource_manager::locator::DatabaseResourceLocator {lvalue})

type( (DatabaseResourceLocator)arg1) -> str :

    C++ signature :
        std::string type(DatabaseResourceLocator_exposer_callback {lvalue})

Overrides: _basic_resource_manager_.ResourceLocator.type