Go to the documentation of this file.
15#ifndef LIEF_OBJC_PROTOCOL_H
16#define LIEF_OBJC_PROTOCOL_H
40 using iterator_category = std::bidirectional_iterator_tag;
41 using value_type = std::unique_ptr<Protocol>;
42 using difference_type = std::ptrdiff_t;
43 using pointer = Protocol*;
44 using reference = std::unique_ptr<Protocol>&;
45 using implementation = details::ProtocolIt;
49 friend class Iterator;
56 template <
typename RefT>
57 PointerProxy(RefT &&R) : R(std::forward<RefT>(R)) {}
62 Iterator(std::unique_ptr<details::ProtocolIt> impl);
65 friend
LIEF_API bool operator==(const Iterator& LHS, const Iterator& RHS);
67 friend
LIEF_API bool operator!=(const Iterator& LHS, const Iterator& RHS) {
75 Iterator tmp = *
static_cast<Iterator*
>(
this);
76 --*
static_cast<Iterator *
>(
this);
81 Iterator tmp = *
static_cast<Iterator*
>(
this);
82 ++*
static_cast<Iterator *
>(
this);
89 return static_cast<const Iterator*
>(
this)->
operator*();
93 std::unique_ptr<details::ProtocolIt> impl_;
97 using methods_it = iterator_range<Method::Iterator>;
98 using properties_it = iterator_range<Property::Iterator>;
113 std::string
to_decl(
const DeclOpt& opt = DeclOpt())
const;
121 std::unique_ptr<details::Protocol> impl_;
pointer operator->() const
Definition Protocol.hpp:51
Iterator(Iterator &&) noexcept
Iterator(const Iterator &)
std::unique_ptr< Protocol > operator*() const
Iterator operator--(int)
Definition Protocol.hpp:74
Iterator operator++(int)
Definition Protocol.hpp:80
PointerProxy operator->() const
Definition Protocol.hpp:88
This class represents an Objective-C @protocol
Definition Protocol.hpp:36
std::string to_decl(const DeclOpt &opt=DeclOpt()) const
Generate a header-like string for this specific protocol.
methods_it optional_methods() const
Iterator over the methods that could be overridden.
methods_it required_methods() const
Iterator over the methods of this protocol that must be implemented.
properties_it properties() const
Iterator over the properties defined in this protocol.
Protocol(std::unique_ptr< details::Protocol > impl)
std::string mangled_name() const
Mangled name of the protocol.
Definition ObjC/Class.hpp:32
Namespace related to ObjC metadata.
Definition MachO/Binary.hpp:41
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41