Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
utility::io::GeneralFileManager Class Reference

#include <GeneralFileManager.hh>

Inheritance diagram for utility::io::GeneralFileManager:
Inheritance graph
[legend]

Public Member Functions

std::string const & get_file_contents (std::string const &filename) const
 Get a weights file. Load it from disk if it has not already been loaded. More...
 
- Public Member Functions inherited from utility::SingletonBase< GeneralFileManager >
 SingletonBase ()
 public constructor (the derived class must have a private constructor, of course). More...
 

Private Member Functions

 GeneralFileManager ()
 Empty constructor. More...
 
 GeneralFileManager (GeneralFileManager const &)=delete
 Explicitly deleted copy constructor. More...
 
GeneralFileManager operator= (GeneralFileManager const &)=delete
 Explicitly deleted assignment operator. More...
 

Static Private Member Functions

static GeneralFileContentsOP create_instance (std::string const &script_file)
 Create an instance of a GeneralFileContents object, by owning pointer. More...
 

Private Attributes

std::map< std::string,
GeneralFileContentsOP
filename_to_filecontents_map_
 A map of filename to file contents. More...
 

Friends

class utility::SingletonBase< GeneralFileManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from utility::SingletonBase< GeneralFileManager >
static GeneralFileManager * get_instance ()
 Safely instantiate a singleton class in a (possibly) multithreaded context. More...
 

Constructor & Destructor Documentation

utility::io::GeneralFileManager::GeneralFileManager ( )
private

Empty constructor.

utility::io::GeneralFileManager::GeneralFileManager ( GeneralFileManager const &  )
privatedelete

Explicitly deleted copy constructor.

Member Function Documentation

GeneralFileContentsOP utility::io::GeneralFileManager::create_instance ( std::string const &  filename)
staticprivate

Create an instance of a GeneralFileContents object, by owning pointer.

Needed for threadsafe creation. Loads data from disk. NOT for repeated calls!

Note
Not intended for use outside of GeneralFileManager.

References utility::filename().

Referenced by get_file_contents().

std::string const & utility::io::GeneralFileManager::get_file_contents ( std::string const &  filename) const

Get a weights file. Load it from disk if it has not already been loaded.

Threadsafe and lazily loaded.

References create_instance(), filename_to_filecontents_map_, utility::thread::safely_check_map_for_key_and_insert_if_absent(), and SAFELY_PASS_MUTEX.

GeneralFileManager utility::io::GeneralFileManager::operator= ( GeneralFileManager const &  )
privatedelete

Explicitly deleted assignment operator.

Friends And Related Function Documentation

Member Data Documentation

std::map< std::string, GeneralFileContentsOP > utility::io::GeneralFileManager::filename_to_filecontents_map_
mutableprivate

A map of filename to file contents.

Referenced by get_file_contents().


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