Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/errorlogger.cpp

    rc5f836 red58ad  
    99#include "errorlogger.hpp"
    1010#include "verbose.hpp"
     11#include "Patterns/Singleton_impl.hpp"
    1112
    1213ofstream null("/dev/null");
    13 
    14 errorLogger* errorLogger::instance = NULL;
    1514int errorLogger::verbosity = 2;
    1615ostream* errorLogger::nix = &null;
     
    2322errorLogger::errorLogger()
    2423{
    25   instance = NULL;
    2624  verbosity = 2;
    2725};
     
    3432}
    3533
    36 /**
    37  * Returns the singleton errorLogger instance.
    38  *
    39  * \return errorLogger instance
    40  */
    41 errorLogger* errorLogger::getInstance() {
    42   if (instance == NULL) {
    43     instance = new errorLogger();
    44   }
    45 
    46   return instance;
    47 }
    48 
    49 
    50 /**
    51  * Purges the current errorLogger instance.
    52  */
    53 void errorLogger::purgeInstance() {
    54   if (instance != NULL) {
    55     delete instance;
    56   }
    57 
    58   instance = NULL;
    59 }
     34CONSTRUCT_SINGLETON(errorLogger)
    6035
    6136/**
Note: See TracChangeset for help on using the changeset viewer.