Classes | Public Types | Public Member Functions | Static 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
 
const char_typerelease () &&noexcept
 
std::size_t size () const noexcept
 
 ~buffer () noexcept
 

Static Public Member Functions

static buffer adopt (const char_type *data, std::size_t size, MemoryResource *resource=_detail::get_memory_resource< MemoryResource >())
 

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 95 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 103 of file buffer.hpp.

◆ encoding

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

Definition at line 102 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 148 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 150 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 154 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 162 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 168 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 175 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 184 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 189 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 190 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 194 of file buffer.hpp.

◆ ~buffer()

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

Definition at line 201 of file buffer.hpp.

Member Function Documentation

◆ adopt()

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

Definition at line 137 of file buffer.hpp.

◆ 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 274 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 246 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 223 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 214 of file buffer.hpp.

◆ reader()

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

Definition at line 265 of file buffer.hpp.

◆ release()

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

Definition at line 256 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 251 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 295 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 99 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 294 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 296 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 Dec 13 2024 03:19:19