Rosetta 3.4
Public Member Functions | Protected Member Functions
core::pose::datacache::CacheableObserver Class Reference

Base class for Pose/Conformation observers that are stored in a Pose's DataCache. More...

#include <CacheableObserver.hh>

Inheritance diagram for core::pose::datacache::CacheableObserver:
Inheritance graph
[legend]
Collaboration diagram for core::pose::datacache::CacheableObserver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CacheableObserver ()
 default constructor
 CacheableObserver (CacheableObserver const &rval)
 copy constructor
virtual ~CacheableObserver ()
 default destructor
CacheableObserveroperator= (CacheableObserver const &rval)
 copy assignment
virtual CacheableObserverOP clone ()=0
 clone this object
virtual CacheableObserverOP create ()=0
 create a new instance of this object
void attach_to (Pose &pose)
 attach to Pose/Conformation Derived classes do not overload this method -- see attach_impl() instead.
void detach_from ()
 detach from Pose/Conformation
virtual bool is_attached () const =0
 is this observer attached to a Pose/Conformation?

Protected Member Functions

virtual void attach_impl (Pose &pose)=0
 attach to Pose/Conformation
virtual void detach_impl ()=0
 detach from Pose/Conformation

Detailed Description

Base class for Pose/Conformation observers that are stored in a Pose's DataCache.

Classes derived from CacheableObserver whose instances are stored inside a Pose's ObserverCache will be cloned and re-attached to the new Pose instance upon Pose copy construction/assignment. CacheableObservers should not need to attach themselves independently unless necessary -- attach/detach should be done through the ObserverCache's interface. For example, the ObserverCache can attach the observer upon calling ObserverCache::set().

Warning:
When deriving from this class remember that Links or pointers to subjects stored in classes are *not* to be copied when copy constructor/assignment is called.

Constructor & Destructor Documentation

core::pose::datacache::CacheableObserver::CacheableObserver ( )

default constructor

core::pose::datacache::CacheableObserver::CacheableObserver ( CacheableObserver const &  rval)

copy constructor

Warning:
Subject being observed (represented by Link/pointer) is not copied!
core::pose::datacache::CacheableObserver::~CacheableObserver ( ) [virtual]

default destructor

Warning:
Derived classes must remember to detach on destruction!

Member Function Documentation

virtual void core::pose::datacache::CacheableObserver::attach_impl ( Pose pose) [protected, pure virtual]
void core::pose::datacache::CacheableObserver::attach_to ( Pose pose)

attach to Pose/Conformation Derived classes do not overload this method -- see attach_impl() instead.

References attach_impl(), and detach_from().

virtual CacheableObserverOP core::pose::datacache::CacheableObserver::clone ( ) [pure virtual]

clone this object

Warning:
Subject (represented by Link/pointer) is not copied!

Implemented in core::pose::datacache::LengthEventCollector, core::pose::datacache::SpecialSegmentsObserver, and protocols::toolbox::match_enzdes_util::EnzdesCacheableObserver.

virtual CacheableObserverOP core::pose::datacache::CacheableObserver::create ( ) [pure virtual]
void core::pose::datacache::CacheableObserver::detach_from ( )

detach from Pose/Conformation

Remarks:
Derived classes do not overload this method -- see detach_impl() instead.

References detach_impl().

Referenced by attach_to(), core::pose::datacache::LengthEventCollector::~LengthEventCollector(), and core::pose::datacache::SpecialSegmentsObserver::~SpecialSegmentsObserver().

virtual void core::pose::datacache::CacheableObserver::detach_impl ( ) [protected, pure virtual]
virtual bool core::pose::datacache::CacheableObserver::is_attached ( ) const [pure virtual]
CacheableObserver & core::pose::datacache::CacheableObserver::operator= ( CacheableObserver const &  rval)

copy assignment

Warning:
Subject being observed (represented by Link/pointer) is not copied!

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines