• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_GLOBAL_H_INCLUDED
37 #define OSCL_REGISTRY_SERV_IMPL_GLOBAL_H_INCLUDED
38 
39 #include "osclconfig_proc.h"
40 #include "oscl_base.h"
41 #if (OSCL_HAS_SINGLETON_SUPPORT)
42 
43 #include "oscl_registry_serv_impl.h"
44 #include "oscl_registry_types.h"
45 #include "oscl_vector.h"
46 #include "oscl_mem.h"
47 
48 //global-variable-based implementation.
49 //this handles both the registration client and the access client
50 //interfaces.
51 class OsclRegistryServImpl
52 {
53     protected:
54         OsclRegistryServImpl();
55         virtual ~OsclRegistryServImpl();
56 
57         int32 Connect();
58         void Close();
59 
60         //for registration client
61         int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory);
62         int32 UnRegister(OSCL_String& aComponentID);
63 
64         //for access client.
65         OsclComponentFactory GetFactory(OSCL_String& aComponent);
66         void GetFactories(OSCL_String& aRegistry, Oscl_Vector<OsclRegistryAccessElement, OsclMemAllocator>& aVec);
67 
68         friend class OsclRegistryClient;
69         friend class OsclRegistryAccessClient;
70     private:
IsOpen()71         bool IsOpen() const
72         {
73             return iIsOpen;
74         }
75         bool iIsOpen;
76         //server data.
77         OsclComponentRegistry* GetOsclComponentRegistry();
78         //session data.
79         Oscl_Vector<uint32, OsclMemAllocator> iIdVec;
80 
81 };
82 
83 #endif //oscl config
84 
85 #endif //OSCL_REGISTRY_IMPL_GLOBAL_H_INCLUDED
86 /*! @} */
87 
88 
89