Xerces-C++ 3.2.0

OutOfMemoryException.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: OutOfMemoryException.hpp 673960 2008-07-04 08:50:12Z borisk $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_OUT_OF_MEMORY_EXCEPTION_HPP)
23 #define XERCESC_INCLUDE_GUARD_OUT_OF_MEMORY_EXCEPTION_HPP
24
25 #include <xercesc/util/XercesDefs.hpp>
26 #include <xercesc/util/XMemory.hpp>
27 #include <xercesc/util/XMLExceptMsgs.hpp>
28 #include <xercesc/util/XMLUniDefs.hpp>
29
30 XERCES_CPP_NAMESPACE_BEGIN
31
32 static const XMLCh gDefOutOfMemoryErrMsg[] =
33 {
34 chLatin_O, chLatin_u, chLatin_t, chLatin_O
35 , chLatin_f, chLatin_M, chLatin_e, chLatin_m
36 , chLatin_o, chLatin_r, chLatin_y, chNull
37 };
38
39 class XMLUTIL_EXPORT OutOfMemoryException : public XMemory
40 {
41 public:
42
43 OutOfMemoryException();
44 ~OutOfMemoryException();
45 // -----------------------------------------------------------------------
46 // Getter methods
47 // -----------------------------------------------------------------------
48 XMLExcepts::Codes getCode() const;
49 const XMLCh* getMessage() const;
50 const XMLCh* getType() const;
51 const char* getSrcFile() const;
52 XMLFileLoc getSrcLine() const;
53
54 OutOfMemoryException(const OutOfMemoryException& toCopy);
55 OutOfMemoryException& operator=(const OutOfMemoryException& toAssign);
56 };
57
58 // constructors/destructors...
59 inline OutOfMemoryException::OutOfMemoryException() {}
60 inline OutOfMemoryException::~OutOfMemoryException() {}
61 inline OutOfMemoryException::OutOfMemoryException(const OutOfMemoryException& other) : XMemory(other) {}
62 inline OutOfMemoryException& OutOfMemoryException::operator=(const OutOfMemoryException&)
63 {
64 return *this;
65 }
66
67 // ---------------------------------------------------------------------------
68 // OutOfMemoryException: Getter methods
69 // ---------------------------------------------------------------------------
70 inline XMLExcepts::Codes OutOfMemoryException::getCode() const
71 {
72 return XMLExcepts::Out_Of_Memory;
73 }
74
75 inline const XMLCh* OutOfMemoryException::getMessage() const
76 {
77 return gDefOutOfMemoryErrMsg;
78 }
79
80 inline const XMLCh* OutOfMemoryException::getType() const
81 {
82 return gDefOutOfMemoryErrMsg;
83 }
84
85 inline const char* OutOfMemoryException::getSrcFile() const
86 {
87 return "";
88 }
89
90 inline XMLFileLoc OutOfMemoryException::getSrcLine() const {
91 return 0;
92 }
93
94 XERCES_CPP_NAMESPACE_END
95
96 #endif
OutOfMemoryException
Definition: OutOfMemoryException.hpp:39
OutOfMemoryException::getCode
XMLExcepts::Codes getCode() const
Definition: OutOfMemoryException.hpp:70
chLatin_f
const XMLCh chLatin_f
Definition: XMLUniDefs.hpp:124
XMemory
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition: XMemory.hpp:40
chLatin_o
const XMLCh chLatin_o
Definition: XMLUniDefs.hpp:133
chLatin_e
const XMLCh chLatin_e
Definition: XMLUniDefs.hpp:123
chLatin_O
const XMLCh chLatin_O
Definition: XMLUniDefs.hpp:106
chLatin_M
const XMLCh chLatin_M
Definition: XMLUniDefs.hpp:104
XMLFileLoc
XMLUInt64 XMLFileLoc
Definition: Xerces_autoconf_config.hpp:142
XercesDefs.hpp
OutOfMemoryException::OutOfMemoryException
OutOfMemoryException()
Definition: OutOfMemoryException.hpp:59
OutOfMemoryException::getMessage
const XMLCh * getMessage() const
Definition: OutOfMemoryException.hpp:75
OutOfMemoryException::getSrcFile
const char * getSrcFile() const
Definition: OutOfMemoryException.hpp:85
XMLUniDefs.hpp
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:118
OutOfMemoryException::operator=
OutOfMemoryException & operator=(const OutOfMemoryException &toAssign)
Definition: OutOfMemoryException.hpp:62
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
chLatin_u
const XMLCh chLatin_u
Definition: XMLUniDefs.hpp:139
chLatin_y
const XMLCh chLatin_y
Definition: XMLUniDefs.hpp:143
OutOfMemoryException::~OutOfMemoryException
~OutOfMemoryException()
Definition: OutOfMemoryException.hpp:60
XMLUTIL_EXPORT
#define XMLUTIL_EXPORT
Definition: XercesDefs.hpp:162
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
OutOfMemoryException::getType
const XMLCh * getType() const
Definition: OutOfMemoryException.hpp:80
chLatin_m
const XMLCh chLatin_m
Definition: XMLUniDefs.hpp:131
chNull
XERCES_CPP_NAMESPACE_BEGIN const XMLCh chNull
Definition: XMLUniDefs.hpp:37
chLatin_r
const XMLCh chLatin_r
Definition: XMLUniDefs.hpp:136
XMemory.hpp
chLatin_t
const XMLCh chLatin_t
Definition: XMLUniDefs.hpp:138
OutOfMemoryException::getSrcLine
XMLFileLoc getSrcLine() const
Definition: OutOfMemoryException.hpp:90