Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Friends | List of all members
ui::AXTreeIDRegistry Class Reference

#include <ax_tree_id_registry.h>

Public Types

using FrameID = std::pair< int, int >
 

Public Member Functions

FrameID GetFrameID (const AXTreeID &ax_tree_id)
 
AXTreeID GetAXTreeID (FrameID frame_id)
 
AXActionHandlerBaseGetActionHandler (AXTreeID ax_tree_id)
 
void RemoveAXTreeID (AXTreeID ax_tree_id)
 
void SetFrameIDForAXTreeID (const FrameID &frame_id, const AXTreeID &ax_tree_id)
 

Static Public Member Functions

static AXTreeIDRegistryGetInstance ()
 

Private Member Functions

virtual ~AXTreeIDRegistry ()
 

Friends

struct base::DefaultSingletonTraits< AXTreeIDRegistry >
 

Detailed Description

Definition at line 34 of file ax_tree_id_registry.h.

Member Typedef Documentation

◆ FrameID

using ui::AXTreeIDRegistry::FrameID = std::pair<int, int>

Definition at line 36 of file ax_tree_id_registry.h.

Member Function Documentation

◆ GetActionHandler()

AXActionHandlerBase * ui::AXTreeIDRegistry::GetActionHandler ( AXTreeID  ax_tree_id)

Definition at line 57 of file ax_tree_id_registry.cc.

57 {
58 auto it = id_to_action_handler_.find(ax_tree_id);
59 if (it == id_to_action_handler_.end())
60 return nullptr;
61 return it->second;
62}

◆ GetAXTreeID()

AXTreeID ui::AXTreeIDRegistry::GetAXTreeID ( AXTreeIDRegistry::FrameID  frame_id)

Definition at line 39 of file ax_tree_id_registry.cc.

39 {
40 auto it = frame_to_ax_tree_id_map_.find(frame_id);
41 if (it != frame_to_ax_tree_id_map_.end())
42 return it->second;
43
44 return ui::AXTreeIDUnknown();
45}
const AXTreeID & AXTreeIDUnknown()
Definition: ax_tree_id.cc:103

◆ GetFrameID()

AXTreeIDRegistry::FrameID ui::AXTreeIDRegistry::GetFrameID ( const AXTreeID ax_tree_id)

Definition at line 30 of file ax_tree_id_registry.cc.

31 {
32 auto it = ax_tree_to_frame_id_map_.find(ax_tree_id);
33 if (it != ax_tree_to_frame_id_map_.end())
34 return it->second;
35
36 return FrameID(-1, -1);
37}
std::pair< int, int > FrameID

◆ GetInstance()

AXTreeIDRegistry & ui::AXTreeIDRegistry::GetInstance ( )
static

Definition at line 13 of file ax_tree_id_registry.cc.

13 {
14 static AXTreeIDRegistry INSTANCE;
15 return INSTANCE;
16}

◆ RemoveAXTreeID()

void ui::AXTreeIDRegistry::RemoveAXTreeID ( AXTreeID  ax_tree_id)

Definition at line 70 of file ax_tree_id_registry.cc.

70 {
71 auto frame_it = ax_tree_to_frame_id_map_.find(ax_tree_id);
72 if (frame_it != ax_tree_to_frame_id_map_.end()) {
73 frame_to_ax_tree_id_map_.erase(frame_it->second);
74 ax_tree_to_frame_id_map_.erase(frame_it);
75 }
76
77 auto action_it = id_to_action_handler_.find(ax_tree_id);
78 if (action_it != id_to_action_handler_.end())
79 id_to_action_handler_.erase(action_it);
80}

◆ SetFrameIDForAXTreeID()

void ui::AXTreeIDRegistry::SetFrameIDForAXTreeID ( const FrameID frame_id,
const AXTreeID ax_tree_id 
)

Definition at line 18 of file ax_tree_id_registry.cc.

19 {
20 auto it = frame_to_ax_tree_id_map_.find(frame_id);
21 if (it != frame_to_ax_tree_id_map_.end()) {
23 return;
24 }
25
26 frame_to_ax_tree_id_map_[frame_id] = ax_tree_id;
27 ax_tree_to_frame_id_map_[ax_tree_id] = frame_id;
28}
#define BASE_UNREACHABLE()
Definition: logging.h:69

◆ ~AXTreeIDRegistry()

ui::AXTreeIDRegistry::~AXTreeIDRegistry ( )
privatevirtual

Definition at line 84 of file ax_tree_id_registry.cc.

84{}

Friends And Related Function Documentation

◆ base::DefaultSingletonTraits< AXTreeIDRegistry >

Definition at line 55 of file ax_tree_id_registry.h.


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