00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : CommPipe_Stub 00006 * Package : Zeus.ZeusBase.Messaging 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef CommPipe_StubH 00033 #define CommPipe_StubH 00034 00035 #include <zeusbase/Messaging/Interfaces/ICommPipe.hpp> 00036 #include <zeusbase/Remote/AbstractStub.h> 00037 #include <zeusbase/System/Time.h> 00038 00039 00040 BEGIN_NAMESPACE_Zeus 00041 00042 class TSocket; 00043 class TCriticalSection; 00044 00045 /*****************************************************************************/ 00049 /*****************************************************************************/ 00050 zeusbase_class TCommPipe_Stub : public TAbstractStub, public ICommPipe 00051 { 00052 public: 00053 TCommPipe_Stub(); 00054 00055 //Methods of TAbstractStub 00056 virtual Retval MQUALIFIER connect(const IString& rAddress, Uint uiPort); 00057 00058 //Interface ICommPipe 00059 virtual Retval MQUALIFIER sendMessage(IMessage& rMessage); 00060 virtual void MQUALIFIER getPipeName(IString& rName) const; 00061 virtual Uint MQUALIFIER getPriority() const; 00062 virtual bool MQUALIFIER isLocked() const; 00063 virtual bool MQUALIFIER hasRemoteAccess() const; 00064 00065 //Methods of Abstract Stub 00066 STUB_CLASS_DECL(TCommPipe_Stub, L"TCommPipe_Stub"); 00067 00068 //Methods of IZUnknown 00069 MEMORY_MANAGER_DECL 00070 00071 protected: 00072 virtual ~TCommPipe_Stub(); 00073 void lock(); 00074 void unlock(); 00075 00076 private: 00078 TCriticalSection* m_pLock; 00080 bool m_bLocked; 00081 00082 00083 Retval sendMessageAsBinary(IMessage& rMsg); 00084 }; 00085 00086 END_NAMESPACE_Zeus 00087 00088 #endif