proton/error_condition.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_ERROR_CONDITION_H
00002 #define PROTON_ERROR_CONDITION_H
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include "./internal/export.hpp"
00026 #include "./internal/config.hpp"
00027 #include "./value.hpp"
00028 
00029 #include <string>
00030 #include <iosfwd>
00031 
00034 
00035 struct pn_condition_t;
00036 
00037 namespace proton {
00038 
00040 class error_condition {
00042     error_condition(pn_condition_t* c);
00044 
00045   public:
00047     error_condition() {}
00048 
00051     PN_CPP_EXTERN error_condition(std::string description);
00052 
00054     PN_CPP_EXTERN error_condition(std::string name, std::string description);
00055 
00058     PN_CPP_EXTERN error_condition(std::string name, std::string description, proton::value properties);
00059 
00060 #if PN_CPP_HAS_DEFAULTED_FUNCTIONS && PN_CPP_HAS_DEFAULTED_MOVE_INITIALIZERS
00062     error_condition(const error_condition&) = default;
00063     error_condition& operator=(const error_condition&) = default;
00064     error_condition(error_condition&&) = default;
00065     error_condition& operator=(error_condition&&) = default;
00067 #endif
00068 
00069 #if PN_CPP_HAS_EXPLICIT_CONVERSIONS
00073     PN_CPP_EXTERN explicit operator bool() const;
00074 #endif
00075 
00077     PN_CPP_EXTERN bool operator!() const;
00078 
00080     PN_CPP_EXTERN bool empty() const;
00081 
00083     PN_CPP_EXTERN std::string name() const;
00084 
00086     PN_CPP_EXTERN std::string description() const;
00087 
00089     PN_CPP_EXTERN value properties() const;
00090 
00092     PN_CPP_EXTERN std::string what() const;
00093 
00094   private:
00095     std::string name_;
00096     std::string description_;
00097     proton::value properties_;
00098 
00100   friend class internal::factory<error_condition>;
00102 };
00103 
00105 PN_CPP_EXTERN bool operator==(const error_condition& x, const error_condition& y);
00106 
00108 PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const error_condition& err);
00109 
00110 } // proton
00111 
00112 #endif // PROTON_ERROR_CONDITION_H

Generated on 1 Jun 2020 for Qpid Proton C++ by  doxygen 1.6.1