00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_EVENT_HPP
00017 #define TORC_GENERIC_OM_EVENT_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/om/Visitable.hpp"
00021 #include "torc/generic/om/SelfReferencing.hpp"
00022 #include "torc/generic/om/FactoryType.hpp"
00023 #include "torc/generic/om/VisitorType.hpp"
00024 #include "torc/generic/om/Value.hpp"
00025 #include "torc/generic/om/PortElement.hpp"
00026
00027 #include <list>
00028
00029 namespace torc { namespace generic { class PortElement; } }
00030 namespace torc { namespace generic { class PortList; } }
00031 namespace torc { namespace generic { class Net; } }
00032
00033 namespace torc {
00034
00035 namespace generic {
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class Event
00047 : public Visitable,
00048 public SelfReferencing<Event>
00049 {
00050 friend class FactoryType<Event>;
00051
00052 public:
00053
00054
00055
00056
00057 enum Type
00058 {
00059 eTypeEvent = 0,
00060 eTypeOffsetEvent
00061 };
00062
00063
00064
00065
00066 typedef VisitorType<Event> Visitor;
00067
00068 virtual void
00069 accept(BaseVisitor & inoutVisitor) throw(Error);
00070
00071
00072
00073
00074 class Factory: public FactoryType<Event>
00075 {
00076 public:
00077 using FactoryType<Event>::create;
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 virtual EventSharedPtr
00094 newEventPtr( const Event::Type & inEventType,
00095 const std::list< PortSharedPtr > & inPorts,
00096 const std::list < PortReferenceSharedPtr > & inPortReferences,
00097 const std::list< NetSharedPtr > & inNets,
00098 const LogicElementSharedPtr & inTransition
00099 = LogicElementSharedPtr(),
00100 const PortListSharedPtr & inPortList
00101 = PortListSharedPtr(),
00102 const Value & inOffsetTime
00103 = Value() ) throw(Error);
00104 };
00105
00106
00107
00108
00109
00110
00111 inline const Type
00112 getType() const throw();
00113
00114
00115
00116
00117
00118
00119 void
00120 setType( const Type & inSource ) throw();
00121
00122
00123
00124
00125
00126
00127
00128 inline void
00129 getPortElements( std::list< PortElement > & outPortElements ) const throw();
00130
00131
00132
00133
00134
00135
00136 void
00137 addPort( const PortSharedPtr &inPort ) throw();
00138
00139
00140
00141
00142
00143
00144 void
00145 addPortReference(
00146 const PortReferenceSharedPtr &inPortRef ) throw();
00147
00148
00149
00150
00151
00152
00153 inline const PortListSharedPtr
00154 getPortList() const throw();
00155
00156
00157
00158
00159
00160
00161 void
00162 setPortList( const PortListSharedPtr & inPortList ) throw();
00163
00164
00165
00166
00167
00168
00169
00170 inline void
00171 getNets( std::list< NetSharedPtr > & outNets ) const throw();
00172
00173
00174
00175
00176
00177
00178 void
00179 addNet( const NetSharedPtr &inNet ) throw();
00180
00181
00182
00183
00184
00185
00186 inline const LogicElementSharedPtr
00187 getTransition() const throw();
00188
00189
00190
00191
00192
00193
00194 void
00195 setTransition(const LogicElementSharedPtr & inSource) throw();
00196
00197
00198
00199
00200
00201 inline const Value
00202 getOffsetTime() const throw();
00203
00204
00205
00206
00207
00208 void
00209 setOffsetTime(const Value & value) throw();
00210
00211 virtual
00212 ~Event() throw();
00213
00214 protected:
00215 Event();
00216
00217 private:
00218 Event(const Event & source) throw();
00219
00220 Event & operator=(const Event & source) throw();
00221
00222 Type mType;
00223 std::list< PortElement > mPortElements;
00224 PortListSharedPtr mPortList;
00225 std::list< NetSharedPtr > mNets;
00226 LogicElementSharedPtr mTransition;
00227 Value mOffsetTime;
00228
00229 };
00230
00231
00232
00233
00234
00235
00236 inline const Event::Type
00237 Event::getType() const throw() {
00238 return mType;
00239 }
00240
00241
00242
00243
00244
00245
00246
00247 inline void
00248 Event::getPortElements(
00249 std::list< PortElement > & outPortElements ) const throw() {
00250 outPortElements.insert( outPortElements.end(),
00251 mPortElements.begin(), mPortElements.end() );
00252 }
00253
00254
00255
00256
00257
00258
00259 inline const PortListSharedPtr
00260 Event::getPortList() const throw() {
00261 return mPortList;
00262 }
00263
00264
00265
00266
00267
00268
00269
00270 inline void
00271 Event::getNets(
00272 std::list< NetSharedPtr > & outNets ) const throw() {
00273 outNets.insert( outNets.end(),
00274 mNets.begin(), mNets.end() );
00275 }
00276
00277
00278
00279
00280
00281
00282 inline const LogicElementSharedPtr
00283 Event::getTransition() const throw() {
00284 return mTransition;
00285 }
00286
00287
00288
00289
00290
00291 inline const Value
00292 Event::getOffsetTime() const throw() {
00293 return mOffsetTime;
00294 }
00295
00296 }
00297
00298 }
00299 #endif // TORC_GENERIC_OM_EVENT_HPP