libTriton  version 1.0 build 1558
modes.hpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#ifndef TRITON_MODES_H
9#define TRITON_MODES_H
10
11#include <memory>
12#include <unordered_set>
13
14#include <triton/dllexport.hpp>
15#include <triton/modesEnums.hpp>
16
17
18
20namespace triton {
27 namespace modes {
35
36 class Modes {
37 private:
39 void copy(const Modes& other);
40
41 protected:
43 std::unordered_set<triton::modes::mode_e> enabledModes;
44
45 public:
47 TRITON_EXPORT Modes();
48
50 TRITON_EXPORT Modes(const Modes& other);
51
53 TRITON_EXPORT Modes& operator=(const Modes& other);
54
56 TRITON_EXPORT bool isModeEnabled(triton::modes::mode_e mode) const;
57
59 TRITON_EXPORT void setMode(triton::modes::mode_e mode, bool flag);
60
62 TRITON_EXPORT void clearModes(void);
63 };
64
66 using SharedModes = std::shared_ptr<triton::modes::Modes>;
67
69 };
71};
72
73#endif /* TRITON_MODES_H */
The modes class.
Definition: modes.hpp:36
std::unordered_set< triton::modes::mode_e > enabledModes
The set of enabled modes.
Definition: modes.hpp:43
TRITON_EXPORT void clearModes(void)
Clears recorded modes.
Definition: modes.cpp:52
TRITON_EXPORT Modes()
Constructor.
Definition: modes.cpp:16
TRITON_EXPORT void setMode(triton::modes::mode_e mode, bool flag)
Enables or disables a specific mode.
Definition: modes.cpp:44
TRITON_EXPORT bool isModeEnabled(triton::modes::mode_e mode) const
Returns true if the mode is enabled.
Definition: modes.cpp:37
TRITON_EXPORT Modes & operator=(const Modes &other)
Copies a Modes.
Definition: modes.cpp:26
constexpr triton::uint32 flag
flag size in bit
Definition: cpuSize.hpp:58
mode_e
Enumerates all kinds of mode.
Definition: modesEnums.hpp:29
std::shared_ptr< triton::modes::Modes > SharedModes
Shared Modes.
Definition: modes.hpp:66
The Triton namespace.