Ipopt Documentation  
 
Loading...
Searching...
No Matches
Ipopt::DependentResult< T > Class Template Reference

Templated class which stores one entry for the CachedResult class. More...

#include <IpCachedResults.hpp>

+ Inheritance diagram for Ipopt::DependentResult< T >:

Public Member Functions

bool DependentsIdentical (const std::vector< const TaggedObject * > &dependents, const std::vector< Number > &scalar_dependents) const
 This method returns true if the dependencies provided to this function are identical to the ones stored with the DependentResult.
 
void DebugPrint () const
 Print information about this DependentResults.
 
Constructor, Destructors
 DependentResult (const T &result, const std::vector< const TaggedObject * > &dependents, const std::vector< Number > &scalar_dependents)
 Constructor, given all information about the result.
 
 ~DependentResult ()
 Destructor.
 
Accessor method.
bool IsStale () const
 Indicates, whether the DependentResult is no longer valid.
 
void Invalidate ()
 Invalidates the cached result.
 
const TGetResult () const
 Returns the cached result.
 
- Public Member Functions inherited from Ipopt::Observer
 Observer ()
 Default Constructor.
 
virtual ~Observer ()
 Destructor.
 

Protected Member Functions

virtual void ReceiveNotification (NotifyType notify_type, const Subject *subject)
 Notification Receiver Method.
 
- Protected Member Functions inherited from Ipopt::Observer
void RequestAttach (NotifyType notify_type, const Subject *subject)
 Derived classes should call this method to request an "Attach" to a Subject.
 
void RequestDetach (NotifyType notify_type, const Subject *subject)
 Derived classes should call this method to request a "Detach" to a Subject.
 

Private Member Functions

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.

 DependentResult ()
 Default Constructor.
 
 DependentResult (const DependentResult &)
 Copy Constructor.
 
void operator= (const DependentResult &)
 Default Assignment Operator.
 

Private Attributes

bool stale_
 Flag indicating, if the cached result is still valid.
 
const T result_
 The value of the dependent results.
 
std::vector< TaggedObject::Tagdependent_tags_
 Dependencies in form of TaggedObjects.
 
std::vector< Numberscalar_dependents_
 Dependencies in form a Numbers.
 

Additional Inherited Members

- Public Types inherited from Ipopt::Observer
enum  NotifyType { NT_All , NT_BeingDestroyed , NT_Changed }
 Enumeration specifying the type of notification. More...
 

Detailed Description

template<class T>
class Ipopt::DependentResult< T >

Templated class which stores one entry for the CachedResult class.

It stores the result (of type T), together with its dependencies (vector of TaggedObjects and vector of Numbers). It also stores a priority.

Definition at line 301 of file IpCachedResults.hpp.

Constructor & Destructor Documentation

◆ DependentResult() [1/3]

template<class T >
Ipopt::DependentResult< T >::DependentResult ( const T result,
const std::vector< const TaggedObject * > &  dependents,
const std::vector< Number > &  scalar_dependents 
)

Constructor, given all information about the result.

Definition at line 410 of file IpCachedResults.hpp.

◆ ~DependentResult()

Destructor.

Definition at line 446 of file IpCachedResults.hpp.

◆ DependentResult() [2/3]

template<class T >
Ipopt::DependentResult< T >::DependentResult ( )
private

Default Constructor.

◆ DependentResult() [3/3]

template<class T >
Ipopt::DependentResult< T >::DependentResult ( const DependentResult< T > &  )
private

Copy Constructor.

Member Function Documentation

◆ IsStale()

template<class T >
bool Ipopt::DependentResult< T >::IsStale ( ) const

Indicates, whether the DependentResult is no longer valid.

Definition at line 458 of file IpCachedResults.hpp.

◆ Invalidate()

template<class T >
void Ipopt::DependentResult< T >::Invalidate ( )

Invalidates the cached result.

Definition at line 464 of file IpCachedResults.hpp.

◆ GetResult()

template<class T >
const T & Ipopt::DependentResult< T >::GetResult ( ) const

Returns the cached result.

Definition at line 529 of file IpCachedResults.hpp.

◆ DependentsIdentical()

template<class T >
bool Ipopt::DependentResult< T >::DependentsIdentical ( const std::vector< const TaggedObject * > &  dependents,
const std::vector< Number > &  scalar_dependents 
) const

This method returns true if the dependencies provided to this function are identical to the ones stored with the DependentResult.

Definition at line 488 of file IpCachedResults.hpp.

◆ DebugPrint()

template<class T >
void Ipopt::DependentResult< T >::DebugPrint ( ) const

Print information about this DependentResults.

Definition at line 540 of file IpCachedResults.hpp.

◆ ReceiveNotification()

template<class T >
void Ipopt::DependentResult< T >::ReceiveNotification ( NotifyType  notify_type,
const Subject subject 
)
protectedvirtual

Notification Receiver Method.

This method is overloading the pure virtual method from the Observer base class. This method is called when a Subject registered for this Observer sends a notification. In this particular case, if this method is called with notify_type==NT_Changed or NT_BeingDeleted, then this results is marked as stale.

Implements Ipopt::Observer.

Definition at line 470 of file IpCachedResults.hpp.

◆ operator=()

template<class T >
void Ipopt::DependentResult< T >::operator= ( const DependentResult< T > &  )
private

Default Assignment Operator.

Member Data Documentation

◆ stale_

template<class T >
bool Ipopt::DependentResult< T >::stale_
private

Flag indicating, if the cached result is still valid.

A result becomes invalid, if the ReceiveNotification method is called with NT_Changed.

Definition at line 392 of file IpCachedResults.hpp.

◆ result_

template<class T >
const T Ipopt::DependentResult< T >::result_
private

The value of the dependent results.

Definition at line 394 of file IpCachedResults.hpp.

◆ dependent_tags_

template<class T >
std::vector<TaggedObject::Tag> Ipopt::DependentResult< T >::dependent_tags_
private

Dependencies in form of TaggedObjects.

Definition at line 396 of file IpCachedResults.hpp.

◆ scalar_dependents_

template<class T >
std::vector<Number> Ipopt::DependentResult< T >::scalar_dependents_
private

Dependencies in form a Numbers.

Definition at line 398 of file IpCachedResults.hpp.


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