Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
basic::resource_manager::ResourceLocator Class Referenceabstract

ResourceLocator classes are responsible for retrieving data from a data store that will be used to construct a Resource. This data store could be a file system or a database or any other place where data is stored. More...

#include <ResourceLocator.hh>

Inheritance diagram for basic::resource_manager::ResourceLocator:
Inheritance graph
[legend]

Public Member Functions

 ResourceLocator ()
 Construct a ResourceLocator and initialize its name (its locator_tag) to the empty string. More...
 
 ResourceLocator (std::string const &locator_tag)
 Construct a ResourceLocator while setting its name to the input locater_tag. More...
 
 ResourceLocator (ResourceLocator const &src)
 Copy construct a ResourceLocator from an example locator. More...
 
 ~ResourceLocator () override
 
virtual ResourceStreamOP locate_resource_stream (std::string const &locator_id) const =0
 Create and return a ResourceStream object from the given locator_id so that its stream can be passed to the ResourceLoader. More...
 
virtual void parse_my_tag (utility::tag::TagCOP tag)=0
 Initialize the parameters for this ResourceLocator from the contents of an XML file. More...
 
virtual void locator_tag (std::string const &locator_tag)
 Set the name for this ResourceLocator. More...
 
virtual std::string locator_tag () const
 Return the name for this ResourceLocator. More...
 
virtual void show (std::ostream &out) const =0
 Write a description of this ResourceLocator to an out stream. More...
 
virtual std::string type () const =0
 Return the class name for this ResourceLocator instance. This function allows for better error message delivery. More...
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Private Attributes

std::string locator_tag_
 

Detailed Description

ResourceLocator classes are responsible for retrieving data from a data store that will be used to construct a Resource. This data store could be a file system or a database or any other place where data is stored.

The ResourceManager asks the ResourceLocator to produce a ResourceStream object when given a "locator_id." A "locator_id" is what's needed to identify a data source from a data store: for example, for the FileSystemResourceLocator, the locator id is a file name; for the DatabaseResourceLocator, it would be a database query.

Constructor & Destructor Documentation

basic::resource_manager::ResourceLocator::ResourceLocator ( )

Construct a ResourceLocator and initialize its name (its locator_tag) to the empty string.

basic::resource_manager::ResourceLocator::ResourceLocator ( std::string const &  locator_tag)

Construct a ResourceLocator while setting its name to the input locater_tag.

basic::resource_manager::ResourceLocator::ResourceLocator ( ResourceLocator const &  src)

Copy construct a ResourceLocator from an example locator.

basic::resource_manager::ResourceLocator::~ResourceLocator ( )
overridedefault

Member Function Documentation

virtual ResourceStreamOP basic::resource_manager::ResourceLocator::locate_resource_stream ( std::string const &  locator_id) const
pure virtual
void basic::resource_manager::ResourceLocator::locator_tag ( std::string const &  locator_tag)
virtual

Set the name for this ResourceLocator.

References locator_tag(), and locator_tag_.

std::string basic::resource_manager::ResourceLocator::locator_tag ( ) const
virtual

Return the name for this ResourceLocator.

References locator_tag_.

Referenced by basic::resource_manager::locator::DatabaseResourceLocator::locate_resource_stream(), and locator_tag().

virtual void basic::resource_manager::ResourceLocator::parse_my_tag ( utility::tag::TagCOP  tag)
pure virtual
virtual void basic::resource_manager::ResourceLocator::show ( std::ostream &  out) const
pure virtual
virtual std::string basic::resource_manager::ResourceLocator::type ( ) const
pure virtual

Member Data Documentation

std::string basic::resource_manager::ResourceLocator::locator_tag_
private

Referenced by locator_tag().


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