Loading...
Searching...
No Matches
error_condition.hpp
Go to the documentation of this file.
#ifndef PROTON_ERROR_CONDITION_H
#define PROTON_ERROR_CONDITION_H
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include "./internal/export.hpp"
#include "./value.hpp"
#include <string>
#include <iosfwd>
struct pn_condition_t;
namespace proton {
class error_condition {
error_condition(pn_condition_t* c);
public:
error_condition() = default;
PN_CPP_EXTERN error_condition(std::string description);
PN_CPP_EXTERN error_condition(std::string name, std::string description);
PN_CPP_EXTERN error_condition(std::string name, std::string description, proton::value properties);
error_condition(const error_condition&) = default;
error_condition& operator=(const error_condition&) = default;
error_condition(error_condition&&) = default;
error_condition& operator=(error_condition&&) = default;
PN_CPP_EXTERN explicit operator bool() const;
PN_CPP_EXTERN bool operator!() const;
PN_CPP_EXTERN bool empty() const;
PN_CPP_EXTERN std::string name() const;
PN_CPP_EXTERN std::string description() const;
PN_CPP_EXTERN value properties() const;
PN_CPP_EXTERN std::string what() const;
private:
std::string name_;
std::string description_;
proton::value properties_;
friend class internal::factory<error_condition>;
};
PN_CPP_EXTERN bool operator==(const error_condition& x, const error_condition& y);
PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const error_condition& err);
} // proton
#endif // PROTON_ERROR_CONDITION_H
proton::error_condition
Describes an endpoint error state.
Definition error_condition.hpp:39
proton::error_condition::description
std::string description() const
Descriptive string for condition.
proton::error_condition::name
std::string name() const
Condition name.
proton::error_condition::error_condition
error_condition()=default
Create an empty error condition.
proton::error_condition::error_condition
error_condition(std::string description)
Create an error condition with only a description.
proton::error_condition::operator!
bool operator!() const
No condition set.
proton::error_condition::empty
bool empty() const
No condition has been set.
proton::error_condition::error_condition
error_condition(std::string name, std::string description, proton::value properties)
Unsettled API - Create an error condition with name, description, and informational properties.
proton::error_condition::error_condition
error_condition(std::string name, std::string description)
Create an error condition with a name and description.
proton::error_condition::properties
value properties() const
Extra information for condition.
proton::error_condition::what
std::string what() const
Simple printable string for condition.
proton::value
A holder for any AMQP value, simple or complex.
Definition value.hpp:57
proton
The main Proton namespace.
Definition annotation_key.hpp:33
proton::operator<<
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.
value.hpp
A holder for any AMQP value, simple or complex.