Electroneum
el::base::utils::Utils Class Reference

#include <easylogging++.h>

Static Public Member Functions

template<typename T , typename TPtr >
static bool installCallback (const std::string &id, std::unordered_map< std::string, TPtr > *mapT)
 
template<typename T , typename TPtr >
static void uninstallCallback (const std::string &id, std::unordered_map< std::string, TPtr > *mapT)
 
template<typename T , typename TPtr >
static Tcallback (const std::string &id, std::unordered_map< std::string, TPtr > *mapT)
 

Detailed Description

Definition at line 1554 of file easylogging++.h.

Member Function Documentation

◆ callback()

template<typename T , typename TPtr >
static T* el::base::utils::Utils::callback ( const std::string &  id,
std::unordered_map< std::string, TPtr > *  mapT 
)
inlinestatic

Definition at line 1573 of file easylogging++.h.

1573  {
1574  typename std::unordered_map<std::string, TPtr>::iterator iter = mapT->find(id);
1575  if (iter != mapT->end()) {
1576  return static_cast<T*>(iter->second.get());
1577  }
1578  return nullptr;
1579  }
const uint32_t T[512]

◆ installCallback()

template<typename T , typename TPtr >
static bool el::base::utils::Utils::installCallback ( const std::string &  id,
std::unordered_map< std::string, TPtr > *  mapT 
)
inlinestatic

Definition at line 1557 of file easylogging++.h.

1557  {
1558  if (mapT->find(id) == mapT->end()) {
1559  mapT->insert(std::make_pair(id, TPtr(new T())));
1560  return true;
1561  }
1562  return false;
1563  }
const uint32_t T[512]

◆ uninstallCallback()

template<typename T , typename TPtr >
static void el::base::utils::Utils::uninstallCallback ( const std::string &  id,
std::unordered_map< std::string, TPtr > *  mapT 
)
inlinestatic

Definition at line 1566 of file easylogging++.h.

1566  {
1567  if (mapT->find(id) != mapT->end()) {
1568  mapT->erase(id);
1569  }
1570  }

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