XT-Audio
XtPrint.hpp
Go to the documentation of this file.
1 #ifndef XT_API_PRINT_HPP
2 #define XT_API_PRINT_HPP
3 
6 #include <xt/cpp/Core.hpp>
7 #include <xt/cpp/Error.hpp>
8 
9 #include <ostream>
12 namespace Xt {
13 
14 using namespace Detail;
15 
16 inline std::ostream&
17 operator<<(std::ostream& os, Cause cause)
18 { return os << Detail::HandleAssert(XtPrintCause(static_cast<XtCause>(cause))); }
19 inline std::ostream&
20 operator<<(std::ostream& os, Setup setup)
21 { return os << Detail::HandleAssert(XtPrintSetup(static_cast<XtSetup>(setup))); }
22 inline std::ostream&
23 operator<<(std::ostream& os, System system)
24 { return os << Detail::HandleAssert(XtPrintSystem(static_cast<XtSystem>(system))); }
25 inline std::ostream&
26 operator<<(std::ostream& os, Sample sample)
27 { return os << Detail::HandleAssert(XtPrintSample(static_cast<XtSample>(sample))); }
28 inline std::ostream&
29 operator<<(std::ostream& os, EnumFlags flags)
30 { return os << Detail::HandleAssert(XtPrintEnumFlags(static_cast<XtEnumFlags>(flags))); }
31 inline std::ostream&
32 operator<<(std::ostream& os, DeviceCaps capabilities)
33 { return os << Detail::HandleAssert(XtPrintDeviceCaps(static_cast<XtDeviceCaps>(capabilities))); }
34 inline std::ostream&
35 operator<<(std::ostream& os, ServiceCaps capabilities)
36 { return os << Detail::HandleAssert(XtPrintServiceCaps(static_cast<XtServiceCaps>(capabilities))); }
37 
38 inline std::ostream&
39 operator<<(std::ostream& os, ErrorInfo const& info)
40 {
41  XtErrorInfo i;
42  i.fault = info.fault;
43  i.service.text = info.service.text.c_str();
44  i.system = static_cast<XtSystem>(info.system);
45  i.service.cause = static_cast<XtCause>(info.service.cause);
46  return os << Detail::HandleAssert(XtPrintErrorInfo(&i));
47 }
48 
49 } // namespace Xt
50 #endif // XT_API_PRINT_HPP
ServiceError service
Definition: Structs.hpp:47
std::string text
Definition: Structs.hpp:40
EnumFlags
Definition: Enums.hpp:13
Cause cause
Definition: Structs.hpp:39
Cause
Definition: Enums.hpp:10
System system
Definition: Structs.hpp:46
std::ostream & operator<<(std::ostream &os, Cause cause)
Definition: XtPrint.hpp:17
DeviceCaps
Definition: Enums.hpp:16
Definition: Structs.hpp:43
ServiceCaps
Definition: Enums.hpp:14
Definition: Callbacks.hpp:10
Sample
Definition: Enums.hpp:9
Setup
Definition: Enums.hpp:8
System
Definition: Enums.hpp:11
uint32_t fault
Definition: Structs.hpp:45