This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilewriter.h
More file actions
74 lines (65 loc) · 1.28 KB
/
filewriter.h
File metadata and controls
74 lines (65 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @file filewriter.h
* @author AiglonDore and sarahnourgh
* @brief Provides the {@link FileWriter} class
* @version 1.1.1
* @date 2023-12-05
*
* @copyright Copyright (c) 2023
*
*/
#pragma once
#include <string>
#include <mutex>
/**
* @brief The FileWriter class is the base class for the header and core writers.
*
*/
class FileWriter
{
public:
/**
* @brief Construct a new File Writer object
* @warning Deleted
*
*/
FileWriter() = delete;
/**
* @brief Construct a new File Writer object
*
*/
FileWriter(const std::string& classname, const std::string& filename) : classname(classname), filename(filename) {};
/**
* @brief Destroy the File Writer object
*
*/
virtual ~FileWriter() = default;
/**
* @brief Writes the file
* @param mutex mutex to lock
*/
virtual void write(std::mutex* mutex = nullptr) = 0;
/**
* @brief Get the Classname object
*
* @return const std::string& class name
*/
const std::string& getClassname() const { return classname; }
/**
* @brief Get the Filename object
*
* @return const std::string& file name
*/
const std::string& getFilename() const { return filename; }
private:
/**
* @brief class name
*
*/
std::string classname;
/**
* @brief file name
*
*/
std::string filename;
};