torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WaveValue.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_WAVEVALUE_HPP
17 #define TORC_GENERIC_WAVEVALUE_HPP
18 
24 #include "torc/generic/Value.hpp"
25 
26 namespace torc { namespace generic { class LogicElement; } }
27 
28 namespace torc {
29 namespace generic {
30 
31 /**
32  * @brief This class is used within simulate to describe input stimuli and expected
33  * responces over a certain time interval
34  */
35 class WaveValue : public Nameable, public SelfReferencing<WaveValue> {
36  friend class FactoryType<WaveValue> ;
37 
38 public:
39 
40  /**
41  * Convenience class to visit a WaveValue.
42  */
44 
45  virtual void accept(BaseVisitor& inoutVisitor) throw (Error);
46 
47  /**
48  * Convenience class to create a WaveValue.
49  */
50  class Factory : public FactoryType<WaveValue> {
51  public:
53  /**
54  * Create a WaveValue.
55  *
56  * @param[in] inName Name of the WaveValue to be created.
57  * @param[in] inDeltaTimeDuration Value Delta time duration
58  * between the values contained in the logic waveform.
59  * @param[in] inLogicWaveForm Logic wave form for this WaveValue.
60  * @param[in] inSimulate Pointer to parented (Simulate) object [optional].
61  * If not mentioned WaveValue will not be added to simulate.
62  *
63  * @return Pointer to created WaveValue.
64  */
65  WaveValueSharedPtr virtual newWaveValuePtr(const std::string& inName,
66  const Value& inDeltaTimeDuration, const LogicElementSharedPtr inLogicWaveForm,
67  const SimulateSharedPtr& inSimulate = SimulateSharedPtr()) throw (Error);
68  };
69 
70  /**
71  * Get the delta time duration between the values contained in the logic waveform.
72  * @return Value Delta time duration between the values contained in the logic waveform.
73  */
74  inline const Value getDeltaTimeDuration() const;
75 
76  /**
77  * Set the delta time duration between the values contained in the logic waveform.
78  * @param[in] value Delta time duration between the values contained in the logic waveform.
79  */
80  void setDeltaTimeDuration(const Value& value);
81 
82  /**
83  * Get the logic waveform.
84  *
85  * @return Pointer to LogicElement.
86  */
87  inline const LogicElementSharedPtr getLogicWaveform() const;
88 
89  /**
90  * Set the logic waveform.
91  *
92  * @param[in] inSource Pointer to logic element object.
93  */
94  void setLogicWaveform(const LogicElementSharedPtr& inSource);
95 
96  ~WaveValue() throw ();
97 
98 protected:
99  WaveValue();
100 
101 private:
102  WaveValue(const WaveValue& source);
103 
104  WaveValue& operator=(const WaveValue& source);
105 
108 
109 };
110 
111 /**
112  * Get the delta time duration between the values contained in the logic waveform.
113  * @return Value Delta time duration between the values contained in the logic waveform.
114  */
115 inline const Value WaveValue::getDeltaTimeDuration() const {
116  return mDeltaTimeDuration;
117 }
118 
119 /**
120  * Get the logic waveform.
121  *
122  * @param[out] outLogicElements List of LogicElement (s) to be appended to
123  */
125  return mLogicWaveform;
126 }
127 
128 } // namespace generic
129 } // namespace torc
130 
131 #endif // TORC_GENERIC_WAVEVALUE_HPP
An acyclic inoutVisitor implementation.
Definition: VisitorType.hpp:57
boost::shared_ptr< WaveValue > WaveValueSharedPtr
boost::shared_ptr< LogicElement > LogicElementSharedPtr
const Value getDeltaTimeDuration() const
Definition: WaveValue.hpp:115
virtual WaveValueSharedPtr newWaveValuePtr(const std::string &inName, const Value &inDeltaTimeDuration, const LogicElementSharedPtr inLogicWaveForm, const SimulateSharedPtr &inSimulate=SimulateSharedPtr())
Definition: WaveValue.cpp:35
boost::shared_ptr< Simulate > SimulateSharedPtr
std::string string
VisitorType< WaveValue > Visitor
Definition: WaveValue.hpp:43
LogicElementSharedPtr mLogicWaveform
Definition: WaveValue.hpp:107
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
A base class for Visitor.
Definition: VisitorType.hpp:31
const LogicElementSharedPtr getLogicWaveform() const
Definition: WaveValue.hpp:124
This class is used within simulate to describe input stimuli and expected responces over a certain ti...
Definition: WaveValue.hpp:35
An object that has a name.
Definition: Nameable.hpp:34
void setLogicWaveform(const LogicElementSharedPtr &inSource)
Definition: WaveValue.cpp:81
A placeholder for a factory method.
Definition: FactoryType.hpp:35
void setDeltaTimeDuration(const Value &value)
Definition: WaveValue.cpp:72
virtual void accept(BaseVisitor &inoutVisitor)
Definition: WaveValue.cpp:59