torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConnectionPin.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef TORC_PACKER_CONNECTIONPIN_HPP
17 #define TORC_PACKER_CONNECTIONPIN_HPP
18 
20 #include <boost/smart_ptr.hpp>
21 #include <string>
22 #include <vector>
23 
24 namespace torc {
25 namespace physical {
26 
27  using namespace std;
28  /// \brief Physical design connection-pin pair, suitable for specifying a net endpoint.
29  /// \details This class specifies a pin on a physical design connection.
30 
31  class ConnectionPin {
32  // friends
33  /// \brief The Factory class has direct access to our internals.
34  friend class RcFactory;
35  protected:
37  /// \brief Element Name.
38 
39  string mElementName;
40  /// \brief Name of the pin.
42 
43  /// \brief Construct from connection reference and pin name.
44  ConnectionPin(string inElementName, const string& inPinName)
45  : mElementName(inElementName), mPinName(inPinName) {}
46  public:
47  /// \brief NULL connection pin
49  : mElementName("NULL"), mPinName("NULL") {}
50  /// \brief Returns the element pointer or NULL.
51  const string& getElementName(void) const { return mElementName; }
52  /// \brief Returns the pin name.
53  const PinName& getPinName(void) const { return mPinName; }
54  /// \brief Equality operator.
55  bool operator ==(const ConnectionPin& rhs) const { return mElementName == rhs.mElementName
56  && mPinName == rhs.mPinName; }
57  };
58 
59  /// \brief Vector of connection pins.
60  typedef std::vector<ConnectionPin> ConnectionPinVector;
61 
62 
63 } // namespace physical
64 } // namespace torc
65 
66 #endif // TORC_PACKER_CONNECTIONPIN_HPP
ConnectionPin()
NULL connection pin.
Encapsulation of a site pin name.
RcFactory class for physical netlist elements.
Definition: RcFactory.hpp:34
Physical design connection-pin pair, suitable for specifying a net endpoint.
string mElementName
Element Name.
std::string string
Header for Xilinx physical types.
bool operator==(const location &loc1, const location &loc2)
Compare two location objects.
ConnectionPin(string inElementName, const string &inPinName)
Construct from connection reference and pin name.
const PinName & getPinName(void) const
Returns the pin name.
PinName mPinName
Name of the pin.
const string & getElementName(void) const
Returns the element pointer or NULL.
std::vector< ConnectionPin > ConnectionPinVector
Vector of connection pins.