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 // -*- c++ -*- 19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 21 // Oscl Registry Client 22 23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 25 /*! \addtogroup osclutil OSCL Util 26 * 27 * @{ 28 */ 29 30 /*! 31 * \file oscl_registry_client.h 32 * \brief Client-side implementation of OsclRegistry 33 * 34 */ 35 36 #ifndef OSCL_REGISTRY_CLIENT_H_INCLUDED 37 #define OSCL_REGISTRY_CLIENT_H_INCLUDED 38 39 #ifndef OSCL_REGISTRY_TYPES_H_INCLUDED 40 #include "oscl_registry_types.h" 41 #endif 42 43 #ifndef OSCL_MEM_H_INCLUDED 44 #include "oscl_mem.h" 45 #endif 46 47 #ifndef OSCL_STRING_H_INCLUDED 48 #include "oscl_string.h" 49 #endif 50 51 class OsclRegistryClientImpl; 52 class OsclRegistryClientTlsImpl; 53 54 class OsclRegistryClient : public HeapBase 55 { 56 public: 57 OSCL_IMPORT_REF OsclRegistryClient(); 58 OSCL_IMPORT_REF ~OsclRegistryClient(); 59 60 /*! 61 ** Create a session. 62 ** @param aPerThread: Select per-thread registry instead of global registry. 63 ** @return OsclErrNone on success. 64 */ 65 OSCL_IMPORT_REF int32 Connect(bool aPerThread = false); 66 67 /*! 68 ** Register a component factory by registry ID and component ID. 69 ** 70 ** @param aComponentID: registry + component mime-string. 71 ** @param aFactory: factory function pointer. 72 ** @param aParam: component Create param. 73 ** @return OsclErrNone on success. 74 */ 75 OSCL_IMPORT_REF int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory); 76 77 /*! 78 ** Unregister a previously registered component. 79 ** @return OsclErrNone on success. 80 */ 81 OSCL_IMPORT_REF int32 UnRegister(OSCL_String& aComponentID); 82 83 /*! 84 ** Close and cleanup. All components registered in this session are 85 ** are automatically unregistered. 86 */ 87 OSCL_IMPORT_REF void Close(); 88 89 private: 90 OsclRegistryClientImpl* iGlobalImpl; 91 OsclRegistryClientTlsImpl* iTlsImpl; 92 93 }; 94 95 96 #endif //OSCL_REGISTRY_CLIENT_H_INCLUDED 97 /*! @} */ 98 99 100