Sha256: 469ca3aa806361ada8e38cbe9e17ed49c488baef771debf7480b3c5bc99c1d26

Contents?: true

Size: 1.66 KB

Versions: 16

Compression:

Stored size: 1.66 KB

Contents

/**
 * @file
 * Declares the base kernel fact resolver.
 */
#pragma once

#include <facter/facts/resolver.hpp>
#include <string>
#include <tuple>

namespace facter { namespace facts { namespace resolvers {

    /**
     * Responsible for resolving kernel facts.
     */
    struct kernel_resolver : resolver
    {
        /**
         * Constructs the kernel_resolver.
         */
        kernel_resolver();

        /**
         * Called to resolve all facts the resolver is responsible for.
         * @param facts The fact collection that is resolving facts.
         */
        virtual void resolve(collection& facts) override;

     protected:
        /**
         * Represents kernel data.
         */
        struct data
        {
            /**
             * Stores the name of the kernel (e.g. Linux, Darwin, etc).
             */
            std::string name;

            /**
             * Stores the release of the kernel.
             */
            std::string release;

            /**
             * Stores the version of the kernel.
             */
            std::string version;
        };

        /**
         * Collects the resolver data.
         * @param facts The fact collection that is resolving facts.
         * @return Returns the resolver data.
         */
        virtual data collect_data(collection& facts) = 0;

        /**
         * Parses the major and minor kernel versions.
         * @param version The version to parse.
         * @return Returns a tuple of major and minor versions.
         */
        virtual std::tuple<std::string, std::string> parse_version(std::string const& version) const;
    };

}}}  // namespace facter::facts::resolvers

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.6.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.5.cfacter.20181022 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.4.cfacter.20180821 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.3.cfacter.20180716 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.2.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.9.6.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.2.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.9.6.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
facter-3.11.0.cfacter.20180319 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp
cfacter-3.11.0.rc.20180314 ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp