00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/PathDelay.hpp"
00017 #include "torc/generic/om/Event.hpp"
00018 #include "torc/generic/om/Timing.hpp"
00019
00020 namespace torc {
00021
00022 namespace generic {
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 PathDelaySharedPtr
00035 PathDelay::Factory::newPathDelayPtr( const Value::MiNoMax & inDelay,
00036 const std::list< EventSharedPtr > & inEvents,
00037 const TimingSharedPtr & inTiming ) throw(Error) {
00038 try
00039 {
00040 PathDelaySharedPtr newPathDelay;
00041 create( newPathDelay );
00042 newPathDelay->setDelay( inDelay );
00043 newPathDelay->setEvents( inEvents );
00044 if( inTiming )
00045 {
00046 inTiming->addPathDelay( newPathDelay );
00047 }
00048 return newPathDelay;
00049 }
00050 catch( Error &e )
00051 {
00052 e.setCurrentLocation(
00053 __FUNCTION__, __FILE__, __LINE__ );
00054 throw;
00055 }
00056 }
00057
00058 void
00059 PathDelay::setDelay(const Value::MiNoMax & inSource) throw() {
00060 mDelay = inSource;
00061 }
00062
00063
00064
00065
00066
00067
00068 void
00069 PathDelay::setEvents( const std::list< EventSharedPtr > & inEvents ) throw() {
00070 std::list< EventSharedPtr >::const_iterator it = inEvents.begin();
00071 for( ; it != inEvents.end(); it++ )
00072 {
00073 try
00074 {
00075 addEvent( *it );
00076 }
00077 catch( Error &e )
00078 {
00079 e.setCurrentLocation(
00080 __FUNCTION__, __FILE__, __LINE__ );
00081 }
00082 }
00083 }
00084
00085 void
00086 PathDelay::addEvent( const EventSharedPtr & inEvent ) throw(Error) {
00087 if( !inEvent )
00088 {
00089 return;
00090 }
00091 mEvents.push_back( inEvent );
00092 }
00093
00094 PathDelay::PathDelay()
00095 : SelfReferencing<PathDelay>(),
00096 mDelay(),
00097 mEvents() {
00098 }
00099
00100 PathDelay::~PathDelay() throw(){
00101 }
00102
00103 }
00104
00105 }