Rosetta
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
basic::citation_manager::CitationCollection Class Reference

A class for keeping track of a collection of citations for a particular Rosetta module. More...

#include <CitationCollection.hh>

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

Public Member Functions

 CitationCollection ()=delete
 Default constructor, deleted. More...
 
 CitationCollection (std::string const &module_name, CitedModuleType const module_type)
 Options constructor. The module type must not be CustomType. More...
 
 CitationCollection (std::string const &module_name, std::string const &module_type_name)
 Options constructor for custom module types. A string must be provided for the name of the module type. More...
 
 ~CitationCollection () override=default
 Destructor. More...
 
 CitationCollection (CitationCollection const &)=default
 Copy constructor. More...
 
CitationCollectionoperator= (CitationCollection const &)=default
 Assignment operator. More...
 
CitationCollectionOP clone () const
 Clone operator: copy this object and return an owning pointer to the copy. More...
 
bool operator== (CitationCollectionBase const &other) const override
 Comparison operator, generalized on the base class. More...
 
bool operator== (CitationCollection const &other) const
 Comparison operator. More...
 
void add_citation (CitationCOP citation_in)
 Add a citation without cloning it. More...
 
std::string const & module_name () const
 Get this module's name. More...
 
std::string const & module_type () const
 Get this module's type. More...
 
void get_citations_formatted (std::ostream &outstream, CitationFormat const format=CitationFormat::DefaultStyle) const
 Get the citations, written out prettily to a string stream. More...
 
bool has_multiple_citations () const
 Does this collection have more than one citation? 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
 

Static Public Member Functions

static std::string const & get_enumerated_module_type_name (CitedModuleType const module_type)
 Get the module type name. More...
 

Private Attributes

utility::vector1< CitationCOPcitations_
 Citations in this citation collection. More...
 
std::string module_name_
 The name of the module for which citations are being provided. More...
 
CitedModuleType module_type_ = CitedModuleType::Mover
 The type of module for which citations are being provided. More...
 
std::string module_type_name_
 For custom module types, provide a string. More...
 

Detailed Description

A class for keeping track of a collection of citations for a particular Rosetta module.

Constructor & Destructor Documentation

◆ CitationCollection() [1/4]

basic::citation_manager::CitationCollection::CitationCollection ( )
delete

Default constructor, deleted.

◆ CitationCollection() [2/4]

basic::citation_manager::CitationCollection::CitationCollection ( std::string const &  module_name,
CitedModuleType const  module_type 
)

Options constructor. The module type must not be CustomType.

Options constructor. The module_type must not be CustomType.

References basic::citation_manager::CustomType, module_name(), module_type(), runtime_assert, and runtime_assert_string_msg.

◆ CitationCollection() [3/4]

basic::citation_manager::CitationCollection::CitationCollection ( std::string const &  module_name,
std::string const &  module_type_name 
)

Options constructor for custom module types. A string must be provided for the name of the module type.

References basic::citation_manager::CustomType, module_name(), and runtime_assert_string_msg.

◆ ~CitationCollection()

basic::citation_manager::CitationCollection::~CitationCollection ( )
overridedefault

Destructor.

◆ CitationCollection() [4/4]

basic::citation_manager::CitationCollection::CitationCollection ( CitationCollection const &  )
default

Copy constructor.

Member Function Documentation

◆ add_citation()

void basic::citation_manager::CitationCollection::add_citation ( CitationCOP  citation_in)

Add a citation without cloning it.

Does nothing if citation_in is nullptr.

References citations_.

◆ clone()

CitationCollectionOP basic::citation_manager::CitationCollection::clone ( ) const

Clone operator: copy this object and return an owning pointer to the copy.

◆ get_citations_formatted()

void basic::citation_manager::CitationCollection::get_citations_formatted ( std::ostream &  outstream,
CitationFormat const  format = CitationFormat::DefaultStyle 
) const

Get the citations, written out prettily to a string stream.

Multiple citations will be on multiple lines, but there's no newline at the start or the end of the output.

References citations_, count, and pyrosetta.tests.distributed.test_dask::format.

◆ get_enumerated_module_type_name()

std::string const & basic::citation_manager::CitationCollection::get_enumerated_module_type_name ( CitedModuleType const  module_type)
static

◆ has_multiple_citations()

bool basic::citation_manager::CitationCollection::has_multiple_citations ( ) const

Does this collection have more than one citation?

References citations_.

◆ module_name()

std::string const& basic::citation_manager::CitationCollection::module_name ( ) const
inline

Get this module's name.

References module_name_.

Referenced by CitationCollection().

◆ module_type()

std::string const & basic::citation_manager::CitationCollection::module_type ( ) const

◆ operator=()

CitationCollection& basic::citation_manager::CitationCollection::operator= ( CitationCollection const &  )
default

Assignment operator.

◆ operator==() [1/2]

bool basic::citation_manager::CitationCollection::operator== ( CitationCollection const &  other) const

Comparison operator.

Compares only module name and module type, not reference list.

References module_name_, module_type_, and module_type_name_.

◆ operator==() [2/2]

bool basic::citation_manager::CitationCollection::operator== ( CitationCollectionBase const &  other) const
overridevirtual

Comparison operator, generalized on the base class.

Checks if both are CitationCollection, and if so defers to the operator== below.

Implements basic::citation_manager::CitationCollectionBase.

References ptr().

Member Data Documentation

◆ citations_

utility::vector1< CitationCOP > basic::citation_manager::CitationCollection::citations_
private

Citations in this citation collection.

Referenced by add_citation(), get_citations_formatted(), and has_multiple_citations().

◆ module_name_

std::string basic::citation_manager::CitationCollection::module_name_
private

The name of the module for which citations are being provided.

Referenced by module_name(), and operator==().

◆ module_type_

CitedModuleType basic::citation_manager::CitationCollection::module_type_ = CitedModuleType::Mover
private

The type of module for which citations are being provided.

Referenced by module_type(), and operator==().

◆ module_type_name_

std::string basic::citation_manager::CitationCollection::module_type_name_
private

For custom module types, provide a string.

Referenced by module_type(), and operator==().


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