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 #ifndef OSCL_LIBRARY_LIST_H_INCLUDED 19 #define OSCL_LIBRARY_LIST_H_INCLUDED 20 21 #ifndef OSCL_MEM_H_INCLUDED 22 #include "oscl_mem.h" 23 #endif 24 25 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 26 #include "oscl_string_containers.h" 27 #endif 28 29 #ifndef OSCL_VECTOR_H_INCLUDED 30 #include "oscl_vector.h" 31 #endif 32 33 #ifndef OSCL_LIBRARY_COMMON_H_INCLUDED 34 #include "oscl_library_common.h" 35 #endif 36 37 struct OsclUuid; 38 class PVLogger; 39 40 /** 41 * OsclLibraryList contains the list of dynamically shared libraries that need to be loaded 42 **/ 43 class OsclLibraryList 44 { 45 public: 46 /** 47 * Default object Constructor function 48 **/ 49 OSCL_IMPORT_REF OsclLibraryList(); 50 51 /** 52 * Object destructor function 53 **/ 54 OSCL_IMPORT_REF ~OsclLibraryList(); 55 56 /** 57 * Populate the list for the given interface ID. 58 * 59 * @param aInterfaceId ID to find the list of libraries for. 60 * @param aConfigFile - DLL Config file 61 * 62 * @returns OsclLibStatus about whether the librarylist vector got populated or not 63 **/ 64 OSCL_IMPORT_REF OsclLibStatus Populate(const OsclUuid& aInterfaceId, const OSCL_String& aConfigFile); 65 66 /** 67 * Get the number of libraries in the list. 68 * 69 * @returns Number of libraries in list. 70 */ 71 OSCL_IMPORT_REF uint32 Size(); 72 73 /** 74 * Returns the n'th element. 75 * @param n element position to return 76 * @returns the reference to the library path stored in the iLibList vector 77 */ 78 OSCL_IMPORT_REF const OSCL_String& GetLibraryPathAt(uint32 n); 79 80 private: 81 Oscl_Vector<OSCL_HeapString<OsclMemAllocator>, OsclMemAllocator> iLibList; 82 PVLogger* ipLogger; 83 #if OSCL_LIBRARY_PERF_LOGGING 84 PVLogger* iDiagnosticsLogger; 85 uint32 iLibHit; 86 uint32 iLinesRead; 87 #endif 88 }; 89 90 #endif //OSCL_LIBRARY_LIST_H_INCLUDED 91 92