Alexa Auto SDK  2.3.1
PropertyManager.h
1 /*
2  * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef AACE_PROPERTY_MANAGER_PROPERTY_MANAGER_H
17 #define AACE_PROPERTY_MANAGER_PROPERTY_MANAGER_H
18 
19 #include <iostream>
20 #include <string>
21 #include "AACE/Core/PlatformInterface.h"
22 #include "PropertyManagerEngineInterface.h"
23 
26 namespace aace {
27 namespace propertyManager {
28 
39 protected:
40  PropertyManager() = default;
41 
42 public:
43  virtual ~PropertyManager();
44 
45  using PropertyState = aace::propertyManager::PropertyManagerEngineInterface::PropertyState;
59  bool setProperty(const std::string& name, const std::string& value);
60 
69  virtual void propertyStateChanged(const std::string& name, const std::string& value, const PropertyState state) = 0;
70 
86  std::string getProperty(const std::string& name);
87 
97  virtual void propertyChanged(const std::string& name, const std::string& newValue) = 0;
98 
105  void setEngineInterface(std::shared_ptr<PropertyManagerEngineInterface> propertyManagerEngineInterface);
106 
107 private:
108  std::shared_ptr<PropertyManagerEngineInterface> m_propertyManagerEngineInterface;
109 };
110 
111 inline std::ostream& operator<<(std::ostream& stream, const PropertyManager::PropertyState& state) {
112  switch (state) {
113  case PropertyManager::PropertyState::SUCCEEDED:
114  stream << "SUCCEEDED";
115  break;
116  case PropertyManager::PropertyState::FAILED:
117  stream << "FAILED";
118  break;
119  }
120  return stream;
121 }
122 
123 } // namespace propertyManager
124 } // namespace aace
125 
126 #endif // AACE_PROPERTY_MANAGER_PROPERTY_MANAGER_H
virtual void propertyStateChanged(const std::string &name, const std::string &value, const PropertyState state)=0
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
virtual void propertyChanged(const std::string &name, const std::string &newValue)=0
bool setProperty(const std::string &name, const std::string &value)
Definition: PropertyManager.cpp:23
Definition: PropertyManager.h:38
std::string getProperty(const std::string &name)
Definition: PropertyManager.cpp:28

Alexa Auto SDK 2.3.1 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0