torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Timing.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_TIMING_HPP
17 #define TORC_GENERIC_TIMING_HPP
18 
24 #include "torc/generic/Error.hpp"
28 
29 namespace torc { namespace generic { class BaseVisitor; } }
30 namespace torc { namespace generic { class PathDelay; } }
31 namespace torc { namespace generic { class ForbiddenEvent; } }
32 
33 namespace torc {
34 namespace generic {
35 
36 /**
37  * @brief This class is used to provide a set of path delays or
38  * timing constrains (forbidden events)
39  */
40 class Timing : public Visitable, public SelfReferencing<Timing>, public Commentable,
41  public UserDataContainer {
42  friend class FactoryType<Timing> ;
43 
44 public:
45  /**
46  * Convenience class to visit a Timing.
47  */
49 
50  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
51 
52  /**
53  * Convenience class to create a Timing.
54  */
55  class Factory : public FactoryType<Timing> {
56  public:
58  /**
59  * Create a Timing.
60  *
61  * @param[in] inDerivation Derivation value
62  * @param[in] inPathDelays List of path delays of this timing to be appended to.
63  * @param[in] inForbiddentEvents List of forbidden events to be appended to
64  * @param[in] inView Pointer to parented (view) object.
65  * @param[in] inInterfaceAttributes Pointer to
66  * parented (InterfaceAttributes) object [optional].
67  * If mentioned then this will decompile within (contents ...) construct.
68  * @param[in] inInstance Pointer to parented object(Instance) [optional].
69  * If mentioned then this will decompile within (instance ...) construct.
70  *
71  * @return Pointer to created Timing.
72  */
73  virtual TimingSharedPtr newTimingPtr(const Derivation& inDerivation,
74  const std::list<PathDelaySharedPtr>& inPathDelays,
75  const std::list<ForbiddenEventSharedPtr>& inForbiddentEvents,
76  const ViewSharedPtr& inView, const InterfaceAttributesSharedPtr& inInterfaceAttributes =
77  InterfaceAttributesSharedPtr(), const InstanceSharedPtr& inInstance =
78  InstanceSharedPtr()) throw (Error);
79  };
80 
81  /**
82  * Get derivation
83  *
84  * @return Derivation value
85  */
86  inline const Derivation getDerivation() const;
87 
88  /**
89  * Set derivation
90  *
91  * @param[in] value Derivation value
92  */
93  void setDerivation(const Derivation& value);
94 
95  /**
96  * Get all the path delays of this timing.
97  *
98  * @param[out] outPathDelays List of path delays of this timing to be appended to
99  */
100  inline void getPathDelays(std::list<PathDelaySharedPtr>& outPathDelays) const;
101 
102  /**
103  * Set all the path delays of this timing.
104  *
105  * @param[in] inPathDelays List of path delays of this timing to be appended to
106  */
107  void setPathDelays(const std::list<PathDelaySharedPtr>& inPathDelays);
108 
109  /**
110  * Add a path delay to the list of path delays.
111  *
112  * @param[in] inSource Pointer to path delay to be appended to
113  */
114  void addPathDelay(const PathDelaySharedPtr& inSource);
115 
116  /**
117  * Get all the forbidden events of this timing.
118  *
119  * @param[out] outForbiddentEvents List of events to be appended to
120  */
121  inline void getForbiddentEvents(std::list<ForbiddenEventSharedPtr>& outForbiddentEvents) const;
122 
123  /**
124  * Set all the forbidden events of this timing.
125  *
126  * @param[in] inForbiddentEvents List of events to be appended to
127  */
128  void setForbiddentEvents(const std::list<ForbiddenEventSharedPtr>& inForbiddentEvents);
129 
130  /**
131  * Add a forbidden event of the list of forbidden events.
132  *
133  * @param[in] inSource Pointer to forbidden event to be appended to
134  */
135  void addForbiddenEvent(const ForbiddenEventSharedPtr& inSource);
136 
137  ~Timing() throw ();
138 
139 protected:
140  Timing();
141 
142 private:
143  Timing(const Timing& source);
144 
145  Timing& operator=(const Timing& source);
146 
150 
151 };
152 
153 /**
154  * Get derivation
155  *
156  * @return Derivation value
157  */
158 inline const Derivation Timing::getDerivation() const {
159  return mDerivation;
160 }
161 
162 /**
163  * Get all the path delays of this timing.
164  *
165  * @param[out] outPathDelays List of path delays of this timing to be appended to
166  */
167 inline void Timing::getPathDelays(std::list<PathDelaySharedPtr>& outPathDelays) const {
168  outPathDelays.insert(outPathDelays.end(), mPathDelays.begin(), mPathDelays.end());
169 }
170 
171 /**
172  * Get all the forbidden events of this timing.
173  *
174  * @param[out] outForbiddentEvents List of events to be appended to
175  */
176 inline void Timing::getForbiddentEvents(std::list<ForbiddenEventSharedPtr>& outForbiddentEvents)
177  const {
178  outForbiddentEvents.insert(outForbiddentEvents.end(), mForbiddentEvents.begin(),
179  mForbiddentEvents.end());
180 }
181 
182 } // namespace generic
183 } // namespace torc
184 
185 #endif // TORC_GENERIC_TIMING_HPP
std::list< ForbiddenEventSharedPtr > mForbiddentEvents
Definition: Timing.hpp:149
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
const Derivation getDerivation() const
Definition: Timing.hpp:158
boost::shared_ptr< Instance > InstanceSharedPtr
virtual TimingSharedPtr newTimingPtr(const Derivation &inDerivation, const std::list< PathDelaySharedPtr > &inPathDelays, const std::list< ForbiddenEventSharedPtr > &inForbiddentEvents, const ViewSharedPtr &inView, const InterfaceAttributesSharedPtr &inInterfaceAttributes=InterfaceAttributesSharedPtr(), const InstanceSharedPtr &inInstance=InstanceSharedPtr())
Definition: Timing.cpp:41
void setForbiddentEvents(const std::list< ForbiddenEventSharedPtr > &inForbiddentEvents)
Definition: Timing.cpp:107
Represents all classes that can hold user comments.
Definition: Commentable.hpp:36
Represents class that can hold userData.
void setPathDelays(const std::list< PathDelaySharedPtr > &inPathDelays)
Definition: Timing.cpp:90
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void addPathDelay(const PathDelaySharedPtr &inSource)
Definition: Timing.cpp:124
A base class for Visitor.
Definition: VisitorType.hpp:31
This class is used to provide a set of path delays or timing constrains (forbidden events) ...
Definition: Timing.hpp:40
void getPathDelays(std::list< PathDelaySharedPtr > &outPathDelays) const
Definition: Timing.hpp:167
boost::shared_ptr< ForbiddenEvent > ForbiddenEventSharedPtr
VisitorType< Timing > Visitor
Definition: Timing.hpp:48
void setDerivation(const Derivation &value)
Definition: Timing.cpp:81
boost::shared_ptr< InterfaceAttributes > InterfaceAttributesSharedPtr
Derivation mDerivation
Definition: Timing.hpp:147
std::list< PathDelaySharedPtr > mPathDelays
Definition: Timing.hpp:148
void addForbiddenEvent(const ForbiddenEventSharedPtr &inSource)
Definition: Timing.cpp:138
virtual void accept(BaseVisitor &inoutVisitor)
Definition: Timing.cpp:67
void getForbiddentEvents(std::list< ForbiddenEventSharedPtr > &outForbiddentEvents) const
Definition: Timing.hpp:176
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< PathDelay > PathDelaySharedPtr
boost::shared_ptr< Timing > TimingSharedPtr
A placeholder for a factory method.
Definition: FactoryType.hpp:35
An object that receives an inoutVisitor.
Definition: Visitable.hpp:38