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 
35 namespace visionx::imrec
36 {
37 
38  /**
39  * An object of this class behaves likee a normal recording, but is in fact a sequence of images
40  */
43  {
44 
45  private:
46 
47  std::filesystem::path m_ext;
48 
49  /**
50  * @brief Name of the current chunk (part of the path to overcome file system limitations)
51  */
52  std::filesystem::path m_frames_chunk;
53 
54  public:
55 
56  /**
57  * @brief Default constructor to manually start the recording
58  */
60 
61  AbstractSequencedRecordingStrategy(const std::filesystem::path& filePath, const std::filesystem::path& ext);
62 
63  /**
64  * @brief Destruct the recording strategy
65  */
67 
68  void startRecording() override;
69 
70  std::filesystem::path getDotExtension() const override;
71 
72  std::filesystem::path getMetadataPath() const override;
73 
74  protected:
75 
76  /**
77  * @brief Returns the next sequenced full path and increments the sequence number
78  * @return Next sequenced full path
79  */
80  std::filesystem::path deriveFramePath(const unsigned int sequence_number, const std::string& frame_name);
81 
82  };
83 
84 }
visionx::imrec::AbstractSequencedRecordingStrategy::getMetadataPath
std::filesystem::path getMetadataPath() const override
Definition: AbstractSequencedRecordingStrategy.cpp:89
visionx::imrec::AbstractRecordingStrategy
Abstract interface of a recording strategy.
Definition: AbstractRecordingStrategy.h:54
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:41
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:97
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:82
visionx::imrec::AbstractSequencedRecordingStrategy::~AbstractSequencedRecordingStrategy
~AbstractSequencedRecordingStrategy() override
Destruct the recording strategy.
Definition: AbstractSequencedRecordingStrategy.cpp:60
visionx::imrec
Definition: json_conversions.h:35
visionx::imrec::AbstractSequencedRecordingStrategy::startRecording
void startRecording() override
Starts the recording manually if constructed empty.
Definition: AbstractSequencedRecordingStrategy.cpp:67