<commit_before>/***************************************************************************
 *   Copyright (C) 2006, IBM                                               *
 *                                                                         *
 *   Maintained By:                                                        *
 *   <NAME> and <NAME>                                           *
 *   <EMAIL>, <EMAIL>                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the Lesser GNU General Public License as        *
 *   published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.                   *
 *                                                                         *
 *   You should have received a copy of the Lesser GNU General Public      *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef LSVPDCOMPONENT_HPP
#define LSVPDCOMPONENT_HPP

#include <string>
#include <vector>
#include <iostream>

#include <libvpd-2/dataitem.hpp>

/**
 * @defgroup lsvpd lsvpd
 *
 * @brief
 *   Group lsvpd holds the vpd access programs and library
 */

namespace lsvpd
{
	static const int COMPONENT_STATE_LIVE = 0x00000001;
	static const int COMPONENT_STATE_DEAD = 0x00000002;
	/**
	 * This class provides a single storage point for all the VPD connected
	 * to a single entity on a system.  An entity may be a physical piece of
	 * hardware (e.g. an ethernet card or a PCI bus), a virtualized piece of
	 * hardware (e.g. a virtual SCSI drive), or a specific group of
	 * functionality provided by a piece of hardware (e.g. Some laptops have
	 * a sound card that also has an onboard modem).  This object has only
	 * private mutator methods because we do not want programs using libvpd
	 * to be able to modify information stored here.
	 *
	 * @class Component
	 *
	 * @ingroup lsvpd
	 *
	 * @brief
	 *   A Compontent holds VPD for a single entity on a system.
	 *
	 * @author <NAME> <<EMAIL>>,
	 *   <NAME> <<EMAIL>
	 */
	class Component
	{
		friend class ProcCollector;
		friend class DeviceTreeCollector;
		friend class SysFSTreeCollector;
		friend class ICollector;
		friend class Gatherer;

		private:
			/**
			 * This holds the unique ID for this Component.  This may be
			 * its entry in sysfs, or the device-tree, or an ID constructed
			 * if neither of these is appropriate.
			 *
			 * @brief
			 *   The ID for this Component
			 */
			DataItem idNode;

			/**
			 * This holds the full path to the directory for this Component
			 * under /proc/device-tree.
			 *
			 * @brief
			 *   The directory in the device-tree for this Component
			 */
			DataItem deviceTreeNode;
			/**
			 * Full path to the directory for this Component under /sys/bus.
			 *
			 * @brief
			 *   The directory in /sys for this component.
			 */
			DataItem sysFsNode;

			/**
			 * @brief
			 *   If the sysFsNode is a sym link, this is the resolved path
			 * 		Should point to /sys/devices/*
			 */
			DataItem sysFsLinkTarget;

			/**
			 * @brief
			 *   Stores the HAL UDI, if HAL is available.
			 */
			DataItem halUDI;

			/**
			 * This will be empty if this is not a net device.
			 *
			 * @brief
			 *   Holds the MAC or Physical Address if this is a net device
			 */
			DataItem mNetAddr;

			/**
			 * @brief
			 *   Holds the full path to this Component under /sys/class
			 */
			DataItem mDevClass;

			/**
			 * @brief
			 *   The description of this Component
			 */
			DataItem mDescription;

			/**
			 * @brief<commit_msg>libvpd: Silence compilation warning<commit_after>/***************************************************************************
 *   Copyright (C) 2006, IBM                                               *
 *                                                                         *
 *   Maintained By:                                                        *
 *   <NAME> and <NAME>                                           *
 *   <EMAIL>, <EMAIL>                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the Lesser GNU General Public License as        *
 *   published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.                   *
 *                                                                         *
 *   You should have received a copy of the Lesser GNU General Public      *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef LSVPDCOMPONENT_HPP
#define LSVPDCOMPONENT_HPP

#include <string>
#include <vector>
#include <iostream>

#include <libvpd-2/dataitem.hpp>

/**
 * @defgroup lsvpd lsvpd
 *
 * @brief
 *   Group lsvpd holds the vpd access programs and library
 */

namespace lsvpd
{
	static const int COMPONENT_STATE_LIVE = 0x00000001;
	static const int COMPONENT_STATE_DEAD = 0x00000002;
	/**
	 * This class provides a single storage point for all the VPD connected
	 * to a single entity on a system.  An entity may be a physical piece of
	 * hardware (e.g. an ethernet card or a PCI bus), a virtualized piece of
	 * hardware (e.g. a virtual SCSI drive), or a specific group of
	 * functionality provided by a piece of hardware (e.g. Some laptops have
	 * a sound card that also has an onboard modem).  This object has only
	 * private mutator methods because we do not want programs using libvpd
	 * to be able to modify information stored here.
	 *
	 * @class Component
	 *
	 * @ingroup lsvpd
	 *
	 * @brief
	 *   A Compontent holds VPD for a single entity on a system.
	 *
	 * @author <NAME> <<EMAIL>>,
	 *   <NAME> <<EMAIL>
	 */
	class Component
	{
		friend class ProcCollector;
		friend class DeviceTreeCollector;
		friend class SysFSTreeCollector;
		friend class ICollector;
		friend class Gatherer;

		private:
			/**
			 * This holds the unique ID for this Component.  This may be
			 * its entry in sysfs, or the device-tree, or an ID constructed
			 * if neither of these is appropriate.
			 *
			 * @brief
			 *   The ID for this Component
			 */
			DataItem idNode;

			/**
			 * This holds the full path to the directory for this Component
			 * under /proc/device-tree.
			 *
			 * @brief
			 *   The directory in the device-tree for this Component
			 */
			DataItem deviceTreeNode;
			/**
			 * Full path to the directory for this Component under /sys/bus.
			 *
			 * @brief
			 *   The directory in /sys for this component.
			 */
			DataItem sysFsNode;

			/**
			 * @brief
			 *   If the sysFsNode is a sym link, this is the resolved path
			 * 		Should point to /sys/devices/\*
			 */
			DataItem sysFsLinkTarget;

			/**
			 * @brief
			 *   Stores the HAL UDI, if HAL is available.
			 */
			DataItem halUDI;

			/**
			 * This will be empty if this is not a net device.
			 *
			 * @brief
			 *   Holds the MAC or Physical Address if this is a net device
			 */
			DataItem mNetAddr;

			/**
			 * @brief
			 *   Holds the full path to this Component under /sys/class
			 */
			DataItem mDevClass;

			/**
			 * @brief
			 *   The description of this Component
			 */
			DataItem mDescription;

			/**
			 * @brief
{'fraction_non_alphanumeric': 0.10213749277874061, 'fraction_numerical': 0.00901213171577123, 'mean_word_length': 1.710930159724397, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6582546', 'n_tokens_mistral': 2553, 'n_tokens_neox': 2094, 'n_words': 912}