Rosetta
Public Types | Public Member Functions | Protected Types | Private Types | Private Member Functions | Private Attributes | List of all members
core::pose::datacache::ObserverCache Class Reference

A DataCache storing Pose/Conformation observers derived from core::pose::datacache::CacheableObserver. More...

#include <ObserverCache.hh>

Inheritance diagram for core::pose::datacache::ObserverCache:
Inheritance graph
[legend]

Public Types

typedef core::Size Size
 

Public Member Functions

 ObserverCache (Size n_slots, Pose &pose)
 constructor More...
 
 ~ObserverCache () override
 default destructor More...
 
ObserverCacheoperator= (ObserverCache const &rval)
 copy assignment More...
 
void clear ()
 clear all the observers More...
 
void clear (Size slot)
 clear the observer in a selected slot More...
 
void set (Size slot, CacheableObserverOP observer)
 store a copy of the observer in the given slot and attach it to the Pose More...
 
void set (Size slot, CacheableObserverOP observer, bool auto_attach)
 store a copy of the observer in the given slot More...
 
bool is_attached (Size slot) const
 is the observer in the slot attached to the Pose? More...
 
void attach ()
 attach all stored observers to the Pose More...
 
void detach ()
 detach all observers from the Pose More...
 
void attach (Size slot)
 attach an observer in a particular slot to the Pose More...
 
void detach (Size slot)
 detach an observer in a particular slot to the Pose More...
 

Protected Types

typedef Super::DataOPs ObserverOPs
 

Private Types

typedef basic::datacache::DataCache< CacheableObserverSuper
 

Private Member Functions

 ObserverCache (ObserverCache const &rval)
 copy constructor More...
 

Private Attributes

utility::vector1< bool > attached_
 Which of the cacheable observers are attached to the pose, and which are just hanging out. More...
 
Posepose_
 The Pose being watched by the observers in this cache. More...
 

Detailed Description

A DataCache storing Pose/Conformation observers derived from core::pose::datacache::CacheableObserver.

Member Typedef Documentation

◆ ObserverOPs

typedef Super::DataOPs core::pose::datacache::ObserverCache::ObserverOPs
protected

◆ Size

◆ Super

Constructor & Destructor Documentation

◆ ObserverCache() [1/2]

core::pose::datacache::ObserverCache::ObserverCache ( Size  n_slots,
Pose pose 
)

constructor

Parameters
[in]n_typesThe number of slots for this ObserverCache.
[in]poseThe Pose that will be watched by the Observers in this cache.

◆ ~ObserverCache()

core::pose::datacache::ObserverCache::~ObserverCache ( )
override

default destructor

References detach().

◆ ObserverCache() [2/2]

core::pose::datacache::ObserverCache::ObserverCache ( ObserverCache const &  rval)
private

copy constructor

Member Function Documentation

◆ attach() [1/2]

void core::pose::datacache::ObserverCache::attach ( )

attach all stored observers to the Pose

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

◆ attach() [2/2]

void core::pose::datacache::ObserverCache::attach ( Size  slot)

attach an observer in a particular slot to the Pose

Parameters
[in]slotAttach the observer in this slot.

References attached_, core::chemical::has(), and pose_.

◆ clear() [1/2]

void core::pose::datacache::ObserverCache::clear ( )

◆ clear() [2/2]

void core::pose::datacache::ObserverCache::clear ( Size  slot)

clear the observer in a selected slot

References detach().

◆ detach() [1/2]

void core::pose::datacache::ObserverCache::detach ( )

detach all observers from the Pose

Referenced by clear(), operator=(), set(), and ~ObserverCache().

◆ detach() [2/2]

void core::pose::datacache::ObserverCache::detach ( Size  slot)

detach an observer in a particular slot to the Pose

Parameters
[in]slotDetach the observer in this slot.

References attached_, and core::chemical::has().

◆ is_attached()

bool core::pose::datacache::ObserverCache::is_attached ( Size  slot) const

is the observer in the slot attached to the Pose?

Returns
true if attached, false if not attached or no observer exists in the slot

References core::chemical::has().

Referenced by protocols::denovo_design::components::StructureDataFactory::observer_attached(), and operator=().

◆ operator=()

ObserverCache & core::pose::datacache::ObserverCache::operator= ( ObserverCache const &  rval)

copy assignment

References attach(), detach(), and is_attached().

◆ set() [1/2]

void core::pose::datacache::ObserverCache::set ( Size  slot,
CacheableObserverOP  observer 
)

◆ set() [2/2]

void core::pose::datacache::ObserverCache::set ( Size  slot,
CacheableObserverOP  observer,
bool  auto_attach 
)

store a copy of the observer in the given slot

Parameters
[in]Theslot to use.
[in]observerThe Observer to clone() and store.
[in]auto_attachAttach the observer to the Pose?

References attach(), and detach().

Member Data Documentation

◆ attached_

utility::vector1< bool > core::pose::datacache::ObserverCache::attached_
private

Which of the cacheable observers are attached to the pose, and which are just hanging out.

Referenced by attach(), and detach().

◆ pose_

Pose* core::pose::datacache::ObserverCache::pose_
private

The Pose being watched by the observers in this cache.

Remarks
This must be a pointer and not an owning pointer in case the Pose is on the stack.

Referenced by attach().


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