MeshLib C++ Docs
Loading...
Searching...
No Matches
MRViewerEventQueue.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRViewerFwd.h"
4#include "MRMesh/MRMeshFwd.h"
5#include <mutex>
6#include <queue>
7#include <string>
8
9namespace MR
10{
13
14
16class MRVIEWER_CLASS ViewerEventQueue
17{
18public:
21 MRVIEWER_API void emplace( std::string name, ViewerEventCallback cb, bool skipable = false );
23 MRVIEWER_API void execute();
25 MRVIEWER_API void popByName( const std::string& name );
26 MRVIEWER_API bool empty() const;
27
28private:
29 struct NamedEvent
30 {
31 std::string name;
32 ViewerEventCallback cb;
33 };
35 mutable std::recursive_mutex mutex_;
36 std::queue<NamedEvent> queue_;
37 bool lastSkipable_{false};
38};
39
40}
queue to ignore multiple mouse moves in one frame
Definition MRViewerEventQueue.h:17
MRVIEWER_API bool empty() const
MRVIEWER_API void emplace(std::string name, ViewerEventCallback cb, bool skipable=false)
ViewerEventCallback cb
Definition MRViewerEventQueue.h:32
MRVIEWER_API void execute()
execute all events in queue
MRVIEWER_API void popByName(const std::string &name)
pop all events while they have this name
std::string name
Definition MRViewerEventQueue.h:31
only for bindings generation
Definition MRCameraOrientationPlugin.h:8