28 #ifndef TOMOGRAPHER_TOOLS_STATUSPROVIDER_H 29 #define TOMOGRAPHER_TOOLS_STATUSPROVIDER_H 49 template<
typename StatusableObject_>
52 typedef StatusableObject_ StatusableObject;
54 static constexpr
bool CanProvideStatusLine =
false;
71 namespace tomo_internal {
72 template<
typename StObj,
typename canprov
ideline =
void>
73 struct status_can_provide_line {
74 static constexpr
bool val =
false;
76 template<
typename StObj>
77 struct status_can_provide_line<StObj,
78 typename std::enable_if<StatusProvider<StObj>::CanProvideStatusLine,void>::type> {
79 static constexpr
bool val =
true;
81 template<
typename StObj,
typename canprov
idefullmessage =
void>
82 struct status_can_provide_fullmessage {
83 static constexpr
bool val =
false;
85 template<
typename StObj>
86 struct status_can_provide_fullmessage<StObj,
87 typename std::enable_if<StatusProvider<StObj>::CanProvideStatusFullMessage,void>::type> {
88 static constexpr
bool val =
true;
100 template<
typename StatusableObject_>
103 typedef StatusableObject_ StatusableObject;
105 static constexpr
bool CanProvideStatusLine = tomo_internal::status_can_provide_line<StatusableObject>::val;
107 TOMOGRAPHER_ENABLED_IF(CanProvideStatusLine)
108 static inline std::string getStatusLine(
const StatusableObject * obj)
112 TOMOGRAPHER_ENABLED_IF(!CanProvideStatusLine)
117 static constexpr
bool CanProvideStatusFullMessage = tomo_internal::status_can_provide_fullmessage<StatusableObject>::val;
119 TOMOGRAPHER_ENABLED_IF(CanProvideStatusFullMessage)
120 static inline std::string getStatusFullMessage(
const StatusableObject * obj)
124 TOMOGRAPHER_ENABLED_IF(!CanProvideStatusFullMessage)
130 template<
typename StatusableObject_>
132 template<
typename StatusableObject_>
Base namespace for the Tomographer project.
Some C++ utilities, with a tad of C++11 tricks.