LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
Object.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_OBJECT_H
17
#define LIEF_OBJECT_H
18
#include <type_traits>
19
#include "
LIEF/visibility.h
"
20
21
namespace
LIEF
{
22
23
class
Visitor
;
24
25
class
LIEF_API
Object
{
26
27
template
<
class
T>
28
using
add_pointer_t =
typename
std::add_pointer<T>::type;
29
30
template
<
class
T>
31
using
decay_t =
typename
std::decay<T>::type;
32
33
template
<
class
T>
34
using
add_const_t =
typename
std::add_const<T>::type;
35
36
public
:
37
template
<
class
T>
38
using
output_t
= add_pointer_t<decay_t<T>>;
39
40
template
<
class
T>
41
using
output_const_t
= add_pointer_t<add_const_t<decay_t<T>>>;
42
43
public
:
44
Object
();
45
Object
(
const
Object
& other);
46
Object
&
operator=
(
const
Object
& other);
47
48
Object
(
Object
&& other)
noexcept
=
default
;
49
Object
&
operator=
(
Object
&& other)
noexcept
=
default
;
50
51
template
<
class
T>
52
LIEF_LOCAL
output_t<T>
as
();
53
54
template
<
class
T>
55
LIEF_LOCAL
output_const_t<T>
as
()
const
;
56
57
virtual
bool
operator==
(
const
Object
& other)
const
;
58
virtual
bool
operator!=
(
const
Object
& other)
const
{
59
return
!(*
this
== other);
60
}
61
62
virtual
~Object
();
63
virtual
void
accept
(
Visitor
& visitor)
const
= 0;
64
};
65
}
66
67
#endif
LIEF::Object::accept
virtual void accept(Visitor &visitor) const =0
LIEF::Object::~Object
virtual ~Object()
LIEF::Object::output_const_t
add_pointer_t< add_const_t< decay_t< T > > > output_const_t
Definition
Object.hpp:41
LIEF::Object::Object
Object(const Object &other)
LIEF::Object::as
output_t< T > as()
LIEF::Object::operator==
virtual bool operator==(const Object &other) const
LIEF::Object::Object
Object()
LIEF::Object::operator=
Object & operator=(Object &&other) noexcept=default
LIEF::Object::operator!=
virtual bool operator!=(const Object &other) const
Definition
Object.hpp:58
LIEF::Object::operator=
Object & operator=(const Object &other)
LIEF::Object::output_t
add_pointer_t< decay_t< T > > output_t
Definition
Object.hpp:38
LIEF::Object::as
output_const_t< T > as() const
LIEF::Object::Object
Object(Object &&other) noexcept=default
LIEF::Visitor
Definition
Visitor.hpp:210
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
LIEF_LOCAL
#define LIEF_LOCAL
Definition
visibility.h:42
Generated by
1.17.0