Ipopt Documentation  
IpTaggedObject.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2006 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id$
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8 
9 #ifndef __IPTAGGEDOBJECT_HPP__
10 #define __IPTAGGEDOBJECT_HPP__
11 
12 #include "IpUtils.hpp"
13 #include "IpDebug.hpp"
14 #include "IpReferenced.hpp"
15 #include "IpObserver.hpp"
16 
17 namespace Ipopt
18 {
19 
60 {
61 public:
63  typedef unsigned int Tag;
64 
67  :
68  Subject()
69  {
70  ObjectChanged();
71  }
72 
74  virtual ~TaggedObject()
75  {}
76 
81  Tag GetTag() const
82  {
83  return tag_;
84  }
85 
91  bool HasChanged(const Tag comparison_tag) const
92  {
93  return (comparison_tag == tag_) ? false : true;
94  }
95 protected:
100  void ObjectChanged();
101 private:
109  TaggedObject(const TaggedObject&);
110 
112  void operator=(const TaggedObject&);
114 
121 
128 };
129 } // namespace Ipopt
130 #endif
Ipopt::TaggedObject::cache_priority_
Index cache_priority_
The index indicating the cache priority for this TaggedObject.
Definition: IpTaggedObject.hpp:127
IpUtils.hpp
Ipopt::TaggedObject
TaggedObject class.
Definition: IpTaggedObject.hpp:59
Ipopt::TaggedObject::TaggedObject
TaggedObject()
Constructor.
Definition: IpTaggedObject.hpp:66
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:13
Ipopt::TaggedObject::tag_
Tag tag_
The tag indicating the current state of the object.
Definition: IpTaggedObject.hpp:120
IPOPTLIB_EXPORT
#define IPOPTLIB_EXPORT
Definition: config_default.h:16
Ipopt::TaggedObject::~TaggedObject
virtual ~TaggedObject()
Destructor.
Definition: IpTaggedObject.hpp:74
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
IpReferenced.hpp
IpObserver.hpp
Ipopt::TaggedObject::GetTag
Tag GetTag() const
Users of TaggedObjects call this to update their own internal tags every time they perform the expens...
Definition: IpTaggedObject.hpp:81
Ipopt::Subject
Slight Variation of the Observer Design Pattern (Subject part).
Definition: IpObserver.hpp:149
Ipopt::TaggedObject::Tag
unsigned int Tag
Type for the Tag values.
Definition: IpTaggedObject.hpp:63
IpDebug.hpp
Ipopt::ReferencedObject
Storing the reference count of all the smart pointers that currently reference it.
Definition: IpReferenced.hpp:169
Ipopt::TaggedObject::HasChanged
bool HasChanged(const Tag comparison_tag) const
Users of TaggedObjects call this to check if the object HasChanged since they last updated their own ...
Definition: IpTaggedObject.hpp:91