Changeset 202 in pacpusframework for trunk/include/Pacpus
- Timestamp:
- Oct 29, 2013, 3:40:48 PM (11 years ago)
- Location:
- trunk/include/Pacpus/kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentBase.h
r201 r202 101 101 QString getName() const; 102 102 103 /// @todo DOC104 InputInterfaceBase * getInput(QString name) const;105 106 /// @todo DOC107 OutputInterfaceBase * getOutput(QString name) const;108 109 103 protected: 110 104 /// Changes the state of the component. … … 155 149 outputs().insert(name, connection); 156 150 } 151 152 /// @todo DOC 153 InputInterfaceBase * getInput(QString name) const; 154 155 /// @todo DOC 156 OutputInterfaceBase * getOutput(QString name) const; 157 157 158 158 template <typename DataType, class ComponentType> -
trunk/include/Pacpus/kernel/InputOutputInterface.h
r200 r202 5 5 #include <Pacpus/kernel/Log.h> 6 6 7 #include <QApplication>8 7 #include <QByteArray> 9 8 #include <QCoreApplication> … … 147 146 148 147 for (QList<ConnectionBase>::iterator it = connections().begin(), itend = connections().end(); it != itend; ++it) { 149 // Event is deleted by the event loop handler 150 QApplication::postEvent(it->getInterface(), new PacpusTypedEvent<T>(TYPED_EVENT,data,t,tr),it->getPriority()); 151 //qDebug() << "sender " << it->getInterface()->getSignature() << " Data & " << &data << " "; 148 // Qt documentatino: 149 // The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted. 150 // It is not safe to access the event after it has been posted. 151 QEvent * newEvent = new PacpusTypedEvent<T>(TYPED_EVENT, data, t, tr); 152 QCoreApplication::postEvent(it->getInterface(), newEvent, it->getPriority()); 153 LOG_DEBUG("Sender: " << it->getInterface()->getSignature()); 154 LOG_DEBUG("Data &: " << &data); 152 155 } 156 } 157 158 template <typename T1, typename T2, class C> 159 bool checkedSend(OutputInterface<T1, C> * sender, const T2 & data, road_time_t t = road_time(), road_timerange_t tr = 0); 160 161 template <typename T1, typename T2, class C> 162 bool checkedSend(OutputInterface<T1, C> * sender, const T2 & data, road_time_t t, road_timerange_t tr) 163 { 164 if (sender && sender->hasConnection()) { 165 sender->send(data, t, tr); 166 return true; 167 } 168 return false; 153 169 } 154 170
Note:
See TracChangeset
for help on using the changeset viewer.