1 /* 2 * Copyright 2012 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Paweł Dziepak, pdziepak@quarnos.org 7 */ 8 #ifndef RPCCALLBACK_H 9 #define RPCCALLBACK_H 10 11 12 #include "Connection.h" 13 14 15 namespace RPC { 16 17 class CallbackServer; 18 class CallbackRequest; 19 class Server; 20 21 class Callback { 22 public: 23 Callback(Server* server); 24 25 inline void SetID(int32 id); 26 inline int32 ID(); 27 28 inline void SetCBServer(CallbackServer* server); 29 inline CallbackServer* CBServer(); 30 31 status_t EnqueueRequest(CallbackRequest* request, 32 Connection* connection); 33 34 private: 35 CallbackServer* fCBServer; 36 Server* fServer; 37 int32 fID; 38 }; 39 40 41 inline void SetID(int32 id)42Callback::SetID(int32 id) 43 { 44 fID = id; 45 } 46 47 48 inline int32 ID()49Callback::ID() 50 { 51 return fID; 52 } 53 54 55 inline void SetCBServer(CallbackServer * server)56Callback::SetCBServer(CallbackServer* server) 57 { 58 fCBServer = server; 59 } 60 61 62 inline CallbackServer* CBServer()63Callback::CBServer() 64 { 65 return fCBServer; 66 } 67 68 69 } // namespace RPC 70 71 72 #endif // RPCCALLBACK_H 73 74