00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/physical/Routethrough.hpp $ 00003 // $Id: Routethrough.hpp 380 2011-02-23 04:05:26Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Header for the Routethrough class. 00018 00019 #ifndef TORC_PHYSICAL_ROUTETHROUGH_HPP 00020 #define TORC_PHYSICAL_ROUTETHROUGH_HPP 00021 00022 #include "torc/physical/Config.hpp" 00023 #include "torc/physical/Instance.hpp" 00024 #include <string> 00025 00026 namespace torc { 00027 namespace physical { 00028 00029 /// \brief Pip routethrough. 00030 /// \details A routethrough defines how a signal passes through logic resources on its way to 00031 /// wiring resources. 00032 class Routethrough : public Config { 00033 protected: 00034 // types 00035 /// \brief Imported type name. 00036 typedef std::string string; 00037 // members 00038 /// \brief The _ROUTETHROUGH setting in the associated instance. 00039 string mSetting; 00040 /// \brief The instance in which the routethrough is implemented. 00041 InstanceWeakPtr mInstancePtr; 00042 /// \brief The routethrough instance source wire. 00043 WireName mSourceWireName; 00044 /// \brief The routethrough instance sink wire. 00045 WireName mSinkWireName; 00046 public: 00047 // constructors 00048 /// \brief Public constructor. 00049 /// \param inSetting The _ROUTETHROUGH setting in the associated instance. 00050 /// \param inName The _ROUTETHROUGH name in the associated instance. 00051 /// \param inValue The _ROUTETHROUGH value in the associated instance. 00052 /// \param inInstancePtr The instance weak pointer. 00053 /// \param inSourceWireName The instance source wire name. 00054 /// \param inSinkWireName The instance sink wire name. 00055 Routethrough(const string& inSetting, const string& inName, const string& inValue, 00056 const InstanceWeakPtr& inInstancePtr, const string& inSourceWireName, 00057 const string& inSinkWireName) 00058 : Config(inName, inValue), mSetting(inSetting), mInstancePtr(inInstancePtr), 00059 mSourceWireName(inSourceWireName), mSinkWireName(inSinkWireName) {} 00060 // accessors 00061 /// \brief Returns the _ROUTETHROUGH setting. 00062 const string& getSetting(void) const { return mSetting; } 00063 /// \brief Returns the instance weak pointer. 00064 const InstanceWeakPtr& getInstancePtr(void) const { return mInstancePtr; } 00065 /// \brief Returns the instance source wire name. 00066 const WireName& getSourceWireName(void) const { return mSourceWireName; } 00067 /// \brief Returns the instance sink wire name. 00068 const WireName& getSinkWireName(void) const { return mSinkWireName; } 00069 }; 00070 00071 /// \brief Shared pointer encapsulation of a Routethrough. 00072 typedef boost::shared_ptr<Routethrough> RoutethroughSharedPtr; 00073 00074 /// \brief Weak pointer encapsulation of a Routethrough. 00075 typedef boost::weak_ptr<Routethrough> RoutethroughWeakPtr; 00076 00077 } // namespace physical 00078 } // namespace torc 00079 00080 #endif // TORC_PHYSICAL_ROUTETHROUGH_HPP