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.

41 lines
1.2 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. // check if the instance has been created yet
  22. if (0 == _instance) {
  23. // if not, then create it
  24. _instance = new basicLogEngine;
  25. }
  26. // return the single instance
  27. return _instance;
  28. };
  29. bool basicLogEngine::attach( basicEvtDispatcher *EvtDsp ){
  30. m_vpDispatcherQueue.push_back( EvtDsp );
  31. };
  32. void basicLogEngine::logEvt(basicEvent *Evt ){
  33. for( pDispatcherQueue::iterator currentDispatcher = m_vpDispatcherQueue.begin(); currentDispatcher < m_vpDispatcherQueue.end(); currentDispatcher++ ){
  34. (*currentDispatcher)->dispatch( Evt );
  35. };
  36. };