renamed from beacon to beacons, bumped version to 0.1.1 for that.
[beacon-ss.git] / src / beacons / detail / connection_impl_base.hpp
blob8abe603730a971a2cf780474576ce425e50ac49c
1 /**
2 * beacon
3 * Author: Lukas Krejci <krejci.l@centrum.cz>, (C) 2008
4 * Copyright: See COPYING file that comes with this distribution
5 */
7 #ifndef BEACONS_connection_impl_base_H
8 #define BEACONS_connection_impl_base_H
10 #include <beacons/config.hpp>
11 #include <beacons/reference_countable.hpp>
12 #include <beacons/invokable.hpp>
14 namespace beacons {
16 namespace detail {
18 /**
19 * Base class for connection implementation.
20 * Defines the minimal interface that the connection
21 * implementation supports.
23 class connection_impl_base : public reference_countable {
25 public:
27 connection_impl_base() : _token(new invokable::token_ptr::item_type) {}
29 virtual void disconnect() = 0;
30 virtual bool connected() const = 0;
32 #ifdef BEACONS_ENABLE_CONNECTION_BLOCKING
33 virtual bool blocked() const = 0;
34 #endif
36 invokable::token_ptr token() const {
37 return _token;
40 private:
42 invokable::token_ptr _token;
45 } //namespace detail
47 } //namespace beacons
49 #endif