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 * @file pvmf_clientserver_socket_factory.cpp 20 * @brief Singleton factory for PVMFClientServerSocketNode 21 */ 22 #ifndef PVMF_CLIENTSERVER_SOCKET_NODE_FACTORY_H_INCLUDED 23 #include "pvmf_clientserver_socket_factory.h" 24 #endif 25 #ifndef OSCL_EXCEPTION_H_INCLUDED 26 #include "oscl_exception.h" 27 #endif 28 #ifndef OSCL_MEM_H_INCLUDED 29 #include "oscl_mem.h" 30 #endif 31 32 // Use default DLL entry point for Symbian 33 #include "oscl_dll.h" 34 OSCL_DLL_ENTRY_POINT_DEFAULT()35OSCL_DLL_ENTRY_POINT_DEFAULT() 36 37 38 //////////////////////////////////////////////////////////////////////////// 39 OSCL_EXPORT_REF PVMFNodeInterface* PVMFClientServerSocketNodeFactory::CreateClientServerSocketNode(OsclTCPSocket* aSocketHandle, int32 aPriority) 40 { 41 PVMFNodeInterface* node = NULL; 42 node = OSCL_NEW(PVMFClientServerSocketNode, (aSocketHandle, aPriority)); 43 if (node == NULL) 44 { 45 OSCL_LEAVE(OsclErrNoMemory); 46 } 47 return node; 48 } 49 50 51 //////////////////////////////////////////////////////////////////////////// DeleteClientServerSocketNode(PVMFNodeInterface * aNode)52OSCL_EXPORT_REF bool PVMFClientServerSocketNodeFactory::DeleteClientServerSocketNode(PVMFNodeInterface* aNode) 53 { 54 if (aNode) 55 { 56 OSCL_DELETE(aNode); 57 return true; 58 } 59 return false; 60 } 61 62