Manages temporary storage of attachment data using a singleton pattern.
More...
#include <attachment_data_store.h>
|
| QString | GetAttachmentData (const QString &attachment_id) |
| | Retrieves the base64-encoded attachment data associated with a given ID. This operation is thread-safe.
|
| |
| void | RemoveAttachmentData (const QString &attachment_id) |
| | Removes the attachment data associated with the given ID from the store. Used to free up memory once the attachment data is no longer needed. This operation is thread-safe.
|
| |
| QString | StoreAttachmentData (const QString &base64_data) |
| | Stores base64-encoded attachment data and returns a unique ID. Generates a UUID for the attachment and stores the data in the internal map. This operation is thread-safe.
|
| |
|
| QMap< QString, QString > | attachment_data_ {} |
| | Map storing the attachment data. Key: Attachment ID (QString UUID). Value: Base64-encoded attachment data (QString).
|
| |
| QMutex | mutex_ {} |
| | Mutex ensuring thread-safe access to the attachment_data_ map.
|
| |
Manages temporary storage of attachment data using a singleton pattern.
This class provides a thread-safe, in-memory store for holding base64-encoded attachment data associated with unique IDs. It's used to temporarily hold attachment content before it's fully processed or sent.
◆ AttachmentDataStore() [1/2]
| AttachmentDataStore::AttachmentDataStore |
( |
| ) |
|
|
privatedefault |
Private default constructor to enforce the singleton pattern.
◆ AttachmentDataStore() [2/2]
Deleted copy constructor to prevent copying.
◆ GetAttachmentData()
| QString AttachmentDataStore::GetAttachmentData |
( |
const QString & | attachment_id | ) |
|
Retrieves the base64-encoded attachment data associated with a given ID. This operation is thread-safe.
- Parameters
-
| attachment_id | The unique identifier of the attachment data to retrieve. |
- Returns
- The base64-encoded QString data if the ID exists, otherwise an empty QString.
◆ GetInstance()
◆ operator=()
Deleted assignment operator to prevent assignment.
◆ RemoveAttachmentData()
| void AttachmentDataStore::RemoveAttachmentData |
( |
const QString & | attachment_id | ) |
|
Removes the attachment data associated with the given ID from the store. Used to free up memory once the attachment data is no longer needed. This operation is thread-safe.
- Parameters
-
| attachment_id | The unique identifier of the attachment data to remove. |
◆ StoreAttachmentData()
| QString AttachmentDataStore::StoreAttachmentData |
( |
const QString & | base64_data | ) |
|
Stores base64-encoded attachment data and returns a unique ID. Generates a UUID for the attachment and stores the data in the internal map. This operation is thread-safe.
- Parameters
-
| base64_data | The attachment data encoded as a base64 QString. |
- Returns
- A unique QString identifier (UUID without braces) for the stored data.
◆ attachment_data_
| QMap<QString, QString> AttachmentDataStore::attachment_data_ {} |
|
private |
Map storing the attachment data. Key: Attachment ID (QString UUID). Value: Base64-encoded attachment data (QString).
◆ mutex_
| QMutex AttachmentDataStore::mutex_ {} |
|
private |
Mutex ensuring thread-safe access to the attachment_data_ map.
The documentation for this class was generated from the following files: