00001 /* 00002 * Unpublished Copyright (c) 2009-2018 AutonomouStuff, LLC, All Rights Reserved. 00003 * 00004 * This file is part of the PACMod ROS 1.0 driver which is released under the MIT license. 00005 * See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details. 00006 */ 00007 00008 #include "publish_control_factory.h" 00009 00010 using namespace AS::Joystick; 00011 00012 PublishControlFactory::PublishControlFactory() 00013 {} 00014 00015 std::unique_ptr<PublishControl> PublishControlFactory::create(int board_rev) 00016 { 00017 if (board_rev == 1 || board_rev == 2) 00018 return std::unique_ptr<PublishControlBoardRev2>(new PublishControlBoardRev2); 00019 else if (board_rev == 3) 00020 return std::unique_ptr<PublishControlBoardRev3>(new PublishControlBoardRev3); 00021 else 00022 throw std::invalid_argument("Invalid option."); 00023 }