AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
AJASystemInfo Class Reference

#include <info.h>

Public Member Functions

 AJASystemInfo (const AJASystemInfoMemoryUnit inUnits=AJA_SystemInfoMemoryUnit_Megabytes, AJASystemInfoSections sections=AJA_SystemInfoSection_All)
 Default constructor that instantiates the platform-specific implementation, then calls Rescan. More...
 
virtual ~AJASystemInfo ()
 
virtual AJAStatus Rescan (AJASystemInfoSections sections=AJA_SystemInfoSection_All)
 
virtual AJAStatus GetValue (const AJASystemInfoTag inTag, std::string &outValue) const
 Answers with the host system info value string for the given AJASystemInfoTag. More...
 
virtual AJAStatus GetLabel (const AJASystemInfoTag inTag, std::string &outLabel) const
 Answers with the host system info label string for the given AJASystemInfoTag. More...
 
virtual AJAStatus GetLabelValuePairs (AJALabelValuePairs &outTable, bool clearTable=false) const
 Generates a "table" of label/value pairs that contains the complete host system info table. More...
 
virtual void ToString (std::string &outAllLabelsAndValues) const
 Answers with a multi-line string that contains the complete host system info table. More...
 
virtual std::string ToString (const size_t inValueWrapLen=0, const size_t inGutterWidth=3) const
 

Static Public Member Functions

static std::string ToString (const AJALabelValuePairs &inLabelValuePairs, const size_t inValueWrapLen=0, const size_t inGutterWidth=3)
 Generates a multi-line string from a "table" of label/value pairs that, when displayed in a monospaced font, appears as a neat, two-column table. More...
 
static AJALabelValuePairsappend (AJALabelValuePairs &inOutTable, const std::string &inLabel, const std::string &inValue=std::string())
 A convenience function that appends the given label and value strings to the provided AJALabelValuePairs table. More...
 

Detailed Description

Class for getting common information about the system.

Definition at line 78 of file info.h.

Constructor & Destructor Documentation

◆ AJASystemInfo()

AJASystemInfo::AJASystemInfo ( const AJASystemInfoMemoryUnit  inUnits = AJA_SystemInfoMemoryUnit_Megabytes,
AJASystemInfoSections  sections = AJA_SystemInfoSection_All 
)

Default constructor that instantiates the platform-specific implementation, then calls Rescan.

Parameters
[in]inUnitsOptionally specifies the AJASystemInfoMemoryUnit to use. Defaults to "megabytes".
[in]sectionsThe sections of the info structure to rescan, bitwise OR the desired sections or use AJA_SystemInfoSection_All (the default) for all sections or AJA_SystemInfoSection_None for no sections. In the case of AJA_SystemInfoSection_None only the labels are set, no scanning is done at initialization.

Definition at line 100 of file info.cpp.

◆ ~AJASystemInfo()

AJASystemInfo::~AJASystemInfo ( )
virtual

Definition at line 108 of file info.cpp.

Member Function Documentation

◆ append()

static AJALabelValuePairs& AJASystemInfo::append ( AJALabelValuePairs inOutTable,
const std::string &  inLabel,
const std::string &  inValue = std::string() 
)
inlinestatic

A convenience function that appends the given label and value strings to the provided AJALabelValuePairs table.

Parameters
inOutTableThe AJALabelValuePairs table to be modified.
[in]inLabelSpecifies the label string to use.
[in]inValueSpecifies the value string to use. If empty, treat "inLabel" as a section heading.
Returns
A reference to the given AJALabelValuePairs.

Definition at line 168 of file info.h.

◆ GetLabel()

AJAStatus AJASystemInfo::GetLabel ( const AJASystemInfoTag  inTag,
std::string &  outLabel 
) const
virtual

Answers with the host system info label string for the given AJASystemInfoTag.

Parameters
[in]inTagThe AJASystemInfoTag of interest
[out]outLabelReceives the label string
Returns
AJA_SUCCESS if successful

Definition at line 162 of file info.cpp.

◆ GetLabelValuePairs()

AJAStatus AJASystemInfo::GetLabelValuePairs ( AJALabelValuePairs outTable,
bool  clearTable = false 
) const
virtual

Generates a "table" of label/value pairs that contains the complete host system info table.

Parameters
[out]outTableThe AJALabelValuePairs table.
[in]clearTableClear the passed in table before adding new items? Defaults to false.
Returns
AJA_SUCCESS if successful

Definition at line 173 of file info.cpp.

◆ GetValue()

AJAStatus AJASystemInfo::GetValue ( const AJASystemInfoTag  inTag,
std::string &  outValue 
) const
virtual

Answers with the host system info value string for the given AJASystemInfoTag.

Parameters
[in]inTagThe AJASystemInfoTag of interest
[out]outValueReceives the value string
Returns
AJA_SUCCESS if successful

Definition at line 151 of file info.cpp.

◆ Rescan()

AJAStatus AJASystemInfo::Rescan ( AJASystemInfoSections  sections = AJA_SystemInfoSection_All)
virtual

Rescans the host system.

Parameters
[in]sectionsThe sections of the info structure to rescan, bitwise OR the desired sections or use AJA_SystemInfoSection_All (the default) for all sections or AJA_SystemInfoSection_None for no sections. In the case of AJA_SystemInfoSection_None only the labels are set, no scanning is done.

Definition at line 117 of file info.cpp.

◆ ToString() [1/3]

string AJASystemInfo::ToString ( const AJALabelValuePairs inLabelValuePairs,
const size_t  inValueWrapLen = 0,
const size_t  inGutterWidth = 3 
)
static

Generates a multi-line string from a "table" of label/value pairs that, when displayed in a monospaced font, appears as a neat, two-column table.

Parameters
[in]inLabelValuePairsThe AJALabelValuePairs to be formatted as a table.
[in]inValueWrapLenOptionally specifies the maximum width of the "value" column, in characters. Zero, the default, disables any/all wrapping. (However, wrapping always occurs on line-breaks (e.g. CRLF, LF, CR, etc.)).
[in]inGutterWidthOptionally specifies the gap ("gutter") between the "label" and "value" columns, in character spaces. Defaults to 3 spaces.
Returns
A multi-line string containing the formatted AJALabelValuePairs table.
Bug:
Multi-byte UTF8 characters need to be counted as one character.

Definition at line 28 of file info.cpp.

◆ ToString() [2/3]

string AJASystemInfo::ToString ( const size_t  inValueWrapLen = 0,
const size_t  inGutterWidth = 3 
) const
virtual
Returns
A multi-line string containing the complete host system info table.
Parameters
[in]inValueWrapLenOptionally specifies the maximum width of the "value" column, in characters. Zero, the default, disables wrapping. (However, wrapping always occurs on line-breaks (e.g. CRLF, LF, CR, etc.)).
[in]inGutterWidthOptionally specifies the gap ("gutter") between the "label" and "value" columns, in character spaces. Defaults to 3 spaces.

Definition at line 189 of file info.cpp.

◆ ToString() [3/3]

virtual void AJASystemInfo::ToString ( std::string &  outAllLabelsAndValues) const
virtual

Answers with a multi-line string that contains the complete host system info table.

Parameters
[out]outAllLabelsAndValuesReceives the string

The documentation for this class was generated from the following files: