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

A class that receives lists of works to cite from Rosetta modules, then returns a list of all works to cite on demand. Threadsafe. More...

#include <CitationManager.hh>

Inheritance diagram for basic::citation_manager::CitationManager:
Inheritance graph
[legend]

Public Member Functions

void clear_citations ()
 Clear all citations that have been collected. More...
 
bool has_modules_to_cite () const
 Has the CitationModule accumulated at least one module to cite? More...
 
bool has_unpublished_modules () const
 Has the CitationModule accumulated at least one unpublished module? More...
 
void add_citations (utility::vector1< CitationCollectionCOP > const &input)
 Add citations to the list of citations that have been collected. More...
 
void add_unpublished_modules (utility::vector1< UnpublishedModuleInfoCOP > const &input)
 Add information for one or more unpublished modules to the list that has been collected. More...
 
void write_collected_citations (std::ostream &outstream, CitationFormat const citation_format=CitationFormat::DefaultStyle) const
 Get a summary of all the citations that we've collected so far. More...
 
void write_unpublished_modules (std::ostream &outstream) const
 Write out a list of the unpublished modules. More...
 
void write_all_citations_and_unpublished_author_info () const
 Write out all unpublished modules and citations to the CitationManager's tracer. More...
 
CitationCOP get_citation_by_doi (std::string const &doi) const
 Given a DOI string, get a Rosetta citation. More...
 
- Public Member Functions inherited from utility::SingletonBase< CitationManager >
 SingletonBase ()
 public constructor (the derived class must have a private constructor, of course). More...
 

Private Member Functions

 CitationManager ()
 Constructor triggers read from disk. More...
 
 CitationManager (CitationManager const &)=delete
 
CitationManager operator= (CitationManager const &)=delete
 
void load_rosetta_citations_from_database ()
 Load Rosetta citations from the Rosetta database, and populate the doi_rosetta_citation_map_. More...
 
void populate_doi_rosetta_citation_map (std::string const &database_file_contents)
 Populate the doi_rosetta_citation_map_ from the contents of a database file. More...
 

Private Attributes

std::map< std::string,
CitationCOP
doi_rosetta_citation_map_
 A map of DOI->Rosetta citations. More...
 
utility::vector1
< CitationCollectionCOP
citation_collections_
 A list of everything that has been cited so far. More...
 
utility::vector1
< UnpublishedModuleInfoCOP
unpublished_
 A list of the modules that are unpublished that have been used so far. More...
 

Friends

class utility::SingletonBase< CitationManager >
 

Additional Inherited Members

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

Detailed Description

A class that receives lists of works to cite from Rosetta modules, then returns a list of all works to cite on demand. Threadsafe.

Constructor & Destructor Documentation

basic::citation_manager::CitationManager::CitationManager ( )
private

Constructor triggers read from disk.

References load_rosetta_citations_from_database().

basic::citation_manager::CitationManager::CitationManager ( CitationManager const &  )
privatedelete

Member Function Documentation

void basic::citation_manager::CitationManager::add_citations ( utility::vector1< CitationCollectionCOP > const &  input)

Add citations to the list of citations that have been collected.

Note
Checks module names and types, and only adds citations that have not been already added.

Threadsafe.

Checks module names and types, and only adds citations that have not been already added.

Threadsafe.

References citation_collections_, and basic::citation_manager::merge_into_citation_collection_vector().

Referenced by main().

void basic::citation_manager::CitationManager::add_unpublished_modules ( utility::vector1< UnpublishedModuleInfoCOP > const &  input)

Add information for one or more unpublished modules to the list that has been collected.

Note
Checks that these modules haven't been added, and only adds new ones.

Threadsafe.

References basic::citation_manager::merge_into_unpublished_collection_vector(), and unpublished_.

void basic::citation_manager::CitationManager::clear_citations ( )

Clear all citations that have been collected.

Does not clear the map of DOI->Rosetta citation that was loaded from the Rosetta database.

Threadsafe.

Threadsafe.

References citation_collections_, and unpublished_.

CitationCOP basic::citation_manager::CitationManager::get_citation_by_doi ( std::string const &  doi) const

Given a DOI string, get a Rosetta citation.

Throws if the DOI string isn't in the list of Rosetta papers in the database.

References doi_rosetta_citation_map_, and utility_exit_with_message.

Referenced by main().

bool basic::citation_manager::CitationManager::has_modules_to_cite ( ) const

Has the CitationModule accumulated at least one module to cite?

Threadsafe.

References citation_collections_.

Referenced by write_all_citations_and_unpublished_author_info().

bool basic::citation_manager::CitationManager::has_unpublished_modules ( ) const

Has the CitationModule accumulated at least one unpublished module?

Threadsafe.

References unpublished_.

Referenced by write_all_citations_and_unpublished_author_info().

void basic::citation_manager::CitationManager::load_rosetta_citations_from_database ( )
private

Load Rosetta citations from the Rosetta database, and populate the doi_rosetta_citation_map_.

TRIGGERS READ FROM DISK. Threadsafe, but should only be done once!

References basic::Tracer::Debug, debug_assert, utility::file_contents(), test.G202_Module_PythonPDB::filename, basic::database::full_name(), populate_doi_rosetta_citation_map(), and basic::TR.

Referenced by CitationManager().

CitationManager basic::citation_manager::CitationManager::operator= ( CitationManager const &  )
privatedelete
void basic::citation_manager::CitationManager::populate_doi_rosetta_citation_map ( std::string const &  database_file_contents)
private
void basic::citation_manager::CitationManager::write_all_citations_and_unpublished_author_info ( ) const

Write out all unpublished modules and citations to the CitationManager's tracer.

Write out all unpublished modules and citations to to the CitationManager's tracer.

References basic::Tracer::bgBlue, basic::Tracer::Bold, has_modules_to_cite(), has_unpublished_modules(), basic::Tracer::Reset, basic::TR, basic::Tracer::Underline, basic::Tracer::White, write_collected_citations(), and write_unpublished_modules().

void basic::citation_manager::CitationManager::write_collected_citations ( std::ostream &  outstream,
CitationFormat const  citation_format = CitationFormat::DefaultStyle 
) const

Get a summary of all the citations that we've collected so far.

Note
This is ONLY a list of citations, in a given format, on separate lines, with header lines indicating the relevant module. This does NOT include an overall header explaining the context in which citations were collected.

Threadsafe.

References citation_collections_.

Referenced by write_all_citations_and_unpublished_author_info().

void basic::citation_manager::CitationManager::write_unpublished_modules ( std::ostream &  outstream) const

Write out a list of the unpublished modules.

References pyrosetta.utility.array::module, and unpublished_.

Referenced by write_all_citations_and_unpublished_author_info().

Friends And Related Function Documentation

friend class utility::SingletonBase< CitationManager >
friend

Member Data Documentation

utility::vector1< CitationCollectionCOP > basic::citation_manager::CitationManager::citation_collections_
private

A list of everything that has been cited so far.

Referenced by add_citations(), clear_citations(), has_modules_to_cite(), and write_collected_citations().

std::map< std::string, CitationCOP > basic::citation_manager::CitationManager::doi_rosetta_citation_map_
private

A map of DOI->Rosetta citations.

Referenced by get_citation_by_doi(), and populate_doi_rosetta_citation_map().

utility::vector1< UnpublishedModuleInfoCOP > basic::citation_manager::CitationManager::unpublished_
private

A list of the modules that are unpublished that have been used so far.

Referenced by add_unpublished_modules(), clear_citations(), has_unpublished_modules(), and write_unpublished_modules().


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