19 #include <QApplication> 20 #include <QMutexLocker> 70 return impl_.isRunning();
91 char* method,
const PropertyMap& properties, Qt::ConnectionType type) {
94 QMap<QString, BagQuery*>::iterator it =
impl_.
queries_.find(topic);
99 connect(it.value(), SIGNAL(aboutToBeDestroyed()),
this,
103 return receiver->connect(it.value(), SIGNAL(
messageRead(
const 104 QString&,
const Message&)), method, type);
108 const char* method) {
111 QMap<QString, BagQuery*>::iterator it =
impl_.
queries_.find(topic);
114 return it.value()->disconnect(SIGNAL(
messageRead(
const QString&,
115 const Message&)), receiver, method);
131 return QObject::event(event);
143 std::vector<std::string> queriedTopics;
144 queriedTopics.reserve(
queries_.count());
146 for (QMap<QString, BagQuery*>::const_iterator jt =
queries_.begin();
148 queriedTopics.push_back(jt.key().toStdString());
156 QMap<QString, BagQuery*>::const_iterator jt =
queries_.find(
157 QString::fromStdString(it->getTopic()));
160 jt.value()->callback(*it);
164 double progress = (it->getTime()-view.
getBeginTime()).toSec()/
170 QApplication::postEvent(parent(), progressChangeEvent);
174 error_ = QString::fromStdString(exception.what());
203 for (QMap<QString, BagQuery*>::iterator it =
impl_.
queries_.begin();
205 if (it.value() ==
static_cast<BagQuery*
>(sender())) {
void read(const QString &fileName)
void readingFailed(const QString &error)
void open(std::string const &filename, uint32_t mode=bagmode::Read)
bool unsubscribe(const QString &topic, QObject *receiver, const char *method=0)
QMap< int, QVariant > PropertyMap
bool subscribe(const QString &topic, QObject *receiver, const char *method, const PropertyMap &properties=PropertyMap(), Qt::ConnectionType type=Qt::AutoConnection)
void queryAboutToBeDestroyed()
QString getFileName() const
bool event(QEvent *event)
#define ROS_INFO_STREAM(args)
static const QEvent::Type Type
void readingProgressChanged(double progress)
BagReader(QObject *parent=0)
#define ROS_ERROR_STREAM(args)
double getProgress() const
QMap< QString, BagQuery * > queries_
void messageRead(const QString &topic, const Message &message)