Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::SymbolTraits Class Reference

#include <canonical_tables.h>

Static Public Member Functions

static const char * Name ()
 
static bool ReportStats ()
 
static bool IsMatch (const Object &a, const Object &b)
 
template<typename CharType >
static bool IsMatch (const CharArray< CharType > &array, const Object &obj)
 
static bool IsMatch (const StringSlice &slice, const Object &obj)
 
static bool IsMatch (const ConcatString &concat, const Object &obj)
 
static uword Hash (const Object &key)
 
template<typename CharType >
static uword Hash (const CharArray< CharType > &array)
 
static uword Hash (const StringSlice &slice)
 
static uword Hash (const ConcatString &concat)
 
template<typename CharType >
static ObjectPtr NewKey (const CharArray< CharType > &array)
 
static ObjectPtr NewKey (const StringSlice &slice)
 
static ObjectPtr NewKey (const ConcatString &concat)
 

Detailed Description

Definition at line 88 of file canonical_tables.h.

Member Function Documentation

◆ Hash() [1/4]

template<typename CharType >
static uword dart::SymbolTraits::Hash ( const CharArray< CharType > &  array)
inlinestatic

Definition at line 120 of file canonical_tables.h.

120 {
121 return array.Hash();
122 }

◆ Hash() [2/4]

static uword dart::SymbolTraits::Hash ( const ConcatString concat)
inlinestatic

Definition at line 124 of file canonical_tables.h.

124{ return concat.Hash(); }

◆ Hash() [3/4]

static uword dart::SymbolTraits::Hash ( const Object key)
inlinestatic

Definition at line 118 of file canonical_tables.h.

118{ return String::Cast(key).Hash(); }

◆ Hash() [4/4]

static uword dart::SymbolTraits::Hash ( const StringSlice slice)
inlinestatic

Definition at line 123 of file canonical_tables.h.

123{ return slice.Hash(); }

◆ IsMatch() [1/4]

template<typename CharType >
static bool dart::SymbolTraits::IsMatch ( const CharArray< CharType > &  array,
const Object obj 
)
inlinestatic

Definition at line 109 of file canonical_tables.h.

109 {
110 return array.Equals(String::Cast(obj));
111 }

◆ IsMatch() [2/4]

static bool dart::SymbolTraits::IsMatch ( const ConcatString concat,
const Object obj 
)
inlinestatic

Definition at line 115 of file canonical_tables.h.

115 {
116 return concat.Equals(String::Cast(obj));
117 }

◆ IsMatch() [3/4]

static bool dart::SymbolTraits::IsMatch ( const Object a,
const Object b 
)
inlinestatic

Definition at line 93 of file canonical_tables.h.

93 {
94 const String& a_str = String::Cast(a);
95 const String& b_str = String::Cast(b);
96 ASSERT(a_str.HasHash());
97 ASSERT(b_str.HasHash());
98 if (a_str.Hash() != b_str.Hash()) {
99 return false;
100 }
101 intptr_t a_len = a_str.Length();
102 if (a_len != b_str.Length()) {
103 return false;
104 }
105 // Use a comparison which does not consider the state of the canonical bit.
106 return a_str.Equals(b_str, 0, a_len);
107 }
#define ASSERT(E)
static bool b
struct MyStruct a[10]

◆ IsMatch() [4/4]

static bool dart::SymbolTraits::IsMatch ( const StringSlice slice,
const Object obj 
)
inlinestatic

Definition at line 112 of file canonical_tables.h.

112 {
113 return slice.Equals(String::Cast(obj));
114 }

◆ Name()

static const char * dart::SymbolTraits::Name ( )
inlinestatic

Definition at line 90 of file canonical_tables.h.

90{ return "SymbolTraits"; }

◆ NewKey() [1/3]

template<typename CharType >
static ObjectPtr dart::SymbolTraits::NewKey ( const CharArray< CharType > &  array)
inlinestatic

Definition at line 126 of file canonical_tables.h.

126 {
127 return array.ToSymbol();
128 }

◆ NewKey() [2/3]

static ObjectPtr dart::SymbolTraits::NewKey ( const ConcatString concat)
inlinestatic

Definition at line 130 of file canonical_tables.h.

130 {
131 return concat.ToSymbol();
132 }

◆ NewKey() [3/3]

static ObjectPtr dart::SymbolTraits::NewKey ( const StringSlice slice)
inlinestatic

Definition at line 129 of file canonical_tables.h.

129{ return slice.ToSymbol(); }

◆ ReportStats()

static bool dart::SymbolTraits::ReportStats ( )
inlinestatic

Definition at line 91 of file canonical_tables.h.

91{ return false; }

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