00001 /* 00002 dmcut2, a library for Monte-Carlo simulations at surfaces 00003 Copyright (C) 2008 Mathias Laurin <mathias_laurin@users.sourceforge.net> 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 2 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 along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 #ifndef REACTION_HPP 00020 #define REACTION_HPP 00021 00022 #include <string> 00023 #include <vector> 00024 #include <ostream> 00025 #include <tr1/memory> 00026 00027 #include "Species.hpp" 00028 #include "EventPtr.hpp" 00029 00030 namespace Surface { class Site; } 00031 00033 namespace Reactions { 00034 00056 class Reaction 00057 // If the parameters are known at compile-time, there can be a run speed 00058 // improvement by using templates, see 00059 // http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.11 00060 // 00061 // Could also use the curiously recurring template pattern 00062 { 00063 00064 public: 00066 typedef std::string Name; 00067 00069 typedef std::vector<EventPtr> EventContainer; 00070 00072 typedef std::vector<Surface::Site*> SitePtrContainer; 00073 00075 virtual ~Reaction() { }; 00076 00080 00081 00083 virtual Name name() const = 0; 00084 00086 00088 virtual void UpdateTime() = 0; 00089 00091 virtual double Time() const = 0; 00092 00094 virtual bool Enabled() const = 0; 00095 00097 virtual void operator()() = 0; 00098 00100 virtual EventContainer GetEvents(const Surface::Site*) const = 0; 00101 00103 virtual SitePtrContainer site_container() const = 0; 00104 }; 00105 00106 } // namespace Reactions 00107 00108 #endif
|
|
Project's page |
Generated on Mon Nov 17 00:23:05 2008 for dmcut2 by 1.5.7
|
