torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RcFactory.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 RcFactory class.
18 
19 #ifndef TORC_PACKER_RCFACTORY_HPP
20 #define TORC_PACKER_RCFACTORY_HPP
21 
22 #include "torc/physical/Design.hpp"
26 #include <string>
27 #include <boost/smart_ptr.hpp>
28 
29 namespace torc {
30 namespace physical {
31 
32  /// \brief RcFactory class for physical netlist elements.
33  /// \details Physical netlist elements must be created by this RcFactory.
34  class RcFactory {
35  protected:
36  // friends
37  /// \brief Imported type name.
39  public:
40  // functions
41  /// \brief Create and return a new PrimitiveSet object.
42  static PrimitiveSetSharedPtr newPrimitiveSetPtr(const string& inName) {
43  PrimitiveSetSharedPtr PrimitiveSetPtr(new PrimitiveSet(inName));
44  PrimitiveSetPtr->setSelfWeakPtr(PrimitiveSetPtr);
45  return PrimitiveSetPtr;
46  }
47 
48  /// \brief Create and return a new Element object.
49  static ElementSharedPtr newElementPtr(const string& inName) {
50  ElementSharedPtr elementPtr(new Element(inName));
51  elementPtr->setSelfWeakPtr(elementPtr);
52  return elementPtr;
53  }
54 
55  /// \brief Create and return a new RoutingNet object.
57  RoutingNetSharedPtr routingNetPtr(new RoutingNet(snet));
58  return routingNetPtr;
59  }
60 
61  /// \brief Create and return a new CombinationalPath object.
63  CombinationalPathSharedPtr combinationalPathPtr(new CombinationalPath());
64  return combinationalPathPtr;
65  }
66 
67  /// \brief Create and return a new Element object.
68  static PrimitiveSharedPtr newPrimitivePtr(const string& inName) {
69  PrimitiveSharedPtr primitivePtr(new Primitive(inName));
70  primitivePtr->setSelfWeakPtr(primitivePtr);
71  return primitivePtr;
72  }
73 
74  /// \brief Construct an ConnectionPin and return a constant reference.
75  /// \param inConnectionPtr The pin instance pointer.
76  /// \param inPinName The pin name.
77  static ConnectionPin newConnectionPin(string inElementName,
78  const string& inPinName) {
79  return ConnectionPin(inElementName, inPinName);
80  }
81 
82  /// \brief Create and return a new Element object.
83  static ConnectionSharedPtr newConnectionPtr(const string& inName) {
84  ConnectionSharedPtr connectionPtr(new Connection(inName));
85  return connectionPtr;
86  }
87 
88  /// \brief Create and return a new PrimitivePin shared pointer.
89  /// \param inName The PrimitivePin name.
90  /// \param inInstancePtr The PrimitivePin instance pointer.
91  /// \param inPinName The PrimitivePin pin name.
92  static PrimitivePinSharedPtr newPrimitivePinPtr(string inElementName, string inPinName, const PinType inType) {
93  PrimitivePinSharedPtr PrimitivePinPtr(new PrimitivePin(inElementName, inPinName, inType));
94  return PrimitivePinPtr;
95  }
96 
97  };
98 
99 } // namespace physical
100 } // namespace torc
101 
102 #endif // TORC_PACKER_RCFACTORY_HPP
static PrimitiveSetSharedPtr newPrimitiveSetPtr(const string &inName)
Create and return a new PrimitiveSet object.
Definition: RcFactory.hpp:42
Hierarchical componenet.
Definition: Connection.hpp:29
boost::shared_ptr< Primitive > PrimitiveSharedPtr
Shared pointer encapsulation of a Primitive.
Definition: Primitive.hpp:171
boost::shared_ptr< Element > ElementSharedPtr
Shared pointer encapsulation of a element.
Definition: Element.hpp:119
Header for the RoutingNet class.
RcFactory class for physical netlist elements.
Definition: RcFactory.hpp:34
Physical design connection-pin pair, suitable for specifying a net endpoint.
boost::shared_ptr< PrimitiveSet > PrimitiveSetSharedPtr
Shared pointer encapsulation of a PrimitiveSet.
std::string string
static ElementSharedPtr newElementPtr(const string &inName)
Create and return a new Element object.
Definition: RcFactory.hpp:49
Header for the Design class.
static ConnectionPin newConnectionPin(string inElementName, const string &inPinName)
Construct an ConnectionPin and return a constant reference.
Definition: RcFactory.hpp:77
boost::shared_ptr< Net > NetSharedPtr
Shared pointer encapsulation of a Net.
std::string string
Imported type name.
Definition: RcFactory.hpp:38
boost::shared_ptr< Connection > ConnectionSharedPtr
Shared pointer encapsulation of a componenet.
Definition: Connection.hpp:82
static ConnectionSharedPtr newConnectionPtr(const string &inName)
Create and return a new Element object.
Definition: RcFactory.hpp:83
static RoutingNetSharedPtr newRoutingNePtr(NetSharedPtr snet)
Create and return a new RoutingNet object.
Definition: RcFactory.hpp:56
Element composed of connections and pins.
Definition: Element.hpp:41
Physical design primitive-pin.
boost::shared_ptr< PrimitivePin > PrimitivePinSharedPtr
Shared pointer encapsulation of a componenet.
boost::shared_ptr< RoutingNet > RoutingNetSharedPtr
Shared pointer encapsulation of a RoutingNet.
Definition: RoutingNet.hpp:131
static CombinationalPathSharedPtr newCombinationalPathPtr()
Create and return a new CombinationalPath object.
Definition: RcFactory.hpp:62
boost::shared_ptr< CombinationalPath > CombinationalPathSharedPtr
Shared pointer encapsulation of a CombinationalPath.
static PrimitivePinSharedPtr newPrimitivePinPtr(string inElementName, string inPinName, const PinType inType)
Create and return a new PrimitivePin shared pointer.
Definition: RcFactory.hpp:92
static PrimitiveSharedPtr newPrimitivePtr(const string &inName)
Create and return a new Element object.
Definition: RcFactory.hpp:68
Header for the PrimitiveSet class.
Header for the CombinationalPath class.