summaryrefslogtreecommitdiff
path: root/ACEXML/common/Env.h
blob: ff3cc8a063f9060c14419d29f7d48f5b4d1e21d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// -*- C++ -*- $Id$
//

#ifndef _ACEXML_ENV_H_
#define _ACEXML_ENV_H_
#include "Common/Exception.h"

class ACEXML_Export ACEXML_Env
{
  /**
   *
   *
   */
public:
  ACEXML_Env ();
  ACEXML_Env (const ACEXML_Env &ev);

  ~ACEXML_Env (void);

  /// Check if exception has occured.
  int exception_occured (void) const;

  /// Clear the exception and reset the evnrionment.
  void reset (void);

  /// Return the underlying exception for examination
  ACEXML_Exception *exception (void) const;

  /// Set the underlying exception.  ACEXML_Env assumes
  /// ownership of the exception.
  void exception (ACEXML_Exception *exception);

private:
  /// Place holder for exception (if one occurs.)
  ACEXML_Exception *exception_;
};

// = These macros are used to speed up programming.  I hope to
// merge them with ACE_CHECK macros someday.
#define ACEXML_CHECK if (xmlenv.exception ()) return;
#define ACEXML_CHECK_RETURN(VAL) if (xmlenv.exception ()) return VAL;

#if defined (__ACEXML_INLINE__)
# include "Common/Env.i"
#endif /* __ACEXML_INLINE__ */
#endif /* _ACEXML_ENV_H_ */