Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTPedestalFollowingFactory.cpp.svn-base
@iaro iaro on 9 May 2016 994 bytes first attempt of automated anal
  1. /*
  2. * PedestalFollowingFactory.cpp
  3. *
  4. * Created on: Oct 10, 2014
  5. * Author: ADendek
  6. */
  7.  
  8.  
  9. #include "TbUTPedestalFollowingFactory.h"
  10. #include "TbUTPedestalCalculator.h"
  11. #include "TbUTPedestalRetreiver.h"
  12.  
  13. using namespace TbUT;
  14.  
  15. PedestalFollowingFactory::PedestalFollowingFactory(IChannelMaskProvider& p_chanelMaskProvider,Pedestal &p_pedestal , IFileValidator& p_fileValidator, const std::string& p_filename):
  16. m_chanelMaskProvider(p_chanelMaskProvider),
  17. m_pedestal(p_pedestal),
  18. m_fileValidator(p_fileValidator),
  19. m_filename(p_filename)
  20. {
  21. }
  22.  
  23.  
  24. IPedestalFollowing* PedestalFollowingFactory::createPedestalFollowing(const std::string& p_followingType)
  25. {
  26. if(!p_followingType.compare(TbUT::FollowingOptions::Calculator.c_str()))
  27. return new PedestalCalculator(m_chanelMaskProvider, m_pedestal);
  28. else if(!p_followingType.compare(TbUT::FollowingOptions::File.c_str()))
  29. return new PedestalRetreiver(m_pedestal,m_fileValidator,m_filename);
  30. else
  31. throw NoSuchState(p_followingType);
  32. }