00001 /******************************************************************** 00002 00003 Copyright 2006, ACCESS Systems Americas, Inc. All rights reserved. 00004 00005 The contents of this file are subject to the Mozilla Public License Version 00006 1.1 (the "License"); you may not use this file except in compliance with 00007 the License. You may obtain a copy of the License at 00008 http://www.mozilla.org/MPL/ 00009 00010 Software distributed under the License is distributed on an "AS IS" basis, 00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 00012 for the specific language governing rights and limitations under the 00013 License. 00014 00015 The Original Code is the entire contents of this file. 00016 00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc. 00018 00019 Portions created by ACCESS Systems Americas, Inc. are Copyright © 2006. All 00020 Rights Reserved. 00021 00022 Contributor(s): none. 00023 00024 ********************************************************************/ 00033 #ifndef ALP_IPC_CLIENT_H 00034 #define ALP_IPC_CLIENT_H 00035 00036 // Includes ------------------------------------------------------------------ 00037 #include <hiker/ipc.h> 00038 00039 #include <hiker/prv/IpcMessage.h> 00040 00041 00042 // Typedefs ------------------------------------------------------------------ 00043 namespace alp { 00044 00045 namespace ipc { 00046 00047 class Client 00048 { 00049 public: 00050 Client(const char* channelName, 00051 AlpConnectionUsageHint hint = ALP_IPC_CONNECTION_USAGE_HINT_NONE, 00052 uint32_t timeout = 2000); 00053 ~Client(); 00054 00055 alp_status_t Status() { return fStatus; } 00056 00057 alp_status_t Send(Message& msg); 00058 Message Receive(int32_t what, uint32_t timeout = 2000); 00059 00060 private: 00061 AlpConnection* fConnection; 00062 alp_status_t fStatus; 00063 }; 00064 00065 } // namespace ipc 00066 00067 } // namespace alp 00068 00069 00070 #endif // ALP_IPC_CLIENT_H