~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/TimeOut.C

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: TimeOut.C,v 1.12 2000/12/11 12:21:47 zeller Exp $ -*- C++ -*-
 
1
// $Id$ -*- C++ -*-
2
2
// Xt TimeOut debugging routines
3
3
 
4
4
// Copyright (C) 1997 Technische Universitaet Braunschweig, Germany.
27
27
// or send a mail to the DDD developers <ddd@gnu.org>.
28
28
 
29
29
char TimeOut_rcsid[] = 
30
 
    "$Id: TimeOut.C,v 1.12 2000/12/11 12:21:47 zeller Exp $";
31
 
 
32
 
#ifdef __GNUG__
33
 
#pragma implementation
34
 
#endif
 
30
    "$Id$";
35
31
 
36
32
#include "TimeOut.h"
37
33
#include "strclass.h"
38
34
#include "assert.h"
39
35
#include "bool.h"
40
36
 
41
 
#include <iostream.h>
 
37
#include <iostream>
42
38
#include <stdlib.h>             // abort()
43
39
 
44
40
#undef XtAppAddTimeOut
63
59
    {}
64
60
 
65
61
private:
66
 
    TimerInfo(const TimerInfo&)
67
 
        : timer(0), tic(0), interval(0), proc(0), closure(0), file(), line(0),
68
 
          next(0)
69
 
    {
70
 
        assert(0);
71
 
    }
72
 
 
73
 
    TimerInfo& operator = (const TimerInfo&)
74
 
    {
75
 
        assert(0); return *this;
76
 
    }
 
62
    TimerInfo(const TimerInfo&);
 
63
    TimerInfo& operator = (const TimerInfo&);
77
64
};
78
65
 
79
66
// List of pending timers
119
106
        abort();
120
107
 
121
108
#if LOG_TIMERS
122
 
    clog << "TimeOut: " << tm->file << ":" << tm->line << ": timer " 
123
 
         << tm->tic << " (" << XtPointer(tm->timer) << ")"
124
 
         << " expired (" << MyPendingTimeOuts() << " still pending)\n";
 
109
    std::clog << "TimeOut: " << tm->file << ":" << tm->line << ": timer " 
 
110
              << tm->tic << " (" << XtPointer(tm->timer) << ")"
 
111
              << " expired (" << MyPendingTimeOuts() << " still pending)\n";
125
112
#endif
126
113
 
127
114
    tm->proc(tm->closure, &tm->tic);
151
138
    pending_timers = tm;
152
139
 
153
140
#if LOG_TIMERS
154
 
    clog << "TimeOut: " 
155
 
         << file << ":" << line << ": timer " 
156
 
         << tm->tic << " (" << XtPointer(tm->timer) << ") added "
157
 
         << "(" << MyPendingTimeOuts() << " still pending)\n";
 
141
    std::clog << "TimeOut: " 
 
142
              << file << ":" << line << ": timer " 
 
143
              << tm->tic << " (" << XtPointer(tm->timer) << ") added "
 
144
              << "(" << MyPendingTimeOuts() << " still pending)\n";
158
145
#endif
159
146
 
160
147
    // Note: we return a private XtIntervalId instead of the one
173
160
        if (tic == ti->tic)
174
161
        {
175
162
#if LOG_TIMERS
176
 
            clog << "TimeOut: " << file << ":" << line << ": timer "
177
 
                 << ti->tic << " (" << XtPointer(ti->timer) << ") removed "
178
 
                 << "(" << MyPendingTimeOuts() << " still pending)\n"
179
 
                 << "TimeOut: " << ti->file << ":" << ti->line
180
 
                 << ": this is the location where the timer was added.\n";
 
163
            std::clog << "TimeOut: " << file << ":" << line << ": timer "
 
164
                      << ti->tic << " (" << XtPointer(ti->timer) << ") removed "
 
165
                      << "(" << MyPendingTimeOuts() << " still pending)\n"
 
166
                      << "TimeOut: " << ti->file << ":" << ti->line
 
167
                      << ": this is the location where the timer was added.\n";
181
168
#endif
182
169
 
183
170
            XtRemoveTimeOut(ti->timer);
193
180
    }
194
181
 
195
182
    // Timer not found - either already called or removed
196
 
    cerr << "TimeOut: " << file << ":" << line << ": timer " 
 
183
    std::cerr << "TimeOut: " << file << ":" << line << ": timer " 
197
184
         << tic << " expired\n";
198
185
 
199
186
    // `It is an error to remove a timer that has already gone off.'