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,
42 template <typename RetType, RetType(*extFun) (WrtDB::DbPluginHandle)>
43 struct BindToFeatureDAOStatic :
44 DPL::Event::BindToDAO_Static<PluginModel,
46 WrtDB::DbPluginHandle,
47 &PluginModel::getHandle,
52 PluginModel::PluginModel(const WrtDB::DbPluginHandle& handle) :
55 BindToPluginDAO<std::string,
56 &PluginDAOReadOnly::getLibraryName>::Get),
58 BindToPluginDAO<std::string,
59 &PluginDAOReadOnly::getLibraryPath>::Get),
61 BindToFeatureDAOStatic<FeatureHandleListPtr,
62 FeatureDAOReadOnly::GetFeatureHandleListForPlugin>::Get),
63 LibraryDependencies(this,
64 BindToPluginDAO<PluginHandleSetPtr,
65 &PluginDAOReadOnly::getLibraryDependencies>::Get),
66 LibraryInstance(this, PluginPtr())
70 WrtDB::DbPluginHandle PluginModel::getHandle() const
75 bool PluginModel::operator< (const PluginModel& obj) const
77 return obj.Handle.Get() < Handle.Get();