Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lexy::buffer< Encoding, MemoryResource > Class Template Reference

#include <buffer.hpp>

Classes

class  builder
 Allows the creation of an uninitialized buffer that is then filled by the user. More...
 

Public Types

using char_type = typename encoding::char_type
 
using encoding = Encoding
 

Public Member Functions

constexpr buffer () noexcept
 
 buffer (buffer &&other) noexcept
 
 buffer (const buffer &other)
 
 buffer (const buffer &other, MemoryResource *resource)
 
 buffer (const char_type *begin, const char_type *end, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 
 buffer (const char_type *data, std::size_t size, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 
template<typename CharT , typename = _detail::require_secondary_char_type<encoding, CharT>>
 buffer (const CharT *begin, const CharT *end, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 
template<typename CharT , typename = _detail::require_secondary_char_type<encoding, CharT>>
 buffer (const CharT *data, std::size_t size, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 
template<typename View , typename = decltype(LEXY_DECLVAL(View).data())>
 buffer (const View &view, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 
constexpr buffer (MemoryResource *resource) noexcept
 
const char_typedata () const noexcept
 
bufferoperator= (buffer &&other) noexcept(std::is_empty_v< MemoryResource >)
 
bufferoperator= (const buffer &other)
 
auto reader () const &noexcept
 
std::size_t size () const noexcept
 
 ~buffer () noexcept
 

Private Member Functions

char_typeallocate (std::size_t size) const
 

Private Attributes

char_type_data
 
LEXY_EMPTY_MEMBER _detail::memory_resource_ptr< MemoryResource > _resource
 
std::size_t _size
 

Static Private Attributes

static constexpr auto _has_sentinel = std::is_same_v<typename Encoding::char_type, typename Encoding::int_type>
 

Detailed Description

template<typename Encoding = default_encoding, typename MemoryResource = void>
class lexy::buffer< Encoding, MemoryResource >

Stores the input that will be parsed. For encodings with spare code points, it can append an EOF sentinel. This allows branch-less detection of EOF.

Definition at line 81 of file buffer.hpp.

Member Typedef Documentation

◆ char_type

template<typename Encoding = default_encoding, typename MemoryResource = void>
using lexy::buffer< Encoding, MemoryResource >::char_type = typename encoding::char_type

Definition at line 88 of file buffer.hpp.

◆ encoding

template<typename Encoding = default_encoding, typename MemoryResource = void>
using lexy::buffer< Encoding, MemoryResource >::encoding = Encoding

Definition at line 87 of file buffer.hpp.

Constructor & Destructor Documentation

◆ buffer() [1/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
constexpr lexy::buffer< Encoding, MemoryResource >::buffer ( )
inlineconstexprnoexcept

Definition at line 122 of file buffer.hpp.

◆ buffer() [2/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
constexpr lexy::buffer< Encoding, MemoryResource >::buffer ( MemoryResource *  resource)
inlineexplicitconstexprnoexcept

Definition at line 124 of file buffer.hpp.

◆ buffer() [3/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::buffer ( const char_type data,
std::size_t  size,
MemoryResource *  resource = _detail::get_memory_resource<MemoryResource>() 
)
inlineexplicit

Definition at line 128 of file buffer.hpp.

◆ buffer() [4/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::buffer ( const char_type begin,
const char_type end,
MemoryResource *  resource = _detail::get_memory_resource<MemoryResource>() 
)
inlineexplicit

Definition at line 136 of file buffer.hpp.

◆ buffer() [5/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
template<typename CharT , typename = _detail::require_secondary_char_type<encoding, CharT>>
lexy::buffer< Encoding, MemoryResource >::buffer ( const CharT *  data,
std::size_t  size,
MemoryResource *  resource = _detail::get_memory_resource<MemoryResource>() 
)
inlineexplicit

Definition at line 142 of file buffer.hpp.

◆ buffer() [6/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
template<typename CharT , typename = _detail::require_secondary_char_type<encoding, CharT>>
lexy::buffer< Encoding, MemoryResource >::buffer ( const CharT *  begin,
const CharT *  end,
MemoryResource *  resource = _detail::get_memory_resource<MemoryResource>() 
)
inlineexplicit

Definition at line 149 of file buffer.hpp.

◆ buffer() [7/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
template<typename View , typename = decltype(LEXY_DECLVAL(View).data())>
lexy::buffer< Encoding, MemoryResource >::buffer ( const View &  view,
MemoryResource *  resource = _detail::get_memory_resource<MemoryResource>() 
)
inlineexplicit

Definition at line 158 of file buffer.hpp.

◆ buffer() [8/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::buffer ( const buffer< Encoding, MemoryResource > &  other)
inline

Definition at line 163 of file buffer.hpp.

◆ buffer() [9/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::buffer ( const buffer< Encoding, MemoryResource > &  other,
MemoryResource *  resource 
)
inline

Definition at line 164 of file buffer.hpp.

◆ buffer() [10/10]

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::buffer ( buffer< Encoding, MemoryResource > &&  other)
inlinenoexcept

Definition at line 168 of file buffer.hpp.

◆ ~buffer()

template<typename Encoding = default_encoding, typename MemoryResource = void>
lexy::buffer< Encoding, MemoryResource >::~buffer ( )
inlinenoexcept

Definition at line 175 of file buffer.hpp.

Member Function Documentation

◆ allocate()

template<typename Encoding = default_encoding, typename MemoryResource = void>
char_type* lexy::buffer< Encoding, MemoryResource >::allocate ( std::size_t  size) const
inlineprivate

Definition at line 240 of file buffer.hpp.

◆ data()

template<typename Encoding = default_encoding, typename MemoryResource = void>
const char_type* lexy::buffer< Encoding, MemoryResource >::data ( ) const
inlinenoexcept

Definition at line 220 of file buffer.hpp.

◆ operator=() [1/2]

template<typename Encoding = default_encoding, typename MemoryResource = void>
buffer& lexy::buffer< Encoding, MemoryResource >::operator= ( buffer< Encoding, MemoryResource > &&  other)
inlinenoexcept

Definition at line 197 of file buffer.hpp.

◆ operator=() [2/2]

template<typename Encoding = default_encoding, typename MemoryResource = void>
buffer& lexy::buffer< Encoding, MemoryResource >::operator= ( const buffer< Encoding, MemoryResource > &  other)
inline

Definition at line 188 of file buffer.hpp.

◆ reader()

template<typename Encoding = default_encoding, typename MemoryResource = void>
auto lexy::buffer< Encoding, MemoryResource >::reader ( ) const &
inlinenoexcept

Definition at line 231 of file buffer.hpp.

◆ size()

template<typename Encoding = default_encoding, typename MemoryResource = void>
std::size_t lexy::buffer< Encoding, MemoryResource >::size ( ) const
inlinenoexcept

Definition at line 225 of file buffer.hpp.

Member Data Documentation

◆ _data

template<typename Encoding = default_encoding, typename MemoryResource = void>
char_type* lexy::buffer< Encoding, MemoryResource >::_data
private

Definition at line 261 of file buffer.hpp.

◆ _has_sentinel

template<typename Encoding = default_encoding, typename MemoryResource = void>
constexpr auto lexy::buffer< Encoding, MemoryResource >::_has_sentinel = std::is_same_v<typename Encoding::char_type, typename Encoding::int_type>
staticconstexprprivate

Definition at line 84 of file buffer.hpp.

◆ _resource

template<typename Encoding = default_encoding, typename MemoryResource = void>
LEXY_EMPTY_MEMBER _detail::memory_resource_ptr<MemoryResource> lexy::buffer< Encoding, MemoryResource >::_resource
private

Definition at line 260 of file buffer.hpp.

◆ _size

template<typename Encoding = default_encoding, typename MemoryResource = void>
std::size_t lexy::buffer< Encoding, MemoryResource >::_size
private

Definition at line 262 of file buffer.hpp.


The documentation for this class was generated from the following file:


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:09