rc_switch.h

Go to the documentation of this file.
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  */
00037 #ifndef RC_SWITCH_H_
00038 #define RC_SWITCH_H_
00039 
00040 #include "ReChannel/core/rc_common_header.h"
00041 #include "ReChannel/util/rc_object_handle.h"
00042 
00043 namespace ReChannel {
00044 
00045 class rc_reconfigurable;
00046 class rc_switch_connector_base;
00047 class rc_interface_filter;
00048 
00127 class rc_switch
00128 {
00132     friend class rc_reconfigurable;
00136     friend class rc_switch_connector_base;
00137 
00138 public:
00139 
00143     enum state_type { UNDEF=0, OPEN, CLOSED };
00144 
00148     enum { STATE_COUNT=3 };
00149 
00155     typedef std::vector<rc_interface_filter*> filter_chain;
00156 
00157 public:
00158 
00162     virtual std::string get_switch_kind() const = 0;
00163 
00167     virtual std::string get_switch_name() const = 0;
00168 
00173     virtual state_type get_switch_state() const = 0;
00174 
00178     virtual unsigned int get_transaction_count() const = 0;
00179 
00187     virtual sc_interface* get_static_interface() const = 0;
00188 
00197     virtual sc_interface* get_dynamic_interface() const = 0;
00198 
00203     virtual rc_reconfigurable* get_current_reconfigurable() const = 0;
00204 
00210     virtual bool is_locked() const = 0;
00211 
00215     virtual bool is_registered(const rc_reconfigurable& reconf) const = 0;
00216 
00220     virtual bool is_registered(const sc_interface& dyn_if) const = 0;
00221 
00222 protected:
00223 
00229     virtual void bind_static_object(
00230         const rc_object_handle& obj_to_bind) = 0;
00231 
00237     virtual void bind_dynamic_object(
00238         const rc_object_handle& obj_to_bind) = 0;
00239 
00246     virtual void open() = 0;
00247 
00259     virtual void open(
00260         rc_reconfigurable& reconf,
00261         const filter_chain& filters = filter_chain()) = 0;
00262 
00268     virtual void close() = 0;
00269 
00273     virtual void set_undefined() = 0;
00274 
00278     virtual void refresh_notify() = 0;
00279 
00285     virtual void register_reconfigurable(
00286         rc_reconfigurable& reconf, sc_interface& dyn_if) = 0;
00287 
00294     virtual void unregister_reconfigurable(
00295         rc_reconfigurable& reconf) = 0;
00296 
00304     virtual sc_interface* get_registered_interface(
00305         rc_reconfigurable& reconf) const = 0;
00306 
00312     virtual bool is_lock_owner(const rc_reconfigurable& reconf) const = 0;
00313 
00319     virtual bool set_locked(rc_reconfigurable& lock_owner, bool lock) = 0;
00320 
00324     virtual ~rc_switch() {}
00325 };
00326 
00327 }
00328 
00329 #endif //RC_SWITCH_H_
00330 
00331 //
00332 // $Id: rc_switch.h,v 1.14 2007/12/20 20:40:53 felke Exp $
00333 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/core/rc_switch.h,v $
00334 //

Generated on Tue Jan 1 23:14:06 2008 for ReChannel by  doxygen 1.5.3