Rosetta  2020.50
 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...
 
void add_citations (CitationCollectionList const &input)
 Add citations to the list of citations that have been collected. More...
 
void add_citation (CitationCollectionBaseCOP const &input)
 Add a single citation to the citation manger. 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...
 
void write_collected_citations (std::ostream &outstream, utility::vector1< CitationCollectionCOP > const &published, CitationFormat const citation_format=CitationFormat::DefaultStyle) const
 Get a summary of all the citations passed in the list. More...
 
void write_unpublished_modules (std::ostream &outstream, utility::vector1< UnpublishedModuleInfoCOP > const &unpublished) const
 Write out a list of the unpublished modules. 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...
 
void split_citations (utility::vector1< CitationCollectionCOP > &published, utility::vector1< UnpublishedModuleInfoCOP > &unpublished) const
 Split the citations into published & unpublished vectors. More...
 

Private Attributes

std::map< std::string,
CitationCOP
doi_rosetta_citation_map_
 A map of DOI->Rosetta citations. More...
 
CitationCollectionList citation_list_
 A list of all the citations (and unpublished moduled) 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_citation ( CitationCollectionBaseCOP const &  input)

Add a single citation to the citation manger.

Note
Will not add if a duplicate

Threadsafe

References basic::citation_manager::CitationCollectionList::add(), and citation_list_.

Referenced by main().

void basic::citation_manager::CitationManager::add_citations ( CitationCollectionList const &  input)

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

Note
Only adds citations that have not been already added.

Threadsafe.

References basic::citation_manager::CitationCollectionList::add(), citation_list_, and basic::citation_manager::CitationCollectionList::empty().

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_list_.

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

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::split_citations ( utility::vector1< CitationCollectionCOP > &  published,
utility::vector1< UnpublishedModuleInfoCOP > &  unpublished 
) const
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, basic::Tracer::Reset, split_citations(), 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,
utility::vector1< CitationCollectionCOP > const &  published,
CitationFormat const  citation_format = CitationFormat::DefaultStyle 
) const

Get a summary of all the citations passed in the list.

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.

Referenced by write_all_citations_and_unpublished_author_info().

void basic::citation_manager::CitationManager::write_unpublished_modules ( std::ostream &  outstream,
utility::vector1< UnpublishedModuleInfoCOP > const &  unpublished 
) const

Write out a list of the unpublished modules.

References pyrosetta.utility.array::module.

Referenced by write_all_citations_and_unpublished_author_info().

Friends And Related Function Documentation

friend class utility::SingletonBase< CitationManager >
friend

Member Data Documentation

CitationCollectionList basic::citation_manager::CitationManager::citation_list_
private

A list of all the citations (and unpublished moduled) used so far.

Referenced by add_citation(), add_citations(), clear_citations(), and split_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().


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