~ubuntu-branches/ubuntu/trusty/openjade1.3/trusty

« back to all changes in this revision

Viewing changes to include/ErrorCountEventHandler.h

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-04-09 00:01:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020409000150-r9rkyalxlhvf9ba3
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 1996 James Clark
 
2
// See the file COPYING for copying permission.
 
3
 
 
4
#ifndef ErrorCountEventHandler_INCLUDED
 
5
#define ErrorCountEventHandler_INCLUDED 1
 
6
 
 
7
#ifdef __GNUG__
 
8
#pragma interface
 
9
#endif
 
10
 
 
11
#include <signal.h>
 
12
#include "Event.h"
 
13
 
 
14
#ifdef SP_NAMESPACE
 
15
namespace SP_NAMESPACE {
 
16
#endif
 
17
 
 
18
class SP_API ErrorCountEventHandler : public EventHandler {
 
19
public:
 
20
  ErrorCountEventHandler(unsigned errorLimit = 0);
 
21
  void setErrorLimit(unsigned maxErrors);
 
22
  const sig_atomic_t *cancelPtr() const;
 
23
  void cancel();
 
24
  Boolean cancelled() const;
 
25
  unsigned errorCount() const;
 
26
  void message(MessageEvent *);
 
27
  void noteMessage(const Message &);
 
28
private:
 
29
  unsigned maxErrors_;
 
30
  unsigned errorCount_;
 
31
  sig_atomic_t cancel_;
 
32
};
 
33
 
 
34
inline
 
35
unsigned ErrorCountEventHandler::errorCount() const
 
36
{
 
37
  return errorCount_;
 
38
}
 
39
 
 
40
inline
 
41
const sig_atomic_t *ErrorCountEventHandler::cancelPtr() const
 
42
{
 
43
  return &cancel_;
 
44
}
 
45
 
 
46
inline
 
47
void ErrorCountEventHandler::cancel()
 
48
{
 
49
  cancel_ = 1;
 
50
}
 
51
 
 
52
inline
 
53
void ErrorCountEventHandler::setErrorLimit(unsigned maxErrors)
 
54
{
 
55
  maxErrors_ = maxErrors;
 
56
}
 
57
 
 
58
inline
 
59
Boolean ErrorCountEventHandler::cancelled() const
 
60
{
 
61
  return cancel_ != 0;
 
62
}
 
63
 
 
64
#ifdef SP_NAMESPACE
 
65
}
 
66
#endif
 
67
 
 
68
#endif /* not ErrorCountEventHandler_INCLUDED */