00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef PEEKABOT_CLIENT_PEEKABOT_PROXY_BASE_HH_INCLUDED
00012 #define PEEKABOT_CLIENT_PEEKABOT_PROXY_BASE_HH_INCLUDED
00013
00014
00015 #include <stdexcept>
00016 #include <boost/shared_ptr.hpp>
00017 #include <boost/thread/recursive_mutex.hpp>
00018
00019 #include "../../Visibility.hh"
00020 #include "../../Types.hh"
00021 #include "../OperationResult.hh"
00022
00023
00024 namespace peekabot
00025 {
00026 class Action;
00027
00028 namespace client
00029 {
00030 class Status;
00031 class ClientImpl;
00032 class PeekabotClient;
00033
00047 class PEEKABOT_API PeekabotProxyBase
00048 {
00049 public:
00050 virtual ~PeekabotProxyBase();
00051
00058 PeekabotClient get_client() const;
00059
00063 bool is_assigned() const;
00064
00065 protected:
00066 PEEKABOT_HIDDEN PeekabotProxyBase();
00067
00068 PEEKABOT_HIDDEN PeekabotProxyBase(const PeekabotProxyBase &p);
00069
00073 PEEKABOT_HIDDEN void set_client_impl(
00074 boost::shared_ptr<ClientImpl> client);
00075
00076 PEEKABOT_HIDDEN boost::shared_ptr<ClientImpl>
00077 unchecked_get_client_impl() const;
00078
00079 static boost::shared_ptr<ClientImpl> unchecked_get_client_impl(
00080 const PeekabotProxyBase &p);
00081
00082 PEEKABOT_HIDDEN boost::shared_ptr<ClientImpl> get_client_impl()
00083 const;
00084
00085 static boost::shared_ptr<ClientImpl> get_client_impl(
00086 const PeekabotProxyBase &p);
00087
00088 static boost::shared_ptr<ClientImpl> get_client_impl(
00089 PeekabotClient &client);
00090
00099 PEEKABOT_HIDDEN void dispatch_action(
00100 Action *action, Status *status) const;
00101
00110 PEEKABOT_HIDDEN boost::shared_ptr<OperationResult>
00111 dispatch_get_action(Action *action, uint32_t request_id) const;
00112
00125 PEEKABOT_HIDDEN uint32_t allocate_request_id() const;
00126
00127 private:
00128
00129 PEEKABOT_HIDDEN PeekabotProxyBase &operator=(const PeekabotProxyBase &other);
00130
00131 protected:
00138 mutable boost::recursive_mutex m_mutex;
00139
00140 private:
00141 mutable boost::shared_ptr<ClientImpl> m_client_impl;
00142 };
00143 }
00144 }
00145
00146
00147 #endif // PEEKABOT_CLIENT_PEEKABOT_PROXY_BASE_HH_INCLUDED