X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=src%2Fclient.hxx;h=c639bb1da30fb52e3688fa2851db4da8c3d9cf3a;hp=28cded21db55932454d1384cd51637b6a2db4344;hb=91730468439e21dcf8d275d0f70d803c20ccaa7c;hpb=a11e19b7adab2d5b937573701959562f06087ac5 diff --git a/src/client.hxx b/src/client.hxx index 28cded2..c639bb1 100644 --- a/src/client.hxx +++ b/src/client.hxx @@ -20,6 +20,10 @@ #define __LIBT2N_CLIENT #include +#include +#include + +#include #include "connection.hxx" #include "types.hxx" @@ -27,12 +31,32 @@ namespace libt2n { +/** @brief a (generic) connection from client to server. Abstract. + */ class client_connection : public connection { + private: + log_level_values log_level; + std::ostream *logstream; + + /// vector initialized for all callback-types, all elements in each list will be called + std::vector > > callbacks; + + protected: + void do_callbacks(callback_event_type event); + public: - client_connection() - : connection() - { } + client_connection(); + + virtual ~client_connection(); + + void close(); + + void set_logging(std::ostream *_logstream, log_level_values _log_level); + + std::ostream* get_logstream(log_level_values level); + + void add_callback(callback_event_type event, const boost::function& func); }; }