00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/packer/ConnectionPin.hpp $ 00003 // $Id: ConnectionPin.hpp 10 2011-10-12 18:40:16Z 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 #ifndef TORC_PACKER_CONNECTIONPIN_HPP 00017 #define TORC_PACKER_CONNECTIONPIN_HPP 00018 00019 #include "torc/physical/XilinxPhysicalTypes.hpp" 00020 #include <boost/smart_ptr.hpp> 00021 #include <string> 00022 #include <vector> 00023 00024 namespace torc { 00025 namespace physical { 00026 00027 using namespace std; 00028 /// \brief Physical design connection-pin pair, suitable for specifying a net endpoint. 00029 /// \details This class specifies a pin on a physical design connection. 00030 00031 class ConnectionPin { 00032 // friends 00033 /// \brief The Factory class has direct access to our internals. 00034 friend class RcFactory; 00035 protected: 00036 typedef std::string string; 00037 /// \brief Element Name. 00038 00039 string mElementName; 00040 /// \brief Name of the pin. 00041 PinName mPinName; 00042 00043 /// \brief Construct from connection reference and pin name. 00044 ConnectionPin(string inElementName, const string& inPinName) 00045 : mElementName(inElementName), mPinName(inPinName) {} 00046 public: 00047 /// \brief NULL connection pin 00048 ConnectionPin() 00049 : mElementName("NULL"), mPinName("NULL") {} 00050 /// \brief Returns the element pointer or NULL. 00051 const string& getElementName(void) const { return mElementName; } 00052 /// \brief Returns the pin name. 00053 const PinName& getPinName(void) const { return mPinName; } 00054 /// \brief Equality operator. 00055 bool operator ==(const ConnectionPin& rhs) const { return mElementName == rhs.mElementName 00056 && mPinName == rhs.mPinName; } 00057 }; 00058 00059 /// \brief Vector of connection pins. 00060 typedef std::vector<ConnectionPin> ConnectionPinVector; 00061 00062 00063 } // namespace physical 00064 } // namespace torc 00065 00066 #endif // TORC_PACKER_CONNECTIONPIN_HPP