Rosetta
2019.07
|
forward declaration for DataCache More...
#include <DataCache.hh>
Public Types | |
typedef utility::pointer::shared_ptr < Data > | DataOP |
typedef utility::pointer::shared_ptr < Data const > | DataCOP |
typedef utility::pointer::weak_ptr < Data > | DataAP |
typedef utility::pointer::weak_ptr < Data const > | DataCAP |
Public Types inherited from utility::pointer::ReferenceCount | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
Public Member Functions | |
DataCache () | |
default constructor More... | |
DataCache (std::size_t n_slots) | |
size constructor More... | |
DataCache (DataCache const &src) | |
copy constructor More... | |
~DataCache () override=default | |
destructor More... | |
DataCache & | operator= (DataCache const &src) |
copy assignment More... | |
size_t | size () const |
the number of slots in this cache More... | |
void | resize (std::size_t n_slots) |
resize the cache for the given number of slots More... | |
void | clear () |
clear all stored data More... | |
void | clear (std::size_t slot) |
clear the object in a selected slot More... | |
bool | has (std::size_t slot) const |
is there an object in the slot? More... | |
Data const & | get (std::size_t slot) const |
get base class reference to the object stored in the slot More... | |
template<typename D > | |
D const & | get (std::size_t slot) const |
get derived class reference to the object stored in the slot More... | |
Data & | get (std::size_t slot) |
get base class reference to object stored in the slot More... | |
template<typename D > | |
D & | get (std::size_t slot) |
get derived class reference to object stored in the slot More... | |
DataCOP | get_const_ptr (std::size_t slot) const |
get base class owning ptr to object stored in the slot More... | |
template<typename D > | |
utility::pointer::shared_ptr < D const > | get_const_ptr (std::size_t slot) const |
get derived class owning ptr to object stored in the slot More... | |
DataOP | get_ptr (std::size_t slot) |
get base class owning ptr to object stored in the slot More... | |
template<typename D > | |
utility::pointer::shared_ptr< D > | get_ptr (std::size_t slot) |
get derived class owning ptr to object stored in the slot More... | |
Data const * | get_raw_const_ptr (std::size_t slot) const |
get base class raw ptr to object stored in the slot More... | |
template<typename D > | |
D const * | get_raw_const_ptr (std::size_t slot) const |
get derived class raw ptr to object stored in the slot More... | |
Data * | get_raw_ptr (std::size_t slot) |
get base class raw ptr to object stored in the slot More... | |
template<typename D > | |
D * | get_raw_ptr (std::size_t slot) |
get derived class raw ptr to object stored in the slot More... | |
void | set (std::size_t slot, DataOP new_data) |
store data in the given slot More... | |
Public Member Functions inherited from utility::pointer::ReferenceCount | |
ReferenceCount () | |
Default constructor. More... | |
virtual | ~ReferenceCount () |
Protected Types | |
typedef utility::vector1< DataOP > | DataOPs |
Protected Member Functions | |
DataOPs const & | data () const |
get the storage vector More... | |
DataOPs & | data () |
get the storage vector More... | |
Private Types | |
typedef utility::pointer::ReferenceCount | Super |
Private Attributes | |
DataOPs | data_ |
stores data via unique integer index More... | |
forward declaration for DataCache
Indexed storage for objects derived from a ReferenceCountable data type.
Intended for use as a generic data cache by storing objects derived from a ReferenceCountable data type in a unique slot designated by an integer id (enum, size index, etc.). The DataCache will only store one object per slot/id. For example, see the PoseDataCache used in core::pose::Pose, which is indexed by the enum basic::pose::datacache:CacheableDataType. Currently when data is set(), it is not cloned – classes deriving from DataCache should remember to overload set() if they need cloning behavior.
Data | Class derived from utility::pointer::ReferenceCount that defines a virtual clone() method. |
typedef utility::pointer::weak_ptr< Data > basic::datacache::DataCache< Data >::DataAP |
typedef utility::pointer::weak_ptr< Data const > basic::datacache::DataCache< Data >::DataCAP |
typedef utility::pointer::shared_ptr< Data const > basic::datacache::DataCache< Data >::DataCOP |
typedef utility::pointer::shared_ptr< Data > basic::datacache::DataCache< Data >::DataOP |
|
protected |
|
private |
|
inline |
default constructor
|
inline |
size constructor
[in] | n_types | The number of slots for this DataCache. |
|
inline |
copy constructor
|
overridedefault |
destructor
|
inline |
clear all stored data
Referenced by pyrosetta.bindings.pose.ResidueLabelAccessor::discard().
|
inline |
clear the object in a selected slot
Referenced by pyrosetta.bindings.pose.ResidueLabelAccessor::discard().
|
inlineprotected |
get the storage vector
|
inlineprotected |
get the storage vector
|
inline |
get base class reference to the object stored in the slot
|
inline |
get derived class reference to the object stored in the slot
D | class derived from Data |
|
inline |
get base class reference to object stored in the slot
|
inline |
get derived class reference to object stored in the slot
D | class derived from Data |
|
inline |
get base class owning ptr to object stored in the slot
Referenced by basic::datacache::DataCache< CacheableData >::get_const_ptr().
|
inline |
get derived class owning ptr to object stored in the slot
D | class derived from Data |
|
inline |
get base class owning ptr to object stored in the slot
Referenced by basic::datacache::DataCache< CacheableData >::get_ptr().
|
inline |
get derived class owning ptr to object stored in the slot
D | class derived from Data |
|
inline |
get base class raw ptr to object stored in the slot
Referenced by basic::datacache::DataCache< CacheableData >::get_raw_const_ptr().
|
inline |
get derived class raw ptr to object stored in the slot
D | class derived from Data |
|
inline |
get base class raw ptr to object stored in the slot
Referenced by basic::datacache::DataCache< CacheableData >::get_raw_ptr().
|
inline |
get derived class raw ptr to object stored in the slot
D | class derived from Data |
|
inline |
is there an object in the slot?
|
inline |
copy assignment
|
inline |
resize the cache for the given number of slots
[in] | n_slots | The new number of slots. |
|
inline |
store data in the given slot
[in] | The | slot to use. |
[in] | observer | The data to store – data is not cloned. |
|
inline |
the number of slots in this cache
|
private |
stores data via unique integer index
Referenced by basic::datacache::DataCache< CacheableData >::clear(), basic::datacache::DataCache< CacheableData >::data(), basic::datacache::DataCache< CacheableData >::get(), basic::datacache::DataCache< CacheableData >::get_const_ptr(), basic::datacache::DataCache< CacheableData >::get_ptr(), basic::datacache::DataCache< CacheableData >::get_raw_const_ptr(), basic::datacache::DataCache< CacheableData >::get_raw_ptr(), basic::datacache::DataCache< CacheableData >::has(), basic::datacache::DataCache< CacheableData >::operator=(), basic::datacache::DataCache< CacheableData >::resize(), basic::datacache::DataCache< CacheableData >::set(), and basic::datacache::DataCache< CacheableData >::size().