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 feature_model.h
18 * @author Pawel Sikorski (p.sikorski@samgsung.com)
20 * @brief This file contains FeatureModel, FeatureHandle definitions.
22 #ifndef FEATURE_MODEL_H
23 #define FEATURE_MODEL_H
25 #include <dpl/event/model.h>
26 #include <dpl/event/property.h>
31 #include <dpl/wrt-dao-ro/common_dao_types.h>
34 typedef int FeatureHandle;
35 typedef std::list<FeatureHandle> FeatureHandleList;
36 typedef std::shared_ptr<FeatureHandleList> FeatureHandleListPtr;
38 typedef int FeatureSetHandle;
39 typedef std::list<FeatureSetHandle> FeatureSetHandleList;
42 std::string featureName;
43 DbPluginHandle pluginHandle;
46 class FeatureModel : public DPL::Event::Model
49 DPL::Event::Property<FeatureHandle, DPL::Event::PropertyReadOnly> FHandle;
50 DPL::Event::Property<std::string> Name;
52 DPL::Event::Property<std::set<std::string> > DeviceCapabilities;
53 DPL::Event::Property<DbPluginHandle> PHandle;
55 FeatureModel(FeatureHandle handle) :
56 FHandle(this, handle),
58 DeviceCapabilities(this),
62 void SetData(const std::string& name,
63 const std::set<std::string>& deviceCapabilities,
64 const DbPluginHandle& pluginHandle)
66 Name.SetWithoutLock(name);
67 DeviceCapabilities.SetWithoutLock(deviceCapabilities);
68 PHandle.SetWithoutLock(pluginHandle);
72 typedef std::shared_ptr<FeatureModel> FeatureModelPtr;
75 #endif // FEATURE_MODEL_H