yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
activity_file.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ACTIVITY_FILE_H_
2#define YAZE_APP_ACTIVITY_FILE_H_
3
4#include <cstdint>
5#include <string>
6
7namespace yaze::app {
8
16 int pid = 0;
17 std::string version;
18 std::string socket_path; // gRPC endpoint if enabled (e.g., "localhost:50052")
19 std::string active_rom; // Path to currently loaded ROM
20 int64_t start_timestamp = 0; // Unix epoch seconds
21};
22
34 public:
39 explicit ActivityFile(const std::string& path);
40
45
46 // Non-copyable
47 ActivityFile(const ActivityFile&) = delete;
49
50 // Movable
51 ActivityFile(ActivityFile&& other) noexcept;
52 ActivityFile& operator=(ActivityFile&& other) noexcept;
53
58 void Update(const ActivityStatus& status);
59
63 bool Exists() const;
64
68 const std::string& GetPath() const { return path_; }
69
70 private:
71 std::string path_;
72};
73
74} // namespace yaze::app
75
76#endif // YAZE_APP_ACTIVITY_FILE_H_
Manages a JSON status file for instance discovery.
ActivityFile & operator=(const ActivityFile &)=delete
bool Exists() const
Check if the status file exists on disk.
ActivityFile(const std::string &path)
Construct an activity file at the specified path.
void Update(const ActivityStatus &status)
Update the status file with new information.
~ActivityFile()
Destructor removes the status file.
ActivityFile(const ActivityFile &)=delete
const std::string & GetPath() const
Get the path to the status file.
Status information for an active YAZE instance.