MCPcopy Create free account
hub / github.com/cinit/TMoe / Rva

Class Rva

app/src/main/cpp/utils/Rva.h:10–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "cstddef"
9
10class Rva {
11public:
12 const void *address = nullptr;
13 size_t length = 0;
14
15 Rva() = default;
16
17 inline Rva(const void *addr, size_t len) : address(addr), length(len) {}
18
19 template<class T>
20 inline T *at(size_t offset) noexcept {
21 if (offset + sizeof(T) > length) {
22 return nullptr;
23 } else {
24 return (T *) (((char *) address) + offset);
25 }
26 }
27
28 template<class T>
29 inline const T *at(size_t offset) const noexcept {
30 if (offset + sizeof(T) > length) {
31 return nullptr;
32 } else {
33 return (const T *) (((const char *) address) + offset);
34 }
35 }
36
37 template<class T>
38 inline bool access(size_t offset) const noexcept {
39 if (offset + sizeof(T) > length) {
40 return false;
41 } else {
42 return true;
43 }
44 }
45};
46
47#endif //RPCPROTOCOL_RVA_H

Callers 1

lookupFileLogLogsEnabledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected