Ipopt
3.12.12
|
Slight Variation of the Observer Design Pattern. More...
#include <IpObserver.hpp>
Public Types | |
enum | NotifyType { NT_All, NT_BeingDestroyed, NT_Changed } |
Enumeration specifying the type of notification. More... | |
Public Member Functions | |
Constructors/Destructors | |
Observer () | |
Default Constructor. More... | |
virtual | ~Observer () |
Default destructor. More... | |
Protected Member Functions | |
void | RequestAttach (NotifyType notify_type, const Subject *subject) |
Derived classes should call this method to request an "Attach" to a Subject. More... | |
void | RequestDetach (NotifyType notify_type, const Subject *subject) |
Derived classes should call this method to request a "Detach" to a Subject. More... | |
virtual void | RecieveNotification (NotifyType notify_type, const Subject *subject)=0 |
Derived classes should overload this method to recieve the requested notification from attached Subjects. More... | |
Private Member Functions | |
void | ProcessNotification (NotifyType notify_type, const Subject *subject) |
Private Method for Recieving Notification should only be called by the friend class Subject. More... | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
Observer (const Observer &) | |
Copy Constructor. More... | |
void | operator= (const Observer &) |
Overloaded Equals Operator. More... | |
Private Attributes | |
std::vector< const Subject * > | subjects_ |
A list of the subjects currently being observed. More... | |
Friends | |
class | Subject |
Slight Variation of the Observer Design Pattern.
This class implements the Observer class of the Observer Design Pattern. An Observer "Attach"es to a Subject, indicating that it would like to be notified of changes in the Subject. Any derived class wishing to recieve notifications from a Subject should inherit off of Observer and overload the protected method, RecieveNotification_(...).
Definition at line 39 of file IpObserver.hpp.
Enumeration specifying the type of notification.
Enumerator | |
---|---|
NT_All | |
NT_BeingDestroyed | |
NT_Changed |
Definition at line 59 of file IpObserver.hpp.
|
inline |
Default Constructor.
Definition at line 50 of file IpObserver.hpp.
|
inlinevirtual |
Default destructor.
Definition at line 198 of file IpObserver.hpp.
|
private |
Copy Constructor.
|
inlineprotected |
Derived classes should call this method to request an "Attach" to a Subject.
Do not call "Attach" explicitly on the Subject since further processing is done here
Definition at line 219 of file IpObserver.hpp.
|
inlineprotected |
Derived classes should call this method to request a "Detach" to a Subject.
Do not call "Detach" explicitly on the Subject since further processing is done here
Definition at line 238 of file IpObserver.hpp.
|
protectedpure virtual |
Derived classes should overload this method to recieve the requested notification from attached Subjects.
Implemented in Ipopt::DependentResult< T >, Ipopt::DependentResult< Ipopt::SmartPtr< const Ipopt::Vector > >, Ipopt::DependentResult< Ipopt::SmartPtr< Ipopt::Vector > >, Ipopt::DependentResult< Number >, Ipopt::DependentResult< void * >, Ipopt::DependentResult< Ipopt::SmartPtr< const Ipopt::SymMatrix > >, and Ipopt::DependentResult< Ipopt::SmartPtr< const Ipopt::Matrix > >.
|
private |
Overloaded Equals Operator.
|
inlineprivate |
Private Method for Recieving Notification should only be called by the friend class Subject.
This method will, in turn, call the overloaded RecieveNotification method for the derived class to process.
Definition at line 268 of file IpObserver.hpp.
|
friend |
Definition at line 118 of file IpObserver.hpp.
|
private |
A list of the subjects currently being observed.
Definition at line 107 of file IpObserver.hpp.