00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Vegard Nossum * 00003 * vegard.nossum@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #pragma once 00022 00030 #include "CommandObject.h" 00031 00035 template<typename T> 00036 class CommandBinding { 00037 public: 00039 CommandBinding(const char* alias, const CommandObject<T>& command); 00040 00042 ~CommandBinding(); 00043 00045 const CommandObject<T>& getCommand() const; 00046 00048 bool fullName() const; 00049 00050 00051 public: 00052 const char* m_alias; 00054 private: 00055 const CommandObject<T>& m_command; 00056 }; 00057 00058 template<typename T> 00059 CommandBinding<T>::CommandBinding(const char* alias, 00060 const CommandObject<T>& command): 00061 m_alias(alias), 00062 m_command(command) 00063 { 00064 } 00065 00066 template<typename T> 00067 CommandBinding<T>::~CommandBinding() 00068 { 00069 } 00070 00071 template<typename T> 00072 const CommandObject<T>& 00073 CommandBinding<T>::getCommand() const 00074 { 00075 return m_command; 00076 } 00077 00078 template<typename T> 00079 bool 00080 CommandBinding<T>::fullName() const 00081 { 00082 return m_command.fullName(); 00083 }