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);
79 LoopThrough (CallbackType callback, void* param);
81 lldb::TypeCategoryImplSP
82 GetAtIndex (uint32_t);
85 AnyMatches (ConstString type_name,
86 TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
87 bool only_enabled = true,
88 const char** matching_category = NULL,
89 TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
97 lldb::TypeFormatImplSP
98 GetFormat (ValueObject& valobj,
99 lldb::DynamicValueType use_dynamic);
101 lldb::TypeSummaryImplSP
102 GetSummaryFormat (ValueObject& valobj,
103 lldb::DynamicValueType use_dynamic);
105 #ifndef LLDB_DISABLE_PYTHON
106 lldb::SyntheticChildrenSP
107 GetSyntheticChildren (ValueObject& valobj,
108 lldb::DynamicValueType use_dynamic);
113 class delete_matching_categories
115 lldb::TypeCategoryImplSP ptr;
117 delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)
120 bool operator()(const lldb::TypeCategoryImplSP& other)
122 return ptr.get() == other.get();
127 IFormatChangeListener* listener;
130 ActiveCategoriesList m_active_categories;
137 ActiveCategoriesList& active_list ()
139 return m_active_categories;
147 friend class FormattersContainer<KeyType, ValueType>;
148 friend class FormatManager;
150 } // namespace lldb_private
152 #endif // lldb_TypeCategoryMap_h_