2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file plugin_model.cpp
18 * @author Pawel Sikorski (p.sikorski@samgsung.com)
19 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samgsung.com)
20 * @author Grzegorz Krawczyk (g.krawczyk@samgsung.com)
22 * @brief This file contains PluginModel, PluginHandle definitions.
25 #include "plugin_model.h"
26 #include <dpl/event/model_bind_to_dao.h>
27 #include <dpl/wrt-dao-ro/feature_dao_read_only.h>
29 using namespace WrtDB;
31 template <typename RetType, RetType(PluginDAOReadOnly::*extFun) () const >
32 struct BindToPluginDAO :
33 DPL::Event::BindToDAO<PluginModel,
35 WrtDB::DbPluginHandle,
37 &PluginModel::getHandle,
41 template <typename RetType, RetType(*extFun) (WrtDB::DbPluginHandle)>
42 struct BindToFeatureDAOStatic :
43 DPL::Event::BindToDAO_Static<PluginModel,
45 WrtDB::DbPluginHandle,
46 &PluginModel::getHandle,
50 PluginModel::PluginModel(const WrtDB::DbPluginHandle& handle) :
53 BindToPluginDAO<std::string,
54 &PluginDAOReadOnly::getLibraryName>::Get),
56 BindToPluginDAO<std::string,
57 &PluginDAOReadOnly::getLibraryPath>::Get),
59 BindToFeatureDAOStatic<FeatureHandleListPtr,
61 GetFeatureHandleListForPlugin>::
63 LibraryDependencies(this,
64 BindToPluginDAO<PluginHandleSetPtr,
66 getLibraryDependencies>::Get),
67 LibraryInstance(this, PluginPtr())
70 WrtDB::DbPluginHandle PluginModel::getHandle() const