New 4DSSE Code 0.0.1a
 
Loading...
Searching...
No Matches
LockableDObject.h
Go to the documentation of this file.
1#ifndef LOCKABLE_DOBJECT_H
2#define LOCKABLE_DOBJECT_H
3
4#include "DObject.h"
5#include <mutex>
6
14
20public:
24 LockableDObject() = default;
25
30 DObject& get();
31
35 void lock();
36
40 void unlock();
41
42private:
43 DObject object_;
44 std::mutex mutex_;
45};
46
47#endif // LOCKABLE_DOBJECT_H
Defines the DObject class, a universal data container for the project.
A universal data container class.
Definition DObject.h:29
void unlock()
Unlocks the mutex after thread-safe access.
Definition LockableDObject.cpp:20
DObject & get()
Access the underlying DObject.
Definition LockableDObject.cpp:6
void lock()
Locks the mutex to ensure thread-safe access.
Definition LockableDObject.cpp:13
LockableDObject()=default
Default constructor.