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. |
Alex Vakulenko | fedc487 | 2014-08-20 12:38:43 -0700 | [diff] [blame] | 21 | virtual void OnCommandAdded(CommandInstance* command_instance) = 0; |
Alex Vakulenko | 515b42b | 2014-08-07 15:46:31 -0700 | [diff] [blame] | 22 | // Callback invoked by CommandQueue when a new command is removed from |
| 23 | // the queue. |
Alex Vakulenko | fedc487 | 2014-08-20 12:38:43 -0700 | [diff] [blame] | 24 | virtual void OnCommandRemoved(CommandInstance* command_instance) = 0; |
Alex Vakulenko | 515b42b | 2014-08-07 15:46:31 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | } // namespace buffet |
| 28 | |
| 29 | #endif // BUFFET_COMMANDS_COMMAND_DISPATCH_INTERFACE_H_ |