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>
35 typedef int FeatureHandle;
36 typedef std::list<FeatureHandle> FeatureHandleList;
37 typedef std::shared_ptr<FeatureHandleList> FeatureHandleListPtr;
39 typedef int FeatureSetHandle;
40 typedef std::list<FeatureSetHandle> FeatureSetHandleList;
43 std::string featureName;
44 DbPluginHandle pluginHandle;
47 class FeatureModel : public DPL::Event::Model
50 DPL::Event::Property<FeatureHandle, DPL::Event::PropertyReadOnly> FHandle;
51 DPL::Event::Property<std::string> Name;
53 DPL::Event::Property<std::set<std::string> > DeviceCapabilities;
54 DPL::Event::Property<DbPluginHandle> PHandle;
56 FeatureModel(FeatureHandle handle) :
57 FHandle(this, handle),
59 DeviceCapabilities(this),
64 void SetData(const std::string& name, const std::set<std::string>& deviceCapabilities, const DbPluginHandle& pluginHandle)
66 Name.SetWithoutLock(name);
67 DeviceCapabilities.SetWithoutLock(deviceCapabilities);
68 PHandle.SetWithoutLock(pluginHandle);
72 typedef std::shared_ptr<FeatureModel> FeatureModelPtr;
76 #endif // FEATURE_MODEL_H