AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
NotifierInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright 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 ACSDKNOTIFIERINTERFACES_INTERNAL_NOTIFIERINTERFACE_H_
17 #define ACSDKNOTIFIERINTERFACES_INTERNAL_NOTIFIERINTERFACE_H_
18 
19 #include <functional>
20 #include <memory>
21 
22 namespace alexaClientSDK {
23 namespace acsdkNotifierInterfaces {
24 
30 template <typename ObserverType>
32 public:
36  virtual ~NotifierInterface() = default;
37 
46  virtual void addObserver(const std::shared_ptr<ObserverType>& observer) = 0;
47 
56  virtual void removeObserver(const std::shared_ptr<ObserverType>& observer) = 0;
57 
66  virtual void addWeakPtrObserver(const std::weak_ptr<ObserverType>& observer) = 0;
67 
73  virtual void removeWeakPtrObserver(const std::weak_ptr<ObserverType>& observer) = 0;
74 
80  virtual void notifyObservers(std::function<void(const std::shared_ptr<ObserverType>&)> notify) = 0;
81 
89  virtual bool notifyObserversInReverse(std::function<void(const std::shared_ptr<ObserverType>&)> notify) = 0;
90 
104  virtual void setAddObserverFunction(std::function<void(const std::shared_ptr<ObserverType>&)> postAddFunc) = 0;
105 };
106 
107 } // namespace acsdkNotifierInterfaces
108 } // namespace alexaClientSDK
109 
110 #endif // ACSDKNOTIFIERINTERFACES_INTERNAL_NOTIFIERINTERFACE_H_
virtual void addWeakPtrObserver(const std::weak_ptr< ObserverType > &observer)=0
virtual void notifyObservers(std::function< void(const std::shared_ptr< ObserverType > &)> notify)=0
virtual void addObserver(const std::shared_ptr< ObserverType > &observer)=0
virtual bool notifyObserversInReverse(std::function< void(const std::shared_ptr< ObserverType > &)> notify)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void setAddObserverFunction(std::function< void(const std::shared_ptr< ObserverType > &)> postAddFunc)=0
virtual void removeObserver(const std::shared_ptr< ObserverType > &observer)=0
virtual void removeWeakPtrObserver(const std::weak_ptr< ObserverType > &observer)=0

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0