Alex Vakulenko | 515b42b | 2014-08-07 15:46:31 -0700 | [diff] [blame] | 1 | // Copyright 2014 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BUFFET_COMMANDS_COMMAND_DISPATCH_INTERFACE_H_ |
| 6 | #define BUFFET_COMMANDS_COMMAND_DISPATCH_INTERFACE_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace buffet { |
| 11 | |
| 12 | class CommandInstance; |
| 13 | |
| 14 | // This is an abstract base interface that a command dispatcher will implement. |
| 15 | // It allows to abstract out the actual transport layer, such as D-Bus, from |
| 16 | // the rest of command registration and delivery subsystems. |
| 17 | class CommandDispachInterface { |
| 18 | public: |
| 19 | virtual ~CommandDispachInterface() = default; |
| 20 | // Callback invoked by CommandQueue when a new command is added to the queue. |
| 21 | virtual void OnCommandAdded(const std::string& command_id, |
| 22 | const CommandInstance* command_instance) = 0; |
| 23 | // Callback invoked by CommandQueue when a new command is removed from |
| 24 | // the queue. |
| 25 | virtual void OnCommandRemoved(const std::string& command_id, |
| 26 | const CommandInstance* command_instance) = 0; |
| 27 | }; |
| 28 | |
| 29 | } // namespace buffet |
| 30 | |
| 31 | #endif // BUFFET_COMMANDS_COMMAND_DISPATCH_INTERFACE_H_ |