torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PathDelay.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_PATHDELAY_HPP
17 #define TORC_GENERIC_PATHDELAY_HPP
18 
20 #include "torc/generic/Value.hpp"
23 
24 #include <list>
25 
26 namespace torc { namespace generic { class Event; } }
27 
28 namespace torc {
29 namespace generic {
30 
31 /**
32  *
33  * @brief This class associates a delay with a specified chain of events.
34  * Delay contains the time from first event to final event.
35  */
36 class PathDelay : public SelfReferencing<PathDelay> {
37  friend class FactoryType<PathDelay> ;
38 
39 public:
40  /**
41  * Convenience class to create a PathDelay.
42  */
43  class Factory : public FactoryType<PathDelay> {
44  public:
46  /**
47  * Create a PathDelay.
48  *
49  * @param[in] inDelay Value::MiNoMax Delay value.
50  * @param[in] inEvents List of events to be appended to
51  * @param[in] inTiming Pointer to parented object (Timing) [optional].
52  * If not mentioned PathDelay will not be added to timing.
53  *
54  * @return Pointer to created PathDelay.
55  */
56  PathDelaySharedPtr virtual newPathDelayPtr(const Value::MiNoMax& inDelay,
57  const std::list<EventSharedPtr>& inEvents,
58  const TimingSharedPtr& inTiming = TimingSharedPtr()) throw (Error);
59  };
60 
61  /**
62  * Get delay
63  *
64  * @return MiNoMax value
65  */
66  inline const Value::MiNoMax getDelay() const;
67 
68  /**
69  * Set delay
70  *
71  * @param[in] inSource Delay value.
72  */
73  void setDelay(const Value::MiNoMax& inSource);
74 
75  /**
76  * Get the list of events associated with this path delay.
77  *
78  * @return outEvents List of events associated with this path delay
79  */
80  inline void getEvents(std::list<EventSharedPtr>& outEvents) const;
81 
82  /**
83  * Set all the events of this forbiddenEvent.
84  *
85  * @param[in] inEvents List of events to be appended to
86  */
87  void setEvents(const std::list<EventSharedPtr>& inEvents);
88 
89  /**
90  * Add an event to the list of events. Empty pointer is ignored.
91  *
92  * @param[in] inEvent Pointer to event to be added.
93  */
94  void addEvent(const EventSharedPtr& inEvent) throw (Error);
95 
96  PathDelay();
97 
98  ~PathDelay() throw ();
99 
100 private:
101  PathDelay(const PathDelay& inSource);
102 
103  PathDelay& operator =(const PathDelay& inSource);
104 
105  Value::MiNoMax mDelay;
107 
108 };
109 
110 inline const Value::MiNoMax PathDelay::getDelay() const {
111  return mDelay;
112 }
113 
114 inline void PathDelay::getEvents(std::list<EventSharedPtr>& outEvents) const {
115  outEvents.insert(outEvents.end(), mEvents.begin(), mEvents.end());
116 }
117 
118 } // namespace generic
119 } // namespace torc
120 #endif // TORC_GENERIC_PATHDELAY_HPP
std::list< EventSharedPtr > mEvents
Definition: PathDelay.hpp:106
void setDelay(const Value::MiNoMax &inSource)
Definition: PathDelay.cpp:50
const Value::MiNoMax getDelay() const
Definition: PathDelay.hpp:110
Value::MiNoMax mDelay
Definition: PathDelay.hpp:105
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
This class associates a delay with a specified chain of events. Delay contains the time from first ev...
Definition: PathDelay.hpp:36
boost::shared_ptr< Event > EventSharedPtr
void setEvents(const std::list< EventSharedPtr > &inEvents)
Definition: PathDelay.cpp:59
void getEvents(std::list< EventSharedPtr > &outEvents) const
Definition: PathDelay.hpp:114
virtual PathDelaySharedPtr newPathDelayPtr(const Value::MiNoMax &inDelay, const std::list< EventSharedPtr > &inEvents, const TimingSharedPtr &inTiming=TimingSharedPtr())
Definition: PathDelay.cpp:33
boost::shared_ptr< PathDelay > PathDelaySharedPtr
boost::shared_ptr< Timing > TimingSharedPtr
void addEvent(const EventSharedPtr &inEvent)
Definition: PathDelay.cpp:70
A placeholder for a factory method.
Definition: FactoryType.hpp:35