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 Serv Impl 22 23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 25 /*! \addtogroup osclutil OSCL Util 26 * 27 * @{ 28 */ 29 /*! 30 * \file oscl_registry_serv_impl.h 31 * \brief Server-side implementation of OsclRegistry interfaces. 32 * 33 */ 34 35 36 #ifndef OSCL_REGISTRY_SERV_IMPL_TLS_H_INCLUDED 37 #define OSCL_REGISTRY_SERV_IMPL_TLS_H_INCLUDED 38 39 #include "osclconfig_proc.h" 40 41 #include "oscl_registry_serv_impl.h" 42 #include "oscl_registry_types.h" 43 #include "oscl_vector.h" 44 #include "oscl_mem.h" 45 46 //TLS-based implementation. 47 //this handles both the registration client and the access client 48 //interfaces. 49 class OsclRegistryServTlsImpl 50 { 51 protected: 52 OsclRegistryServTlsImpl(); 53 virtual ~OsclRegistryServTlsImpl(); 54 55 int32 Connect(); 56 void Close(); 57 58 //for registration client 59 int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory); 60 int32 UnRegister(OSCL_String& aComponentID); 61 62 //for access client. 63 OsclComponentFactory GetFactory(OSCL_String& aComponent); 64 void GetFactories(OSCL_String& aRegistry, Oscl_Vector<OsclRegistryAccessElement, OsclMemAllocator>& aVec); 65 66 friend class OsclRegistryClient; 67 friend class OsclRegistryAccessClient; 68 private: IsOpen()69 bool IsOpen() const 70 { 71 return iIsOpen; 72 } 73 bool iIsOpen; 74 //server data. 75 OsclComponentRegistry* GetOsclComponentRegistry(); 76 //session data. 77 Oscl_Vector<uint32, OsclMemAllocator> iIdVec; 78 }; 79 80 81 #endif //OSCL_REGISTRY_IMPL_TLS_H_INCLUDED 82 /*! @} */ 83 84 85