Rosetta
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, GeneralFileContentsOPfilename_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

◆ GeneralFileManager() [1/2]

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

Empty constructor.

◆ GeneralFileManager() [2/2]

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

Explicitly deleted copy constructor.

Member Function Documentation

◆ create_instance()

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().

◆ 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(), utility::filename(), filename_to_filecontents_map_, plot::function, ptr(), utility::thread::safely_check_map_for_key_and_insert_if_absent(), and SAFELY_PASS_MUTEX.

◆ operator=()

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

Explicitly deleted assignment operator.

Friends And Related Function Documentation

◆ utility::SingletonBase< GeneralFileManager >

Member Data Documentation

◆ filename_to_filecontents_map_

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: