1 #pragma once 2 // Description: 3 // Callback manager. 4 // 5 // Copyright (C) 2001 Frank Becker 6 // 7 // This program is free software; you can redistribute it and/or modify it under 8 // the terms of the GNU General Public License as published by the Free Software 9 // Foundation; either version 2 of the License, or (at your option) any later 10 // version. 11 // 12 // This program is distributed in the hope that it will be useful, but WITHOUT 13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details 15 // 16 17 #include <string> 18 19 #include "hashMap.hpp" 20 #include "HashString.hpp" 21 22 class Callback; 23 24 class CallbackManager 25 { 26 public: 27 CallbackManager( void); 28 ~CallbackManager(); 29 void init( void); 30 31 Callback *getCallback( std::string actionString); 32 void addCallback( Callback *cb); 33 34 private: 35 CallbackManager( const CallbackManager&); 36 CallbackManager &operator=(const CallbackManager&); 37 38 hash_map< std::string, Callback*, hash<std::string>, std::equal_to<std::string> > _actionMap; 39 }; 40