1
This commit is contained in:
parent
48be5120bc
commit
f95d61c75f
@ -4,7 +4,20 @@
|
|||||||
|
|
||||||
IMPL_TABLE(mt::SafeArea)
|
IMPL_TABLE(mt::SafeArea)
|
||||||
|
|
||||||
|
std::map<int, const mt::SafeArea*> mt::SafeArea::type_hash_;
|
||||||
|
|
||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void SafeArea::Init1()
|
||||||
|
{
|
||||||
|
type_hash_[type()] = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SafeArea* SafeArea::GetByType(int type)
|
||||||
|
{
|
||||||
|
auto itr = type_hash_.find(type);
|
||||||
|
return itr != type_hash_.end() ? itr->second : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,11 @@ namespace mt
|
|||||||
"id")
|
"id")
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static const SafeArea* GetByType(int type) {};
|
void Init1();
|
||||||
|
static const SafeArea* GetByType(int type);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::map<int, const SafeArea*> type_hash_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user