You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Dr.Frucht Systems Ltd.
  3. // Copyright � 2000-2016. All Rights Reserved.
  4. // Version 2.0 3/30/2016
  5. // Last modification: 3/30/2016
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: basicLogEngine.cpp
  9. // AUTHOR: gagua
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of basicLogEngine.cpp
  13. //----------------------------------------------------------------------------
  14. //
  15. #include "basicLogEngine.h"
  16. basicLogEngine * basicLogEngine::_instance = 0;
  17. /**
  18. * Returns the single instance of the object.
  19. */
  20. basicLogEngine * basicLogEngine::getInstance()
  21. {
  22. // check if the instance has been created yet
  23. if (0 == _instance)
  24. {
  25. // if not, then create it
  26. _instance = new basicLogEngine;
  27. }
  28. // return the single instance
  29. return _instance;
  30. }
  31. bool basicLogEngine::attach(basicEvtDispatcher * EvtDsp)
  32. {
  33. m_vpDispatcherQueue.push_back(EvtDsp);
  34. }
  35. void basicLogEngine::logEvt(basicEvent * Evt)
  36. {
  37. for (pDispatcherQueue::iterator currentDispatcher = m_vpDispatcherQueue.begin(); currentDispatcher < m_vpDispatcherQueue.end(); currentDispatcher++)
  38. {
  39. (*currentDispatcher)->dispatch(Evt);
  40. };
  41. }