00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/ForbiddenEvent.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
00035
00036
00037 ForbiddenEventSharedPtr
00038 ForbiddenEvent::Factory::newForbiddenEventPtr(
00039 const EventSharedPtr & inStartTimeInterval,
00040 const EventSharedPtr & inEndTimeInterval,
00041 const std::list< EventSharedPtr > & inEvents,
00042 const TimingSharedPtr & inTiming,
00043 const Value & inDuration ) throw(Error) {
00044 try
00045 {
00046 ForbiddenEventSharedPtr newForbiddenEvent;
00047 create( newForbiddenEvent );
00048 newForbiddenEvent->setStartTimeInterval( inStartTimeInterval );
00049 newForbiddenEvent->setEndTimeInterval( inEndTimeInterval );
00050 newForbiddenEvent->setEvents( inEvents );
00051 if( inDuration.getIsSet() )
00052 {
00053 newForbiddenEvent->setDuration( inDuration );
00054 }
00055 if( inTiming )
00056 {
00057 inTiming->addForbiddenEvent( newForbiddenEvent );
00058 }
00059 return newForbiddenEvent;
00060 }
00061 catch( Error &e )
00062 {
00063 e.setCurrentLocation(
00064 __FUNCTION__, __FILE__, __LINE__ );
00065 throw;
00066 }
00067 }
00068
00069 void
00070 ForbiddenEvent::accept(BaseVisitor & inoutVisitor) throw(Error) {
00071 try
00072 {
00073 runVisitor( *this, inoutVisitor );
00074 }
00075 catch( Error &e )
00076 {
00077 e.setCurrentLocation(
00078 __FUNCTION__, __FILE__, __LINE__ );
00079 throw;
00080 }
00081 }
00082
00083
00084
00085
00086
00087 void
00088 ForbiddenEvent::setStartTimeInterval(const EventSharedPtr & inSource) throw() {
00089 mStartTimeInterval = inSource;
00090 }
00091
00092
00093
00094
00095
00096 void
00097 ForbiddenEvent::setEndTimeInterval(const EventSharedPtr & inSource) throw() {
00098 mEndTimeInterval = inSource;
00099 }
00100
00101
00102
00103
00104
00105 void
00106 ForbiddenEvent::setDuration(const Value & inValue) throw() {
00107 mDuration = inValue;
00108 }
00109
00110
00111
00112
00113
00114
00115 void
00116 ForbiddenEvent::setEvents( const std::list< EventSharedPtr > & inEvents ) throw() {
00117 std::list< EventSharedPtr >::const_iterator it = inEvents.begin();
00118 for( ; it != inEvents.end(); it++ )
00119 {
00120 try
00121 {
00122 addEvent( *it );
00123 }
00124 catch( Error &e )
00125 {
00126 e.setCurrentLocation(
00127 __FUNCTION__, __FILE__, __LINE__ );
00128 }
00129 }
00130 }
00131
00132
00133
00134
00135
00136
00137 void
00138 ForbiddenEvent::addEvent(const EventSharedPtr & inSource) throw() {
00139 try
00140 {
00141 mEvents.push_back( inSource );
00142 }
00143 catch( Error &e )
00144 {
00145 e.setCurrentLocation(
00146 __FUNCTION__, __FILE__, __LINE__ );
00147 throw;
00148 }
00149 }
00150
00151 ForbiddenEvent::ForbiddenEvent()
00152 : Visitable(),
00153 SelfReferencing<ForbiddenEvent>(),
00154 mStartTimeInterval(),
00155 mEndTimeInterval(),
00156 mDuration(),
00157 mEvents() {
00158 }
00159
00160 ForbiddenEvent::~ForbiddenEvent() throw() {
00161 }
00162
00163
00164 }
00165
00166 }