torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeviceSiteType.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 /// \file
17 /// \brief Header for the DeviceSiteType class.
18 
19 #ifndef TORC_PLACER_DEVICESITETYPE_HPP
20 #define TORC_PLACER_DEVICESITETYPE_HPP
21 
22 #include "DeviceSite.hpp"
23 #include "DeviceSiteTypePin.hpp"
24 #include <vector>
25 
26 namespace torc {
27 namespace placer {
29  {
30  typedef std::vector<DeviceSiteTypePin> DeviceSiteTypePinVector;
31 
32  protected:
36 
37  public:
39  mName = "UNINITIALIZED!";
40  mSiteTypeIndex = -1;
41  }
42  DeviceSiteType(std::string inName, int inSiteTypeIndex) : mName(inName),
43  mSiteTypeIndex(inSiteTypeIndex) {}
45  const std::string& getName() const {
46  return mName;
47  }
48  void setName(std::string inName) {
49  mName = inName;
50  }
52  return mSiteTypeIndex;
53  }
54  void setSiteTypeIndex(int inSiteTypeIndex) {
55  mSiteTypeIndex = inSiteTypeIndex;
56  }
57  //void addPin(std::string inName, int inTileOffset)
58  void addPin(std::string inName, int inRowOffset, int inColOffset) {
59  //PlacerSiteTypePin pin(inName, inTileOffset)
60  DeviceSiteTypePin pin(inName, inRowOffset, inColOffset);
61  mPins.push_back(pin); // this is a nasty thing, copying this around, but probably don't matter, only to initialize the thing
62  }
63  int getNumPins() {
64  return mPins.size();
65  }
67  return mPins[i];
68  }
69  }; //class DeviceSiteType
70 } // namespace placer
71 } // namespace torc
72 #endif // TORC_PLACER_DEVICESITETYPE_HPP
const std::string & getName() const
DeviceSiteTypePin & getPin(int i)
Header for the DeviceSiteTypePin class.
std::vector< DeviceSiteTypePin > DeviceSiteTypePinVector
void setSiteTypeIndex(int inSiteTypeIndex)
std::string string
DeviceSiteTypePinVector mPins
DeviceSiteType(std::string inName, int inSiteTypeIndex)
void setName(std::string inName)
void addPin(std::string inName, int inRowOffset, int inColOffset)