Rosetta
Public Member Functions | Private Attributes | List of all members
core::scoring::ScoreFunctionKey Struct Reference

A key for looking up previously-loaded scorefunctions (which the ScoreFunctionFactory stores in a map of owning pointers indexed by keys of this type). More...

#include <ScoreFunctionFactory.hh>

Public Member Functions

 ScoreFunctionKey ()=delete
 Default constructor – explicitly deleted. More...
 
 ScoreFunctionKey (std::string const &weights_file, std::string const &comma_separated_patches, utility::options::OptionCollection const *const options_collection_ptr)
 Options constructor – used to set contents of key. More...
 
 ~ScoreFunctionKey ()=default
 
bool operator< (ScoreFunctionKey const &other) const
 Comparison operator is needed to use this as the key for a map. We'll just use a thin wrapper for std::tuple's less than operator. More...
 

Private Attributes

std::tuple< std::string, std::string, utility::options::OptionCollection const * > keytuple_
 Internally, we still use a tuple since tuple::operator< is already defined. More...
 

Detailed Description

A key for looking up previously-loaded scorefunctions (which the ScoreFunctionFactory stores in a map of owning pointers indexed by keys of this type).

The key is the weights file name as a string, a comma-separated list of patches as another string, and a raw pointer to the options collection. Note that a raw pointer is appropriate in this case since the goal is NOT to access the options collection, but simply to have a unique identifier for whether we've seen it before. An owning pointer or even a weak pointer (access pointer) would incur unncessary overhead that we don't need for that goal. If an OptionCollection could be hashed, that might be an even better unique identifier, but for now, we'll use the memory location.

Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org).

Constructor & Destructor Documentation

◆ ScoreFunctionKey() [1/2]

core::scoring::ScoreFunctionKey::ScoreFunctionKey ( )
delete

Default constructor – explicitly deleted.

◆ ScoreFunctionKey() [2/2]

core::scoring::ScoreFunctionKey::ScoreFunctionKey ( std::string const &  weights_file,
std::string const &  comma_separated_patches,
utility::options::OptionCollection const *const  options_collection_ptr 
)
inline

Options constructor – used to set contents of key.

◆ ~ScoreFunctionKey()

core::scoring::ScoreFunctionKey::~ScoreFunctionKey ( )
default

Member Function Documentation

◆ operator<()

bool core::scoring::ScoreFunctionKey::operator< ( ScoreFunctionKey const &  other) const
inline

Comparison operator is needed to use this as the key for a map. We'll just use a thin wrapper for std::tuple's less than operator.

References keytuple_.

Member Data Documentation

◆ keytuple_

std::tuple< std::string, std::string, utility::options::OptionCollection const * > core::scoring::ScoreFunctionKey::keytuple_
private

Internally, we still use a tuple since tuple::operator< is already defined.

Referenced by operator<().


The documentation for this struct was generated from the following file: