yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::ActivityFile Class Reference

Manages a JSON status file for instance discovery. More...

#include <activity_file.h>

Public Member Functions

 ActivityFile (const std::string &path)
 Construct an activity file at the specified path.
 
 ~ActivityFile ()
 Destructor removes the status file.
 
 ActivityFile (const ActivityFile &)=delete
 
ActivityFileoperator= (const ActivityFile &)=delete
 
 ActivityFile (ActivityFile &&other) noexcept
 
ActivityFileoperator= (ActivityFile &&other) noexcept
 
void Update (const ActivityStatus &status)
 Update the status file with new information.
 
bool Exists () const
 Check if the status file exists on disk.
 
const std::string & GetPath () const
 Get the path to the status file.
 

Private Attributes

std::string path_
 

Detailed Description

Manages a JSON status file for instance discovery.

Creates a file at /tmp/yaze-<pid>.status on construction and removes it on destruction. Updates can be pushed via Update().

This enables the Oracle Agent Manager to discover running YAZE instances and route commands to the appropriate gRPC endpoint.

Definition at line 33 of file activity_file.h.

Constructor & Destructor Documentation

◆ ActivityFile() [1/3]

yaze::app::ActivityFile::ActivityFile ( const std::string & path)
explicit

Construct an activity file at the specified path.

Parameters
pathFull path to the status file (e.g., /tmp/yaze-12345.status)

Definition at line 17 of file activity_file.cc.

References path_.

◆ ~ActivityFile()

yaze::app::ActivityFile::~ActivityFile ( )

Destructor removes the status file.

Definition at line 26 of file activity_file.cc.

References path_.

◆ ActivityFile() [2/3]

yaze::app::ActivityFile::ActivityFile ( const ActivityFile & )
delete

◆ ActivityFile() [3/3]

yaze::app::ActivityFile::ActivityFile ( ActivityFile && other)
noexcept

Definition at line 32 of file activity_file.cc.

Member Function Documentation

◆ operator=() [1/2]

ActivityFile & yaze::app::ActivityFile::operator= ( const ActivityFile & )
delete

◆ operator=() [2/2]

ActivityFile & yaze::app::ActivityFile::operator= ( ActivityFile && other)
noexcept

Definition at line 37 of file activity_file.cc.

◆ Update()

void yaze::app::ActivityFile::Update ( const ActivityStatus & status)

Update the status file with new information.

Parameters
statusThe current activity status to write

Definition at line 49 of file activity_file.cc.

References yaze::app::ActivityStatus::active_rom, path_, yaze::app::ActivityStatus::pid, yaze::app::ActivityStatus::socket_path, yaze::app::ActivityStatus::start_timestamp, and yaze::app::ActivityStatus::version.

◆ Exists()

bool yaze::app::ActivityFile::Exists ( ) const

Check if the status file exists on disk.

Definition at line 82 of file activity_file.cc.

References path_.

◆ GetPath()

const std::string & yaze::app::ActivityFile::GetPath ( ) const
inline

Get the path to the status file.

Definition at line 68 of file activity_file.h.

References path_.

Member Data Documentation

◆ path_

std::string yaze::app::ActivityFile::path_
private

Definition at line 71 of file activity_file.h.

Referenced by ActivityFile(), Exists(), GetPath(), Update(), and ~ActivityFile().


The documentation for this class was generated from the following files: