Skip to content

Commit

Permalink
Made KeyType a using declaration and renamed it to key_type.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBx committed Sep 20, 2014
1 parent ef79e66 commit 88d2f93
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Ext/_Container.hpp
Expand Up @@ -134,9 +134,9 @@ class Container {
private:
using base_type = typename T::TT;
using extension_type = typename T::ExtData;
typedef base_type* KeyType;
using key_type = base_type*;
using value_type = extension_type*;
using map_type = std::unordered_map<KeyType, std::unique_ptr<extension_type>>;
using map_type = std::unordered_map<key_type, std::unique_ptr<extension_type>>;

map_type Items;

Expand Down Expand Up @@ -168,7 +168,7 @@ class Container {

virtual ~Container() = default;

value_type FindOrAllocate(KeyType key) {
value_type FindOrAllocate(key_type key) {
if(key == nullptr) {
const auto &info = typeid(*this);
Debug::Log("CTOR of %s attempted for a NULL pointer! WTF!\n", info.name());
Expand All @@ -183,15 +183,15 @@ class Container {
return i->second.get();
}

value_type Find(KeyType key) const {
value_type Find(key_type key) const {
auto i = this->Items.find(key);
if(i == this->Items.end()) {
return nullptr;
}
return i->second.get();
}

void Remove(KeyType key) {
void Remove(key_type key) {
auto i = this->Items.find(key);
if(i != this->Items.end()) {
this->Items.erase(i);
Expand All @@ -213,7 +213,7 @@ class Container {
}
}

void LoadFromINI(KeyType key, CCINIClass *pINI) {
void LoadFromINI(key_type key, CCINIClass *pINI) {
auto i = this->Items.find(key);
if(i != this->Items.end()) {
i->second->LoadFromINI(pINI);
Expand All @@ -226,7 +226,7 @@ class Container {
}
}

static void PrepareStream(KeyType key, IStream *pStm) {
static void PrepareStream(key_type key, IStream *pStm) {
const auto &info = typeid(base_type);
Debug::Log("[PrepareStream] Next is %p of type '%s'\n", key, info.name());

Expand Down Expand Up @@ -272,16 +272,16 @@ class Container {

protected:
// specialize this method to do type-specific stuff
bool Save(KeyType key, IStream *pStm) {
bool Save(key_type key, IStream *pStm) {
return this->SaveKey(key, pStm) != nullptr;
}

// specialize this method to do type-specific stuff
bool Load(KeyType key, IStream *pStm) {
bool Load(key_type key, IStream *pStm) {
return this->LoadKey(key, pStm) != nullptr;
}

value_type SaveKey(KeyType key, IStream *pStm) {
value_type SaveKey(key_type key, IStream *pStm) {
ULONG out;

if(key == nullptr) {
Expand All @@ -299,7 +299,7 @@ class Container {
return buffer;
};

value_type LoadKey(KeyType key, IStream *pStm) {
value_type LoadKey(key_type key, IStream *pStm) {
ULONG out;

if(key == nullptr) {
Expand Down

0 comments on commit 88d2f93

Please sign in to comment.