AbstractSequencedRecordingStrategy.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package visionx::imrec
17  * @author Christian R. G. Dreher <christian.dreher@student.kit.edu>
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #pragma once
25 
26 
27 // STD/STL
28 #include <filesystem>
29 #include <string>
30 
31 // ArmarX
33 
34 namespace visionx::imrec
35 {
36 
37  /**
38  * An object of this class behaves likee a normal recording, but is in fact a sequence of images
39  */
41  {
42 
43  private:
44  std::filesystem::path m_ext;
45 
46  /**
47  * @brief Name of the current chunk (part of the path to overcome file system limitations)
48  */
49  std::filesystem::path m_frames_chunk;
50 
51  public:
52  /**
53  * @brief Default constructor to manually start the recording
54  */
56 
57  AbstractSequencedRecordingStrategy(const std::filesystem::path& filePath,
58  const std::filesystem::path& ext);
59 
60  /**
61  * @brief Destruct the recording strategy
62  */
64 
65  void startRecording() override;
66 
67  std::filesystem::path getDotExtension() const override;
68 
69  std::filesystem::path getMetadataPath() const override;
70 
71  protected:
72  /**
73  * @brief Returns the next sequenced full path and increments the sequence number
74  * @return Next sequenced full path
75  */
76  std::filesystem::path deriveFramePath(const unsigned int sequence_number,
77  const std::string& frame_name);
78  };
79 
80 } // namespace visionx::imrec
visionx::imrec::AbstractSequencedRecordingStrategy::getMetadataPath
std::filesystem::path getMetadataPath() const override
Definition: AbstractSequencedRecordingStrategy.cpp:85
visionx::imrec::AbstractRecordingStrategy
Abstract interface of a recording strategy.
Definition: AbstractRecordingStrategy.h:52
visionx::imrec::AbstractSequencedRecordingStrategy::AbstractSequencedRecordingStrategy
AbstractSequencedRecordingStrategy()
Default constructor to manually start the recording.
Definition: AbstractSequencedRecordingStrategy.cpp:45
visionx::imrec::AbstractSequencedRecordingStrategy
An object of this class behaves likee a normal recording, but is in fact a sequence of images.
Definition: AbstractSequencedRecordingStrategy.h:40
visionx::imrec::AbstractSequencedRecordingStrategy::deriveFramePath
std::filesystem::path deriveFramePath(const unsigned int sequence_number, const std::string &frame_name)
Returns the next sequenced full path and increments the sequence number.
Definition: AbstractSequencedRecordingStrategy.cpp:92
AbstractRecordingStrategy.h
visionx::imrec::AbstractSequencedRecordingStrategy::getDotExtension
std::filesystem::path getDotExtension() const override
Gets the extension plus preceeded dot of the configured file (e.g.
Definition: AbstractSequencedRecordingStrategy.cpp:79
visionx::imrec::AbstractSequencedRecordingStrategy::~AbstractSequencedRecordingStrategy
~AbstractSequencedRecordingStrategy() override
Destruct the recording strategy.
Definition: AbstractSequencedRecordingStrategy.cpp:59
visionx::imrec
Definition: json_conversions.h:35
visionx::imrec::AbstractSequencedRecordingStrategy::startRecording
void startRecording() override
Starts the recording manually if constructed empty.
Definition: AbstractSequencedRecordingStrategy.cpp:65