torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortListAlias.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_PORTLISTALIAS_HPP
17 #define TORC_GENERIC_PORTLISTALIAS_HPP
18 
24 
25 namespace torc { namespace generic { class PortList; } }
26 
27 namespace torc {
28 namespace generic {
29 
30 /**
31  * @brief Represents an ordered list of port references with a name aliased.
32  *
33  * The PortList class represents an ordered list of port references.
34  * Such objects in EDIF are declard using the (portList portRefName1 portRefName2 ... ) syntax.
35  */
36 
37 class PortListAlias : public Nameable, public SelfReferencing<PortListAlias> {
38 
39  friend class FactoryType<PortListAlias> ;
40 
41 public:
42 
43  /**
44  * Convenience class to visit a port list alias.
45  */
47 
48  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
49 
50  /**
51  * Convenience class to create a port list alias.
52  */
53  class Factory : public FactoryType<PortListAlias> {
54  public:
56  /**
57  * Create a port list alias
58  *
59  * @param[in] inName Name of the port list alias to be created.
60  * @param[in] inPortList Pointer to port list object.
61  * @param[in] inSimulate Pointer to parented (Simulate) object [optional].
62  * If not mentioned PortListAlias will not be added to simulate.
63  *
64  * @return Pointer to created port list alias.
65  **/
67  const PortListSharedPtr& inPortList, const SimulateSharedPtr& inSimulate =
68  SimulateSharedPtr()) throw (Error);
69  };
70 
71  /**
72  * Get the portList accociated with this PortListAlias.
73  *
74  * @return Pointer to PortList
75  */
76  inline const PortListSharedPtr getPortList() const;
77 
78  /**
79  * Set the portList accociated with this PortListAlias.
80  *
81  * @param[in] inPortList Pointer to PortList
82  */
83  void setPortList(const PortListSharedPtr& inPortList);
84 
85  ~PortListAlias() throw ();
86 
87 protected:
88  PortListAlias();
89 
90 private:
92 };
93 
94 inline const PortListSharedPtr PortListAlias::getPortList() const {
95  return mPortList;
96 }
97 
98 } // namespace generic
99 } // namespace torc
100 
101 #endif // TORC_GENERIC_PORTLISTALIAS_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
const PortListSharedPtr getPortList() const
virtual void accept(BaseVisitor &inoutVisitor)
boost::shared_ptr< Simulate > SimulateSharedPtr
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
A base class for Visitor.
Definition: VisitorType.hpp:31
virtual PortListAliasSharedPtr newPortListAliasPtr(const std::string &inName, const PortListSharedPtr &inPortList, const SimulateSharedPtr &inSimulate=SimulateSharedPtr())
boost::shared_ptr< PortList > PortListSharedPtr
Represents an ordered list of port references with a name aliased.
An object that has a name.
Definition: Nameable.hpp:34
boost::shared_ptr< PortListAlias > PortListAliasSharedPtr
VisitorType< PortListAlias > Visitor
A placeholder for a factory method.
Definition: FactoryType.hpp:35
void setPortList(const PortListSharedPtr &inPortList)