activemq-cpp-3.8.2
CMSException.h
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 #ifndef _CMS_CMSEXCEPTION_H_
19 #define _CMS_CMSEXCEPTION_H_
20 
21 // Includes
22 #include <string>
23 #include <vector>
24 #include <iostream>
25 #include <exception>
26 
27 #include <cms/Config.h>
28 
29 namespace cms {
30 
31  class CMSExceptionData;
32 
50  class CMS_API CMSException : public std::exception {
51  private:
52 
53  // The actual data that defines this exception.
54  CMSExceptionData* data;
55 
56  public:
57 
58  CMSException();
59 
60  CMSException(const CMSException& ex);
61 
62  CMSException(const std::string& message);
63 
64  CMSException(const std::string& message, const std::exception* cause);
65 
66  CMSException(const std::string& message, const std::exception* cause,
67  const std::vector<std::pair<std::string, int> >& stackTrace);
68 
69  virtual ~CMSException() throw();
70 
76  virtual std::string getMessage() const;
77 
87  virtual const std::exception* getCause() const;
88 
95  virtual std::vector< std::pair< std::string, int> > getStackTrace() const;
96 
102  virtual void setMark(const char* file, const int lineNumber);
103 
107  virtual void printStackTrace() const;
108 
114  virtual void printStackTrace(std::ostream& stream) const;
115 
121  virtual std::string getStackTraceString() const;
122 
128  virtual const char* what() const throw();
129 
138  virtual CMSException* clone();
139 
140  private:
141 
149  CMSException& operator=(const cms::CMSException&) {
150  return *this;
151  }
152 
153  };
154 
155 }
156 
157 #endif /*_CMS_CMSEXCEPTION_H_*/
#define CMS_API
Definition: Config.h:31
CMS API Exception that is the base for all exceptions thrown from CMS classes.
Definition: CMSException.h:50
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: DestinationResolver.h:23