00001 #ifndef PROTON_SASL_HPP
00002 #define PROTON_SASL_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "./internal/export.hpp"
00026 #include "./internal/config.hpp"
00027 #include "./internal/object.hpp"
00028
00029 #include <proton/sasl.h>
00030
00031 #include <string>
00032
00033 namespace proton {
00034
00036 class sasl {
00038 sasl(pn_sasl_t* s) : object_(s) {}
00040
00041 public:
00042 #if PN_CPP_HAS_DELETED_FUNCTIONS
00043 sasl() = delete;
00044 sasl(const sasl&) = delete;
00045 sasl& operator=(const sasl&) = delete;
00046 sasl& operator=(sasl&&) = delete;
00047 #endif
00048 #if PN_CPP_HAS_DEFAULTED_FUNCTIONS
00049 sasl(sasl&&) = default;
00050 #endif
00051
00053 enum outcome {
00054 NONE = PN_SASL_NONE,
00055 OK = PN_SASL_OK,
00056 AUTH = PN_SASL_AUTH,
00057 SYS = PN_SASL_SYS,
00058 PERM = PN_SASL_PERM,
00059 TEMP = PN_SASL_TEMP
00060 };
00061
00063 PN_CPP_EXTERN enum outcome outcome() const;
00064
00066 PN_CPP_EXTERN std::string user() const;
00067
00069 PN_CPP_EXTERN std::string mech() const;
00070
00072 private:
00073 pn_sasl_t* const object_;
00074
00075 friend class internal::factory<sasl>;
00077 };
00078
00079 }
00080
00081 #endif // PROTON_SASL_HPP