Main Page
Namespaces
Classes
Files
File List
File Members
var
build
temp
tmp.niCloInx4p
4.0-0-0
coinor-ipopt
coinor-ipopt-3.10.2
Ipopt
src
Common
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: IpTaggedObject.hpp 1861 2010-12-21 21:34:47Z andreasw $
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
#include <limits>
17
18
namespace
Ipopt
19
{
20
63
class
TaggedObject
:
public
ReferencedObject
,
public
Subject
64
{
65
public
:
67
typedef
unsigned
int
Tag
;
68
70
TaggedObject
()
71
:
72
Subject
()
73
{
74
ObjectChanged
();
75
}
76
78
virtual
~TaggedObject
()
79
{}
80
85
Tag
GetTag
()
const
86
{
87
return
tag_
;
88
}
89
95
bool
HasChanged
(
const
Tag
comparison_tag)
const
96
{
97
return
(comparison_tag ==
tag_
) ?
false
:
true
;
98
}
99
protected
:
104
void
ObjectChanged
()
105
{
106
DBG_START_METH
(
"TaggedObject::ObjectChanged()"
, 0);
107
tag_
=
unique_tag_
;
108
unique_tag_
++;
109
DBG_ASSERT
(
unique_tag_
< std::numeric_limits<Tag>::max());
110
// The Notify method from the Subject base class notifies all
111
// registed Observers that this subject has changed.
112
Notify
(
Observer::NT_Changed
);
113
}
114
private
:
122
TaggedObject
(
const
TaggedObject
&);
123
125
void
operator=
(
const
TaggedObject
&);
127
132
static
Tag
unique_tag_
;
133
139
Tag
tag_
;
140
146
Index
cache_priority_
;
147
};
148
}
// namespace Ipopt
149
#endif
Generated on Mon Mar 17 2014 19:49:13 by
1.8.1.2