17 #ifndef KUDU_CLIENT_CALLBACKS_H
18 #define KUDU_CLIENT_CALLBACKS_H
20 #ifdef KUDU_HEADERS_NO_STUBS
21 #include "kudu/gutil/macros.h"
22 #include "kudu/gutil/port.h"
24 #include "kudu/client/stubs.h"
26 #include "kudu/util/kudu_export.h"
36 enum KuduLogSeverity {
68 virtual void Run(KuduLogSeverity severity,
71 const struct ::tm* time,
73 size_t message_len) = 0;
84 typedef void (T::*MemberType)(
85 KuduLogSeverity severity,
88 const struct ::tm* time,
104 virtual void Run(KuduLogSeverity severity,
105 const char* filename,
107 const struct ::tm* time,
109 size_t message_len) OVERRIDE {
110 (object_->*member_)(severity, filename, line_number, time,
111 message, message_len);
121 template <
typename T>
125 typedef void (*FunctionType)(T arg,
126 KuduLogSeverity severity,
127 const char* filename,
129 const struct ::tm* time,
140 : function_(function),
145 virtual void Run(KuduLogSeverity severity,
146 const char* filename,
148 const struct ::tm* time,
150 size_t message_len) OVERRIDE {
151 function_(arg_, severity, filename, line_number, time,
152 message, message_len);
156 FunctionType function_;
173 virtual void Run(
const Status& s) = 0;
180 template <
typename T>
184 typedef void (T::*MemberType)(
const Status& s);
199 (object_->*member_)(s);
209 template <
typename T>
213 typedef void (*FunctionType)(T arg,
const Status& s);
223 : function_(function),
233 FunctionType function_;
The interface for all logging callbacks.
Definition: callbacks.h:44
A representation of an operation's outcome.
Definition: status.h:106
The logging callback that invokes a member function of an object.
Definition: callbacks.h:81
KuduStatusFunctionCallback(FunctionType function, T arg)
Definition: callbacks.h:222
KuduLoggingMemberCallback(T *object, MemberType member)
Definition: callbacks.h:98
The interface for all status callbacks.
Definition: callbacks.h:161
virtual void Run(KuduLogSeverity severity, const char *filename, int line_number, const struct::tm *time, const char *message, size_t message_len) OVERRIDE
Definition: callbacks.h:145
The status callback that invokes a member function of an object.
Definition: callbacks.h:181
KuduStatusMemberCallback(T *object, MemberType member)
Definition: callbacks.h:192
virtual void Run(const Status &s) OVERRIDE
Definition: callbacks.h:198
virtual void Run(KuduLogSeverity severity, const char *filename, int line_number, const struct::tm *time, const char *message, size_t message_len) OVERRIDE
Definition: callbacks.h:104
virtual void Run(const Status &s) OVERRIDE
Definition: callbacks.h:228
KuduLoggingFunctionCallback(FunctionType function, T arg)
Definition: callbacks.h:139
The status callback that invokes a function by pointer with a single argument.
Definition: callbacks.h:210
The logging callback that invokes a function by pointer with a single argument.
Definition: callbacks.h:122