AJA NTV2 SDK  18.0.0.2717
NTV2 SDK 18.0.0.2717
info.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJA_INFO_H
9 #define AJA_INFO_H
10 
11 #include "ajabase/common/public.h"
12 #include <vector>
13 #include <map>
14 #include <string>
15 
16 // forward declarations
17 class AJASystemInfoImpl;
18 
20 {
25 
27 };
28 
30 {
53 
55 };
56 
58 {
59  AJA_SystemInfoSection_CPU = 0x00000001 << 0,
60  AJA_SystemInfoSection_GPU = 0x00000001 << 1,
61  AJA_SystemInfoSection_Mem = 0x00000001 << 2,
62  AJA_SystemInfoSection_OS = 0x00000001 << 3,
63  AJA_SystemInfoSection_Path = 0x00000001 << 4,
64  AJA_SystemInfoSection_System = 0x00000001 << 5,
65 
68 };
69 
70 typedef std::pair<std::string, std::string> AJALabelValuePair;
71 typedef std::vector<AJALabelValuePair> AJALabelValuePairs;
72 typedef AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter;
73 
81 {
82 public: // Instance Methods
95 
96  virtual ~AJASystemInfo();
97 
105  virtual AJAStatus Rescan (AJASystemInfoSections sections = AJA_SystemInfoSection_All);
106 
113  virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string & outValue) const;
114 
121  virtual AJAStatus GetLabel(const AJASystemInfoTag inTag, std::string & outLabel) const;
122 
129  virtual AJAStatus GetLabelValuePairs(AJALabelValuePairs &outTable, bool clearTable = false) const;
130 
135  virtual void ToString (std::string & outAllLabelsAndValues) const;
136 
145  virtual std::string ToString (const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3) const;
146 
147 public: // Class Methods
160  static std::string ToString (const AJALabelValuePairs & inLabelValuePairs, const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3);
161 
170  static inline AJALabelValuePairs & append (AJALabelValuePairs & inOutTable, const std::string & inLabel, const std::string & inValue = std::string())
171  {inOutTable.push_back(AJALabelValuePair(inLabel,inValue)); return inOutTable;}
172 
173 private: // Instance Data
174  AJASystemInfoImpl* mpImpl;
175 };
176 
177 
184 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJASystemInfo & inData);
185 
192 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePair & inData);
193 
200 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePairs & inData);
201 
202 #endif // AJA_INFO_H
AJA_SystemInfoSection_Path
@ AJA_SystemInfoSection_Path
Definition: info.h:63
AJA_SystemInfoMemoryUnit_Megabytes
@ AJA_SystemInfoMemoryUnit_Megabytes
Definition: info.h:23
AJA_SystemInfoTag_System_Bios
@ AJA_SystemInfoTag_System_Bios
Definition: info.h:32
AJA_SystemInfoSection_CPU
@ AJA_SystemInfoSection_CPU
Definition: info.h:59
AJA_SystemInfoTag_Path_NTV2VirtualDevices
@ AJA_SystemInfoTag_Path_NTV2VirtualDevices
Definition: info.h:52
AJA_SystemInfoTag_Path_Firmware
@ AJA_SystemInfoTag_Path_Firmware
Definition: info.h:50
AJA_EXPORT
#define AJA_EXPORT
Definition: export.h:34
AJASystemInfoMemoryUnit
AJASystemInfoMemoryUnit
Definition: info.h:19
AJASystemInfoTag
AJASystemInfoTag
Definition: info.h:29
AJA_SystemInfoTag_OS_KernelVersion
@ AJA_SystemInfoTag_OS_KernelVersion
Definition: info.h:38
operator<<
AJA_EXPORT std::ostream & operator<<(std::ostream &outStream, const AJASystemInfo &inData)
Streams a human-readable representation of the AJASystemInfo into the given output stream.
AJA_SystemInfoTag_Path_Applications
@ AJA_SystemInfoTag_Path_Applications
Definition: info.h:48
AJA_SystemInfoTag_Path_NTV2Plugins
@ AJA_SystemInfoTag_Path_NTV2Plugins
Definition: info.h:51
public.h
Master header for the ajabase library.
AJA_SystemInfoMemoryUnit_Kilobytes
@ AJA_SystemInfoMemoryUnit_Kilobytes
Definition: info.h:22
AJA_SystemInfoTag_LAST
@ AJA_SystemInfoTag_LAST
Definition: info.h:54
AJA_SystemInfoTag_CPU_Type
@ AJA_SystemInfoTag_CPU_Type
Definition: info.h:39
AJAStatus
AJAStatus
Definition: types.h:378
AJA_SystemInfoTag_CPU_NumCores
@ AJA_SystemInfoTag_CPU_NumCores
Definition: info.h:40
AJASystemInfo::append
static AJALabelValuePairs & append(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 AJALabelValuePa...
Definition: info.h:170
AJA_SystemInfoTag_System_Name
@ AJA_SystemInfoTag_System_Name
Definition: info.h:33
AJA_SystemInfoTag_System_BootTime
@ AJA_SystemInfoTag_System_BootTime
Definition: info.h:34
AJA_SystemInfoTag_OS_Version
@ AJA_SystemInfoTag_OS_Version
Definition: info.h:36
AJALabelValuePair
std::pair< std::string, std::string > AJALabelValuePair
A pair of strings comprising a label and a value.
Definition: info.h:70
AJA_SystemInfoTag_Mem_Used
@ AJA_SystemInfoTag_Mem_Used
Definition: info.h:42
AJA_SystemInfoSection_GPU
@ AJA_SystemInfoSection_GPU
Definition: info.h:60
AJA_SystemInfoTag_Path_PersistenceStoreUser
@ AJA_SystemInfoTag_Path_PersistenceStoreUser
Definition: info.h:46
AJASystemInfoSections
AJASystemInfoSections
Definition: info.h:57
AJALabelValuePairsConstIter
AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter
Definition: info.h:72
AJASystemInfoImpl
Definition: infoimpl.h:14
AJA_SystemInfoTag_Path_PersistenceStoreSystem
@ AJA_SystemInfoTag_Path_PersistenceStoreSystem
Definition: info.h:47
AJA_SystemInfoMemoryUnit_Gigabytes
@ AJA_SystemInfoMemoryUnit_Gigabytes
Definition: info.h:24
AJA_SystemInfoTag_OS_ProductName
@ AJA_SystemInfoTag_OS_ProductName
Definition: info.h:35
AJA_SystemInfoSection_None
@ AJA_SystemInfoSection_None
Definition: info.h:66
AJA_SystemInfoSection_OS
@ AJA_SystemInfoSection_OS
Definition: info.h:62
AJA_SystemInfoTag_Path_Utilities
@ AJA_SystemInfoTag_Path_Utilities
Definition: info.h:49
AJA_SystemInfoTag_Path_UserHome
@ AJA_SystemInfoTag_Path_UserHome
Definition: info.h:45
AJA_SystemInfoSection_Mem
@ AJA_SystemInfoSection_Mem
Definition: info.h:61
AJA_SystemInfoTag_Mem_Free
@ AJA_SystemInfoTag_Mem_Free
Definition: info.h:43
AJA_SystemInfoTag_GPU_Type
@ AJA_SystemInfoTag_GPU_Type
Definition: info.h:44
AJA_SystemInfoMemoryUnit_LAST
@ AJA_SystemInfoMemoryUnit_LAST
Definition: info.h:26
AJA_SystemInfoTag_OS_VersionBuild
@ AJA_SystemInfoTag_OS_VersionBuild
Definition: info.h:37
AJA_SystemInfoMemoryUnit_Bytes
@ AJA_SystemInfoMemoryUnit_Bytes
Definition: info.h:21
AJALabelValuePairs
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
Definition: info.h:71
AJA_SystemInfoSection_All
@ AJA_SystemInfoSection_All
Definition: info.h:67
AJA_SystemInfoSection_System
@ AJA_SystemInfoSection_System
Definition: info.h:64
AJA_SystemInfoTag_Mem_Total
@ AJA_SystemInfoTag_Mem_Total
Definition: info.h:41
AJA_SystemInfoTag_System_Model
@ AJA_SystemInfoTag_System_Model
Definition: info.h:31
AJASystemInfo
Definition: info.h:80