19 #ifndef OUTPUT_STREAM_HPP
20 #define OUTPUT_STREAM_HPP
22 #include <ndb_global.h>
32 virtual int print(
const char *
fmt, ...)
33 ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
34 virtual int println(
const char * fmt, ...)
35 ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
36 virtual void flush() {};
37 virtual void reset_timeout() {};
45 FILE *getFile() {
return f; }
47 int print(
const char *
fmt, ...)
48 ATTRIBUTE_FORMAT(printf, 2, 3);
49 int println(
const char * fmt, ...)
50 ATTRIBUTE_FORMAT(printf, 2, 3);
51 void flush() { fflush(f); }
56 NDB_SOCKET_TYPE m_socket;
57 unsigned m_timeout_ms;
59 unsigned m_timeout_remain;
63 bool timedout() {
return m_timedout; }
64 void reset_timeout() { m_timedout=
false; m_timeout_remain= m_timeout_ms;}
66 int print(
const char *
fmt, ...)
67 ATTRIBUTE_FORMAT(printf, 2, 3);
68 int println(
const char * fmt, ...)
69 ATTRIBUTE_FORMAT(printf, 2, 3);
77 unsigned write_timeout_ms = 1000);
80 int print(
const char *
fmt, ...)
81 ATTRIBUTE_FORMAT(printf, 2, 3);
82 int println(
const char * fmt, ...)
83 ATTRIBUTE_FORMAT(printf, 2, 3);
93 int print(
const char * , ...) {
return 1;}
94 int println(
const char * , ...) {
return 1;}