Lens AI Profiler Cpp
Public Member Functions | List of all members
ImageUploader Class Reference

Class for uploading images to AWS S3 in a separate thread. More...

#include <objectuploader.h>

Public Member Functions

 ImageUploader (int uploadtype, const std::string &endpointUrl, const std::string &token, s3_client_config_t &s3_client_config)
 Constructor to initialize the ImageUploader object. More...
 
bool startUploadThread (const std::string &imagePath, const std::string &bucketName, const std::string &objectKey, const std::chrono::milliseconds &interval)
 Starts a thread that uploads the image to S3 in a loop at a specified interval. More...
 
void stopUploadThread ()
 Stops the running upload thread.
 

Detailed Description

Class for uploading images to AWS S3 in a separate thread.

Constructor & Destructor Documentation

◆ ImageUploader()

ImageUploader::ImageUploader ( int  uploadtype,
const std::string &  endpointUrl,
const std::string &  token,
s3_client_config_t s3_client_config 
)

Constructor to initialize the ImageUploader object.

Parameters
credentialsAWS credentials for S3 access
regionAWS region where the S3 bucket resides
executorOptional thread executor for upload tasks (defaults to PooledThreadExecutor)

Member Function Documentation

◆ startUploadThread()

bool ImageUploader::startUploadThread ( const std::string &  imagePath,
const std::string &  bucketName,
const std::string &  objectKey,
const std::chrono::milliseconds &  interval 
)

Starts a thread that uploads the image to S3 in a loop at a specified interval.

Parameters
imagePathPath to the image file on local storage
bucketNameName of the S3 bucket where the image will be uploaded
objectKeyName of the object (filename) in the S3 bucket
intervalUpload interval in milliseconds
Returns
true on success, false on error

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