FileTopicReader.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarX
19 * @author Mirko Waechter( mirko.waechter at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24 #pragma once
25 
26 #include "TopicReaderInterface.h"
27 
28 #include <filesystem>
29 
30 namespace armarx
31 {
32 
34  {
35  public:
36  FileTopicReader(std::istream* stream);
37  FileTopicReader(std::filesystem::path path);
39  // TopicReaderInterface interface
40  public:
41  bool read(TopicUtil::TopicData& data) override;
42  bool seekTo(IceUtil::Time timestamp) override;
43  IceUtil::Time getReplayLength() override;
44  std::vector<std::string> getReplayTopics() override;
45  private:
46  std::istream* stream;
47  std::filesystem::path filepath;
48  };
49 
50  using FileTopicReaderPtr = std::shared_ptr<FileTopicReader>;
51 } // namespace armarx
52 
armarx::TopicReaderInterface
Definition: TopicReaderInterface.h:36
TopicReaderInterface.h
armarx::FileTopicReader
Definition: FileTopicReader.h:33
armarx::FileTopicReaderPtr
std::shared_ptr< FileTopicReader > FileTopicReaderPtr
Definition: FileTopicReader.h:50
armarx::FileTopicReader::~FileTopicReader
~FileTopicReader()
Definition: FileTopicReader.cpp:51
armarx::TopicUtil::TopicData
Definition: TopicUtil.h:34
armarx::FileTopicReader::getReplayTopics
std::vector< std::string > getReplayTopics() override
Definition: FileTopicReader.cpp:89
armarx::FileTopicReader::read
bool read(TopicUtil::TopicData &data) override
Definition: FileTopicReader.cpp:59
armarx::FileTopicReader::getReplayLength
IceUtil::Time getReplayLength() override
Definition: FileTopicReader.cpp:83
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::FileTopicReader::seekTo
bool seekTo(IceUtil::Time timestamp) override
Definition: FileTopicReader.cpp:77
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::FileTopicReader::FileTopicReader
FileTopicReader(std::istream *stream)
Definition: FileTopicReader.cpp:34
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28