torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
generic/Design.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_GENERIC_DESIGN_HPP
17 #define TORC_GENERIC_DESIGN_HPP
18 
24 #include "torc/generic/Root.hpp"
26 #include "torc/generic/SymTab.hpp"
29 #include "torc/generic/Error.hpp"
33 
34 namespace torc { namespace generic { class BaseVisitor; } }
35 
36 namespace torc {
37 namespace generic {
38 
39 /**
40  * The Design class identifies the Cell at the top level of the
41  * hierarchy of a particular design within a library.
42  */
43 
44 class Design : public Nameable, public Commentable, public PropertyContainer, public Renamable,
45  public Visitable, public ParentedObject<Root>, public SelfReferencing<Design>,
46  public UserDataContainer, public StatusContainer {
47 
48  friend class FactoryType<Design> ;
49 
50 public:
51  /**
52  * Convenience typedef for visiting a design
53  */
55 
56  /**
57  * Convenience class for creating a design
58  */
59 
60  class Factory : public FactoryType<Design> {
61  public:
63  /**
64  * Create a design
65  *
66  * @param[in] inName Name of the design to be created.
67  * @param[in] inRootPtr Pointer to parented(Root) object.
68  * @param[in] inCellRefName The top level cell ref name for this design.
69  * @param[in] inLibraryRefName The top level Library ref name for this design.
70  * @param[in] inOriginalName Original name of the design [optional].
71  *
72  * @return Pointer to created design.
73  **/
74  virtual DesignSharedPtr newDesignPtr(const std::string& inName,
75  const RootSharedPtr& inRootPtr, const std::string& inCellRefName,
76  const std::string& inLibraryRefName, const std::string& inOriginalName = std::string())
77  throw (Error);
78  };
79 
80  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
81 
82  /**
83  * Get the top cell ref name for this Design.
84  *
85  * @return The top cell ref name for this Design.
86  */
87  inline const std::string getCellRefName() const;
88 
89  /**
90  * Set the top cell ref name for this Design.
91  *
92  * @param[in] inCellRefName The top level cell ref name for this design.
93  */
94  void setCellRefName(const std::string& inCellRefName);
95 
96  /**
97  * Get the top Library ref name for this Design.
98  *
99  * @return The top Library ref name for this Design.
100  */
101  inline const std::string getLibraryRefName() const;
102 
103  /**
104  * Set the top Library ref name for this Design.
105  *
106  * @param[in] inLibraryRefName The top level Library ref name for this design.
107  */
108  void setLibraryRefName(const std::string& inLibraryRefName);
109 
110  virtual ~ Design() throw ();
111 
112 protected:
113  Design();
114  Design(const std::string& inCellRefName, const std::string& inLibraryRefName);
115 
116 private:
117  Design(const Design& inSource);
118  Design& operator=(const Design& inSource);
119 
120 private:
121  std::string mCellRefName;
122  std::string mLibraryRefName;
123 };
124 
125 /**
126  * Get the top cell ref name for this Design.
127  *
128  * @return The top cell ref name for this Design.
129  */
130 inline const std::string Design::getCellRefName() const {
131  return mCellRefName;
132 }
133 
134 /**
135  * Get the top Library ref name for this Design.
136  *
137  * @return The top Library ref name for this Design.
138  */
140  return mLibraryRefName;
141 }
142 
143 } // namespace generic
144 } // namespace torc
145 #endif // TORC_GENERIC_DESIGN_HPP
void setCellRefName(const std::string &inCellRefName)
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
An object that has a parent.
void setLibraryRefName(const std::string &inLibraryRefName)
Represents objects that have properties.
const std::string getCellRefName() const
Represents all classes that can hold user comments.
Definition: Commentable.hpp:36
virtual DesignSharedPtr newDesignPtr(const std::string &inName, const RootSharedPtr &inRootPtr, const std::string &inCellRefName, const std::string &inLibraryRefName, const std::string &inOriginalName=std::string())
Represents class that can hold userData.
std::string string
boost::shared_ptr< Design > DesignSharedPtr
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
A base class for Visitor.
Definition: VisitorType.hpp:31
const std::string getLibraryRefName() const
VisitorType< Design > Visitor
virtual void accept(BaseVisitor &inoutVisitor)
An object that has a name.
Definition: Nameable.hpp:34
Represents objects that can be renamed.
Represents objects that have status.
A placeholder for a factory method.
Definition: FactoryType.hpp:35
boost::shared_ptr< Root > RootSharedPtr
An object that receives an inoutVisitor.
Definition: Visitable.hpp:38