Develop Biology
The language of life
bio::physical::Observer< PERSPECTIVE > Class Template Reference

#include <Observer.h>

+ Inheritance diagram for bio::physical::Observer< PERSPECTIVE >:
+ Collaboration diagram for bio::physical::Observer< PERSPECTIVE >:

Public Types

typedef PERSPECTIVE Perspective
 

Public Member Functions

 Observer (const Observer &other)
 
 Observer (Perspective *perspective=NULL)
 
virtual ~Observer ()
 
virtual PerspectiveGetPerspective () const
 
virtual void SetPerspective (Perspective *perspective)
 

Protected Member Functions

virtual void InitializeImplementation (ByteStreams args)
 
- Protected Member Functions inherited from bio::VirtualBase
 VirtualBase ()
 
virtual ~VirtualBase ()
 
void Initialize (ByteStream arg1)
 
void Initialize (ByteStream arg1, ByteStream arg2)
 
void Initialize (ByteStream arg1, ByteStream arg2, ByteStream arg3)
 
void Initialize (ByteStreams args)
 
virtual void InitializeImplementation (ByteStreams args)=0
 

Additional Inherited Members

- Protected Attributes inherited from bio::VirtualBase
bool m_hasBeenInitialized
 

Detailed Description

template<typename PERSPECTIVE>
class bio::physical::Observer< PERSPECTIVE >

An Observer class is one that has a PERSPECTIVE. This is intended for Identifiable classes (see Identifiable.h) and any other classes that manage or work with Identifiable classes.

NOTE: At this time we do not currently support viewing objects from multiple Perspectives. This is because if you can get the object's Id, you should also be able to get it's Perspective (i.e observer->GetPerspective). By not allowing objects to be duplicated across perspectives, we reduce our overall memory footprint.

Definition at line 39 of file Observer.h.

Member Typedef Documentation

◆ Perspective

template<typename PERSPECTIVE >
typedef PERSPECTIVE bio::physical::Observer< PERSPECTIVE >::Perspective

Definition at line 43 of file Observer.h.

Constructor & Destructor Documentation

◆ Observer() [1/2]

template<typename PERSPECTIVE >
bio::physical::Observer< PERSPECTIVE >::Observer ( Perspective perspective = NULL)
inlineexplicit
Parameters
perspective

Definition at line 48 of file Observer.h.

49 :
50 m_perspective(perspective)
51 {
52 }

◆ Observer() [2/2]

template<typename PERSPECTIVE >
bio::physical::Observer< PERSPECTIVE >::Observer ( const Observer< PERSPECTIVE > &  other)
inline
Parameters
other

Definition at line 57 of file Observer.h.

58 :
59 m_perspective(other.m_perspective)
60 {
61 }

◆ ~Observer()

template<typename PERSPECTIVE >
virtual bio::physical::Observer< PERSPECTIVE >::~Observer ( )
inlinevirtual

Definition at line 66 of file Observer.h.

67 {
68 }

Member Function Documentation

◆ GetPerspective()

template<typename PERSPECTIVE >
virtual Perspective * bio::physical::Observer< PERSPECTIVE >::GetPerspective ( ) const
inlinevirtual
Returns
the perspective held by *this.

Definition at line 82 of file Observer.h.

83 {
84 return m_perspective;
85 }

Referenced by bio::molecular::Surface::Release().

◆ InitializeImplementation()

template<typename PERSPECTIVE >
virtual void bio::physical::Observer< PERSPECTIVE >::InitializeImplementation ( ByteStreams  args)
inlineprotectedvirtual

VirtualBase required method. See that class for details (in common/)

Parameters
args

Implements bio::VirtualBase.

Definition at line 92 of file Observer.h.

93 {
94 BIO_SANITIZE(args.size() == 1 && args[0].Is(m_perspective), ,
95 return);
96 m_perspective = args[0];
97 }
#define BIO_SANITIZE(test, success, failure)

References BIO_SANITIZE.

◆ SetPerspective()

template<typename PERSPECTIVE >
virtual void bio::physical::Observer< PERSPECTIVE >::SetPerspective ( Perspective perspective)
inlinevirtual

Sets the perspective for *this.

Parameters
perspective

Definition at line 74 of file Observer.h.

75 {
76 m_perspective = perspective;
77 }

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