LLDB mainline
Public Types | Public Member Functions | Private Attributes | List of all members
lldb_private::TieredFormatterContainer< FormatterImpl > Class Template Reference

#include <TypeCategory.h>

Inheritance diagram for lldb_private::TieredFormatterContainer< FormatterImpl >:
Inheritance graph
[legend]

Public Types

using Subcontainer = FormattersContainer< FormatterImpl >
 
using SubcontainerSP = std::shared_ptr< Subcontainer >
 
using ForEachCallback = typename Subcontainer::ForEachCallback
 
using MapValueType = typename Subcontainer::ValueSP
 

Public Member Functions

 TieredFormatterContainer (IFormatChangeListener *change_listener)
 
void Clear ()
 Clears all subcontainers.
 
void Add (lldb::TypeNameSpecifierImplSP type_sp, std::shared_ptr< FormatterImpl > format_sp)
 Adds a formatter to the right subcontainer depending on the matching type specified by type_sp.
 
bool Delete (lldb::TypeNameSpecifierImplSP type_sp)
 Deletes the formatter specified by type_sp.
 
bool Delete (ConstString name)
 Deletes all formatters registered with the string name, in all subcontainers.
 
uint32_t GetCount ()
 Returns the total count of elements across all subcontainers.
 
MapValueType GetAtIndex (size_t index)
 Returns the formatter at index, simulating a flattened view of all subcontainers in priority order.
 
bool Get (const FormattersMatchVector &candidates, std::shared_ptr< FormatterImpl > &entry)
 Looks for a matching candidate across all priority tiers, in priority order.
 
bool AnyMatches (const FormattersMatchCandidate &candidate)
 
MapValueType GetForTypeNameSpecifier (lldb::TypeNameSpecifierImplSP type_specifier_sp)
 Returns a formatter that is an exact match for type_specifier_sp.
 
lldb::TypeNameSpecifierImplSP GetTypeNameSpecifierAtIndex (size_t index)
 Returns the type name specifier at index, simulating a flattened view of all subcontainers in priority order.
 
void ForEach (std::function< bool(const TypeMatcher &, const std::shared_ptr< FormatterImpl > &)> callback)
 Iterates through tiers in order, running callback on each element of each tier.
 
void AutoComplete (CompletionRequest &request)
 

Private Attributes

std::array< std::shared_ptr< Subcontainer >, lldb::eLastFormatterMatchType+1 > m_subcontainers
 

Detailed Description

template<typename FormatterImpl>
class lldb_private::TieredFormatterContainer< FormatterImpl >

Definition at line 36 of file TypeCategory.h.

Member Typedef Documentation

◆ ForEachCallback

template<typename FormatterImpl >
using lldb_private::TieredFormatterContainer< FormatterImpl >::ForEachCallback = typename Subcontainer::ForEachCallback

Definition at line 40 of file TypeCategory.h.

◆ MapValueType

template<typename FormatterImpl >
using lldb_private::TieredFormatterContainer< FormatterImpl >::MapValueType = typename Subcontainer::ValueSP

Definition at line 41 of file TypeCategory.h.

◆ Subcontainer

template<typename FormatterImpl >
using lldb_private::TieredFormatterContainer< FormatterImpl >::Subcontainer = FormattersContainer<FormatterImpl>

Definition at line 38 of file TypeCategory.h.

◆ SubcontainerSP

template<typename FormatterImpl >
using lldb_private::TieredFormatterContainer< FormatterImpl >::SubcontainerSP = std::shared_ptr<Subcontainer>

Definition at line 39 of file TypeCategory.h.

Constructor & Destructor Documentation

◆ TieredFormatterContainer()

template<typename FormatterImpl >
lldb_private::TieredFormatterContainer< FormatterImpl >::TieredFormatterContainer ( IFormatChangeListener change_listener)
inline

Member Function Documentation

◆ Add()

template<typename FormatterImpl >
void lldb_private::TieredFormatterContainer< FormatterImpl >::Add ( lldb::TypeNameSpecifierImplSP  type_sp,
std::shared_ptr< FormatterImpl >  format_sp 
)
inline

