DotNameLib
Loading...
Searching...
No Matches
DotNameLib.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <DotNameLib/version.h> // cmake configuration will generate this file
5
6#include <atomic>
7#include <memory>
8#include <string>
9
10namespace dotnamecpp::v1 {
11 class DotNameLib {
12
13 public:
20 DotNameLib(std::shared_ptr<logging::ILogger> logger,
21 std::shared_ptr<dotnamecpp::assets::IAssetManager> assetManager);
22
29
36 DotNameLib(const DotNameLib &other) = delete;
37 DotNameLib &operator=(const DotNameLib &other) = delete;
38 DotNameLib(DotNameLib &&other) = delete;
39 DotNameLib &operator=(DotNameLib &&other) = delete;
40
41 // ============================================================================
42 // Main API
43 // ============================================================================
44
55 bool run(int durationSeconds = 0);
56
62 void stop();
63
64 // ============================================================================
65 // Query Methods
66 // ============================================================================
67
74 [[nodiscard]]
75 bool isInitialized() const noexcept;
76
82 [[nodiscard]]
83 const std::shared_ptr<dotnamecpp::assets::IAssetManager> &getAssetManager() const noexcept;
84
85 private:
86 const std::string libName_ = "DotNameLib v." DOTNAMELIB_VERSION;
87 std::shared_ptr<dotnamecpp::logging::ILogger> logger_;
88 std::shared_ptr<dotnamecpp::assets::IAssetManager> assetManager_;
89 bool isInitialized_ = false;
90 std::atomic<bool> shouldStop_{false};
91 };
92
93} // namespace dotnamecpp::v1
const std::shared_ptr< dotnamecpp::assets::IAssetManager > & getAssetManager() const noexcept
Get the Asset Manager object.
Definition DotNameLib.cpp:104
DotNameLib(DotNameLib &&other)=delete
DotNameLib(std::shared_ptr< logging::ILogger > logger, std::shared_ptr< dotnamecpp::assets::IAssetManager > assetManager)
Construct a new object.
Definition DotNameLib.cpp:6
DotNameLib(const DotNameLib &other)=delete
Copy and move operations are deleted.
bool run(int durationSeconds=0)
Run your business logic.
Definition DotNameLib.cpp:42
void stop()
Stop all running processes.
Definition DotNameLib.cpp:86
~DotNameLib()
Destroy the object.
Definition DotNameLib.cpp:33
bool isInitialized() const noexcept
Check if the library is initialized.
Definition DotNameLib.cpp:102
DotNameLib & operator=(DotNameLib &&other)=delete
DotNameLib & operator=(const DotNameLib &other)=delete
Definition AssetManager.cpp:4
Definition ILogger.hpp:15
Definition DotNameLib.hpp:10
Definition DotNameLib.hpp:10