=begin __ ___ _ _ _____ ____ __ __ \ \ / / |__ (_) |_ ___| ___| _ ___ ___ / ___| \/ | \ \ /\ / /| '_ \| | __/ _ \ |_ | | | / __|/ _ \ | | |\/| | \ V V / | | | | | || __/ _|| |_| \__ \ __/ |___| | | | \_/\_/ |_| |_|_|\__\___|_| \__,_|___/\___|\____|_| |_| Container Manager Copyright (C) 2015 David Prandzioch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. =end # Top level class for resource management class ResourceManager # Initializes the ResourceManager with a matching adapter # # @raise [ArgumentError] def initialize(type) @resman = nil if type == 'linux' @resman = ResourceManagerAdapter::Linux.new else raise ArgumentError, 'invalid resourcemanager type supplied' end end # Returns the total number of cpu cores available on the system # # @return [Integer] def total_cpu_cores @resman.total_cpu_cores end end