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 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6 
7 #ifndef __IPTAGGEDOBJECT_HPP__
8 #define __IPTAGGEDOBJECT_HPP__
9 
10 #include "IpUtils.hpp"
11 #include "IpDebug.hpp"
12 #include "IpReferenced.hpp"
13 #include "IpObserver.hpp"
14 
15 namespace Ipopt
16 {
17 
58 {
59 public:
61  typedef unsigned int Tag;
62 
65  :
66  Subject()
67  {
68  ObjectChanged();
69  }
70 
72  virtual ~TaggedObject()
73  {}
74 
79  Tag GetTag() const
80  {
81  return tag_;
82  }
83 
89  bool HasChanged(const Tag comparison_tag) const
90  {
91  return (comparison_tag == tag_) ? false : true;
92  }
93 protected:
98  void ObjectChanged();
99 private:
105 
107  TaggedObject(const TaggedObject&);
108 
110  void operator=(const TaggedObject&);
112 
119 
126 };
127 } // namespace Ipopt
128 #endif
#define IPOPTLIB_EXPORT
Definition: config.h:94
TaggedObject()
Constructor.
Index cache_priority_
The index indicating the cache priority for this TaggedObject.
Slight Variation of the Observer Design Pattern (Subject part).
Definition: IpObserver.hpp:149
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
TaggedObject class.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
Storing the reference count of all the smart pointers that currently reference it.
Tag GetTag() const
Users of TaggedObjects call this to update their own internal tags every time they perform the expens...
unsigned int Tag
Type for the Tag values.
Tag tag_
The tag indicating the current state of the object.
bool HasChanged(const Tag comparison_tag) const
Users of TaggedObjects call this to check if the object HasChanged since they last updated their own ...
virtual ~TaggedObject()
Destructor.