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>
27 #include <dpl/shared_ptr.h>
31 #include <dpl/wrt-dao-ro/common_dao_types.h>
35 typedef int FeatureHandle;
36 typedef std::list<FeatureHandle> FeatureHandleList;
37 typedef DPL::SharedPtr<FeatureHandleList> FeatureHandleListPtr;
39 typedef int FeatureSetHandle;
40 typedef std::list<FeatureSetHandle> FeatureSetHandleList;
42 class FeatureModel : public DPL::Event::Model
45 DPL::Event::Property<FeatureHandle, DPL::Event::PropertyReadOnly> FHandle;
46 DPL::Event::Property<std::string> Name;
48 DPL::Event::Property<std::set<std::string> > DeviceCapabilities;
49 DPL::Event::Property<DbPluginHandle> PHandle;
51 FeatureModel(FeatureHandle handle) :
52 FHandle(this, handle),
54 DeviceCapabilities(this),
59 void SetData(const std::string& name, const std::set<std::string>& deviceCapabilities, const DbPluginHandle& pluginHandle)
61 Name.SetWithoutLock(name);
62 DeviceCapabilities.SetWithoutLock(deviceCapabilities);
63 PHandle.SetWithoutLock(pluginHandle);
67 typedef DPL::SharedPtr<FeatureModel> FeatureModelPtr;
71 #endif // FEATURE_MODEL_H