Loading...
Searching...
No Matches
LockableDObject.h
Go to the documentation of this file.
#ifndef LOCKABLE_DOBJECT_H
#define LOCKABLE_DOBJECT_H
#include "DObject.h"
#include <mutex>
class LockableDObject {
public:
LockableDObject() = default;
DObject& get();
void lock();
void unlock();
private:
DObject object_;
std::mutex mutex_;
};
#endif // LOCKABLE_DOBJECT_H
DObject.h
Defines the DObject class, a universal data container for the project.
DObject
A universal data container class.
Definition DObject.h:29
LockableDObject::unlock
void unlock()
Unlocks the mutex after thread-safe access.
Definition LockableDObject.cpp:20
LockableDObject::get
DObject & get()
Access the underlying DObject.
Definition LockableDObject.cpp:6
LockableDObject::lock
void lock()
Locks the mutex to ensure thread-safe access.
Definition LockableDObject.cpp:13
LockableDObject::LockableDObject
LockableDObject()=default
Default constructor.