1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 19 20 #ifndef OSCL_DNS_IMP_BASE_H_INCLUDED 21 #define OSCL_DNS_IMP_BASE_H_INCLUDED 22 23 #include "oscl_socket_imp.h" 24 #include "oscl_dns_request.h" 25 #include "oscl_dns.h" 26 27 class OsclSocketServI; 28 class GetHostByNameParam; 29 class OsclDNSRequestAO; 30 31 /*! 32 ** OsclDNSIBase is a common base class for all 33 ** implementations. 34 */ 35 class OsclDNSIBase 36 { 37 public: 38 virtual ~OsclDNSIBase(); 39 40 //synchronous methods 41 virtual int32 Open(OsclSocketServI& aServer) = 0; 42 virtual int32 Close() = 0; 43 44 //asynchronous methods. 45 46 virtual void GetHostByName(GetHostByNameParam& , OsclDNSRequestAO&) = 0; 47 virtual void GetHostByNameSuccess(GetHostByNameParam&) = 0; 48 49 void CancelFxn(TPVDNSFxn); 50 51 protected: 52 OsclDNSIBase(Oscl_DefAlloc &a); 53 54 Oscl_DefAlloc &iAlloc; 55 56 virtual bool IsReady(OsclDNSRequestAO& aObject) = 0; 57 58 virtual void CancelGetHostByName() = 0; 59 60 //link to socket server. 61 OsclSocketServI *iSocketServ; 62 63 friend class OsclDNSRequest; 64 friend class OsclGetHostByNameRequest; 65 }; 66 67 #endif 68 69 70 71