◆ AnyMatches()

template<typename FormatterImpl >
bool lldb_private::TieredFormatterContainer< FormatterImpl >::AnyMatches ( const FormattersMatchCandidate candidate)
inline

◆ AutoComplete()

template<typename FormatterImpl >
void lldb_private::TieredFormatterContainer< FormatterImpl >::AutoComplete ( CompletionRequest request)
inline

◆ Clear()

template<typename FormatterImpl >
void lldb_private::TieredFormatterContainer< FormatterImpl >::Clear ( )
inline

Clears all subcontainers.

Definition at line 49 of file TypeCategory.h.

References lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers.

Referenced by lldb_private::TypeCategoryImpl::Clear().

◆ Delete() [1/2]

template<typename FormatterImpl >
bool lldb_private::TieredFormatterContainer< FormatterImpl >::Delete ( ConstString  name)
inline

Deletes all formatters registered with the string name, in all subcontainers.

Definition at line 70 of file TypeCategory.h.

References lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers.

◆ Delete() [2/2]

template<typename FormatterImpl >
bool lldb_private::TieredFormatterContainer< FormatterImpl >::Delete ( lldb::TypeNameSpecifierImplSP  type_sp)
inline

◆ ForEach()

template<typename FormatterImpl >
void lldb_private::TieredFormatterContainer< FormatterImpl >::ForEach ( std::function< bool(const TypeMatcher &, const std::shared_ptr< FormatterImpl > &)>  callback)
inline

Iterates through tiers in order, running callback on each element of each tier.

Definition at line 149 of file TypeCategory.h.

References lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers.

Referenced by lldb_private::TypeCategoryImpl::ForEach().

◆ Get()

template<typename FormatterImpl >
bool lldb_private::TieredFormatterContainer< FormatterImpl >::Get ( const FormattersMatchVector candidates,
std::shared_ptr< FormatterImpl > &  entry 
)
inline

Looks for a matching candidate across all priority tiers, in priority order.

If a match is found, returns true and puts the matching entry in entry.

Definition at line 99 of file TypeCategory.h.

References lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers.

Referenced by lldb_private::TypeCategoryImpl::Get().

◆ GetAtIndex()

template<typename FormatterImpl >
MapValueType lldb_private::TieredFormatterContainer< FormatterImpl >::GetAtIndex ( size_t  index)
inline

◆ GetCount()

template<typename FormatterImpl >
uint32_t lldb_private::TieredFormatterContainer< FormatterImpl >::GetCount ( )
inline

◆ GetForTypeNameSpecifier()

template<typename FormatterImpl >
MapValueType lldb_private::TieredFormatterContainer< FormatterImpl >::GetForTypeNameSpecifier ( lldb::TypeNameSpecifierImplSP  type_specifier_sp)
inline

Returns a formatter that is an exact match for type_specifier_sp.

It looks for a formatter with the same matching type that was created from the same string. This is useful so we can refer to a formatter using the same string used to register it.

For example, type_specifier_sp can be something like {"std::vector<.*>", eFormatterMatchRegex}, and we'd look for a regex matcher with that exact regex string, NOT try to match that string using regex.

Definition at line 127 of file TypeCategory.h.

References lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers.

Referenced by lldb_private::TypeCategoryImpl::GetFilterForType(), lldb_private::TypeCategoryImpl::GetFormatForType(), lldb_private::TypeCategoryImpl::GetSummaryForType(), and lldb_private::TypeCategoryImpl::GetSyntheticForType().

◆ GetTypeNameSpecifierAtIndex()

template<typename FormatterImpl >
lldb::TypeNameSpecifierImplSP lldb_private::TieredFormatterContainer< FormatterImpl >::GetTypeNameSpecifierAtIndex ( size_t  index)
inline

Member Data Documentation

◆ m_subcontainers

template<typename FormatterImpl >
std::array<std::shared_ptr<Subcontainer>, lldb::eLastFormatterMatchType + 1> lldb_private::TieredFormatterContainer< FormatterImpl >::m_subcontainers
private

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