1 //===-- TypeCategoryMap.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_TypeCategoryMap_h_
11 #define lldb_TypeCategoryMap_h_
16 // Other libraries and framework includes
18 #include "lldb/lldb-public.h"
19 #include "lldb/lldb-enumerations.h"
21 #include "lldb/DataFormatters/FormattersContainer.h"
22 #include "lldb/DataFormatters/TypeCategory.h"
24 namespace lldb_private {
28 typedef ConstString KeyType;
29 typedef TypeCategoryImpl ValueType;
30 typedef ValueType::SharedPointer ValueSP;
31 typedef std::list<lldb::TypeCategoryImplSP> ActiveCategoriesList;
32 typedef ActiveCategoriesList::iterator ActiveCategoriesIterator;
35 typedef std::map<KeyType, ValueSP> MapType;
36 typedef MapType::iterator MapIterator;
37 typedef bool(*CallbackType)(void*, const ValueSP&);
38 typedef uint32_t Position;
40 static const Position First = 0;
41 static const Position Default = 1;
42 static const Position Last = UINT32_MAX;
44 TypeCategoryMap (IFormatChangeListener* lst);
48 const ValueSP& entry);
51 Delete (KeyType name);
54 Enable (KeyType category_name,
55 Position pos = Default);
58 Disable (KeyType category_name);
61 Enable (ValueSP category,
62 Position pos = Default);
65 Disable (ValueSP category);
68 EnableAllCategories ();
71 DisableAllCategories ();
85 LoopThrough (CallbackType callback, void* param);
87 lldb::TypeCategoryImplSP
88 GetAtIndex (uint32_t);
91 AnyMatches (ConstString type_name,
92 TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
93 bool only_enabled = true,
94 const char** matching_category = NULL,
95 TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
103 lldb::TypeFormatImplSP
104 GetFormat (ValueObject& valobj,
105 lldb::DynamicValueType use_dynamic);
107 lldb::TypeSummaryImplSP
108 GetSummaryFormat (ValueObject& valobj,
109 lldb::DynamicValueType use_dynamic);
111 #ifndef LLDB_DISABLE_PYTHON
112 lldb::SyntheticChildrenSP
113 GetSyntheticChildren (ValueObject& valobj,
114 lldb::DynamicValueType use_dynamic);
117 lldb::TypeValidatorImplSP
118 GetValidator (ValueObject& valobj,
119 lldb::DynamicValueType use_dynamic);
123 class delete_matching_categories
125 lldb::TypeCategoryImplSP ptr;
127 delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)
130 bool operator()(const lldb::TypeCategoryImplSP& other)
132 return ptr.get() == other.get();
137 IFormatChangeListener* listener;
140 ActiveCategoriesList m_active_categories;
147 ActiveCategoriesList& active_list ()
149 return m_active_categories;
157 friend class FormattersContainer<KeyType, ValueType>;
158 friend class FormatManager;
160 } // namespace lldb_private
162 #endif // lldb_TypeCategoryMap_h_