00001 // vim:set et sts=4 ts=4 tw=75 sw=4 ai ci cin cino=g0,t0: 00002 /* 00003 * Copyright (C) 2007, Technical Computer Science Group, 00004 * University of Bonn 00005 * 00006 * This file is part of the ReChannel library. 00007 * 00008 * The ReChannel library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License as 00010 * published by the Free Software Foundation; either version 2 of the 00011 * License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be 00014 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this library; see the file COPYING. If not, write to the 00020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 * 00023 * Authors: Andreas Raabe and Armin Felke. Implementation by Armin Felke. 00024 * {raabe, felke}@cs.uni-bonn.de 00025 */ 00036 #ifndef RC_DELTA_SYNC_OBJECT_H_ 00037 #define RC_DELTA_SYNC_OBJECT_H_ 00038 00039 #include <systemc.h> 00040 #include <boost/function.hpp> 00041 00042 namespace ReChannel { 00043 00054 class rc_delta_sync_object 00055 : protected sc_prim_channel 00056 { 00057 public: 00064 typedef boost::function<void (rc_delta_sync_object&)> 00065 delta_sync_callback_type; 00066 00067 public: 00073 rc_delta_sync_object(); 00074 00081 rc_delta_sync_object( 00082 delta_sync_callback_type callback, bool enabled=false); 00083 00087 virtual void request_update(); 00088 00092 inline bool is_enabled() const 00093 { return p_enabled; } 00094 00098 inline void set_enabled(bool b) 00099 { p_enabled = b; } 00100 00104 void set_callback(delta_sync_callback_type callback); 00105 00106 protected: 00110 virtual void update(); 00111 00112 private: 00116 bool p_enabled; 00120 delta_sync_callback_type p_callback; 00121 00122 private: 00123 // disabled 00125 rc_delta_sync_object(const rc_delta_sync_object& orig); 00127 rc_delta_sync_object& operator=(const rc_delta_sync_object& orig); 00128 }; 00129 00130 } // namespace ReChannel 00131 00132 #endif // RC_DELTA_SYNC_OBJECT_H_ 00133 00134 // 00135 // $Id: rc_delta_sync_object.h,v 1.5 2007/10/24 23:55:23 felke Exp $ 00136 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/util/rc_delta_sync_object.h,v $ 00137 //