1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef SOFTSENSORRESOURCE_H_
22 #define SOFTSENSORRESOURCE_H_
24 #include "BundleResource.h"
32 * @class SoftSensorResource
33 * @brief This class represents bundle resource for Soft Sensor
34 * to be registered in the container and make resource server
37 class SoftSensorResource: public BundleResource
41 * Constructor for SoftSensorResource
46 * Virtual destructor for SoftSensorResource
48 virtual ~SoftSensorResource();
51 * Initialize input and output attributes for the resource
55 virtual void initAttributes();
58 * Return all attributes of the resource
60 * @return RCSResourceAttributes - attributes of the resource
62 virtual RCSResourceAttributes &getAttributes();
65 * Execute the logic of bundle to set the value of attribute
67 * @param key - name of attribute to set
69 * @param value - value of attribute to set
73 virtual void setAttribute(std::string key, RCSResourceAttributes::Value &&value);
76 * Execute the logic of bundle to get the value of attribute
78 * @param key - key of attribute to get
80 * @return RCSResourceAttributes::Value - return value of the attribute
82 virtual RCSResourceAttributes::Value getAttribute(const std::string &key);
85 * SoftSensor logic. Has to be provided by the soft sensor developer.
86 * This function will be executed if an input attribute is updated.
90 virtual void executeLogic() = 0;
94 std::list<std::string> m_inputList;