00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/WaveValue.hpp"
00017 #include "torc/generic/om/LogicElement.hpp"
00018 #include "torc/generic/om/Simulate.hpp"
00019
00020 namespace torc {
00021
00022 namespace generic {
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 WaveValueSharedPtr
00037 WaveValue::Factory::newWaveValuePtr( const std::string & inName,
00038 const Value & inDeltaTimeDuration,
00039 const LogicElementSharedPtr inLogicWaveForm,
00040 const SimulateSharedPtr & inSimulate ) throw(Error) {
00041 try
00042 {
00043 WaveValueSharedPtr newWaveValue;
00044 create( newWaveValue );
00045 newWaveValue->setName( inName );
00046 newWaveValue->setDeltaTimeDuration( inDeltaTimeDuration );
00047 newWaveValue->setLogicWaveform( inLogicWaveForm );
00048 if( inSimulate )
00049 {
00050 inSimulate->addWaveValue( newWaveValue );
00051 }
00052 return newWaveValue;
00053 }
00054 catch( Error &e )
00055 {
00056 e.setCurrentLocation(
00057 __FUNCTION__, __FILE__, __LINE__ );
00058 throw;
00059 }
00060 }
00061
00062 WaveValue::WaveValue()
00063 : Nameable(),
00064 SelfReferencing<WaveValue>(),
00065 mDeltaTimeDuration(),
00066 mLogicWaveform() {
00067 }
00068
00069 WaveValue::~WaveValue() throw() {
00070 }
00071
00072 void
00073 WaveValue::accept(BaseVisitor & inoutVisitor) throw(Error) {
00074 try
00075 {
00076 runVisitor( *this, inoutVisitor );
00077 }
00078 catch( Error &e )
00079 {
00080 e.setCurrentLocation(
00081 __FUNCTION__, __FILE__, __LINE__ );
00082 throw;
00083 }
00084 }
00085
00086
00087
00088
00089
00090 void
00091 WaveValue::setDeltaTimeDuration( const Value & value ) throw() {
00092 mDeltaTimeDuration = value;
00093 }
00094
00095
00096
00097
00098
00099
00100 void
00101 WaveValue::setLogicWaveform(const LogicElementSharedPtr & inSource) throw() {
00102 mLogicWaveform = inSource;
00103 }
00104
00105 }
00106
00107 }