OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_STATE_MATRIX_H_ | 5 #ifndef MEDIA_BASE_STATE_MATRIX_H_ |
6 #define MEDIA_BASE_STATE_MATRIX_H_ | 6 #define MEDIA_BASE_STATE_MATRIX_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "media/base/media_export.h" |
11 | 12 |
12 namespace media { | 13 namespace media { |
13 | 14 |
14 class StateMatrix { | 15 class MEDIA_EXPORT StateMatrix { |
15 public: | 16 public: |
16 StateMatrix(); | 17 StateMatrix(); |
17 ~StateMatrix(); | 18 ~StateMatrix(); |
18 | 19 |
19 template <typename HandlerType> | 20 template <typename HandlerType> |
20 void AddState(int state, int (HandlerType::* handler)()) { | 21 void AddState(int state, int (HandlerType::* handler)()) { |
21 CHECK(!IsStateDefined(state)); | 22 CHECK(!IsStateDefined(state)); |
22 StateEntryBase* entry = new StateEntry<HandlerType>(handler); | 23 StateEntryBase* entry = new StateEntry<HandlerType>(handler); |
23 states_.insert(std::make_pair(state, entry)); | 24 states_.insert(std::make_pair(state, entry)); |
24 } | 25 } |
(...skipping 27 matching lines...) Expand all Loading... |
52 | 53 |
53 typedef std::map<int, StateEntryBase*> StateMap; | 54 typedef std::map<int, StateEntryBase*> StateMap; |
54 StateMap states_; | 55 StateMap states_; |
55 | 56 |
56 DISALLOW_COPY_AND_ASSIGN(StateMatrix); | 57 DISALLOW_COPY_AND_ASSIGN(StateMatrix); |
57 }; | 58 }; |
58 | 59 |
59 } // namespace media | 60 } // namespace media |
60 | 61 |
61 #endif // MEDIA_BASE_STATE_MATRIX_H_ | 62 #endif // MEDIA_BASE_STATE_MATRIX_H_ |
OLD | NEW |