7#ifndef __IPOBSERVER_HPP__
8#define __IPOBSERVER_HPP__
15#if IPOPT_CHECKLEVEL > 2
16# define IP_DEBUG_OBSERVER
18#ifdef IP_DEBUG_OBSERVER
41#ifdef IP_DEBUG_OBSERVER
132 void ProcessNotification(
152#ifdef IP_DEBUG_OBSERVER
232#ifdef IP_DEBUG_OBSERVER
245#ifdef IP_DEBUG_OBSERVER
259#ifdef IP_DEBUG_OBSERVER
281#ifdef IP_DEBUG_OBSERVER
291#ifdef IP_DEBUG_OBSERVER
298#ifdef IP_DEBUG_OBSERVER
299 DBG_PRINT((1,
"Removing subject: %p from the list\n", (
const void*)
subject));
316#ifdef IP_DEBUG_OBSERVER
328#ifdef IP_DEBUG_OBSERVER
345#ifdef IP_DEBUG_OBSERVER
349 for( std::vector<Observer*>::iterator iter =
observers_.begin(); iter !=
observers_.end(); ++iter )
361#ifdef IP_DEBUG_OBSERVER
384#ifdef IP_DEBUG_OBSERVER
393#ifdef IP_DEBUG_OBSERVER
410#ifdef IP_DEBUG_OBSERVER
414 for( std::vector<Observer*>::iterator iter =
observers_.begin(); iter !=
observers_.end(); ++iter )
#define DBG_PRINT(__printf_args)
#define DBG_START_METH(__func_name, __verbose_level)
Templated class which stores one entry for the CachedResult class.
Slight Variation of the Observer Design Pattern.
void ProcessNotification(NotifyType notify_type, const Subject *subject)
Private Method for Receiving Notification should only be called by the friend class Subject.
virtual void ReceiveNotification(NotifyType notify_type, const Subject *subject)=0
Derived classes should overload this method to receive the requested notification from attached Subje...
virtual ~Observer()
Destructor.
void RequestDetach(NotifyType notify_type, const Subject *subject)
Derived classes should call this method to request a "Detach" to a Subject.
void operator=(const Observer &)
Default Assignment Operator.
NotifyType
Enumeration specifying the type of notification.
std::vector< const Subject * > subjects_
A list of the subjects currently being observed.
Observer()
Default Constructor.
void RequestAttach(NotifyType notify_type, const Subject *subject)
Derived classes should call this method to request an "Attach" to a Subject.
Observer(const Observer &)
Copy Constructor.
Slight Variation of the Observer Design Pattern (Subject part).
void Notify(Observer::NotifyType notify_type) const
Subject(const Subject &)
Copy Constructor.
Subject()
Default Constructor.
void AttachObserver(Observer::NotifyType notify_type, Observer *observer) const
Attach the specified observer (i.e., begin receiving notifications).
void DetachObserver(Observer::NotifyType notify_type, Observer *observer) const
Detach the specified observer (i.e., no longer receive notifications).
virtual ~Subject()
Destructor.
std::vector< Observer * > observers_
void operator=(const Subject &)
Default Assignment Operator.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipindex Index
Type of all indices of vectors, matrices etc.