AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
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 {
51 
53 };
54 
56 {
57  AJA_SystemInfoSection_CPU = 0x00000001 << 0,
58  AJA_SystemInfoSection_GPU = 0x00000001 << 1,
59  AJA_SystemInfoSection_Mem = 0x00000001 << 2,
60  AJA_SystemInfoSection_OS = 0x00000001 << 3,
61  AJA_SystemInfoSection_Path = 0x00000001 << 4,
62  AJA_SystemInfoSection_System = 0x00000001 << 5,
63 
66 };
67 
68 typedef std::pair<std::string, std::string> AJALabelValuePair;
69 typedef std::vector<AJALabelValuePair> AJALabelValuePairs;
70 typedef AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter;
71 
79 {
80 public: // Instance Methods
93 
94  virtual ~AJASystemInfo();
95 
103  virtual AJAStatus Rescan (AJASystemInfoSections sections = AJA_SystemInfoSection_All);
104 
111  virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string & outValue) const;
112 
119  virtual AJAStatus GetLabel(const AJASystemInfoTag inTag, std::string & outLabel) const;
120 
127  virtual AJAStatus GetLabelValuePairs(AJALabelValuePairs &outTable, bool clearTable = false) const;
128 
133  virtual void ToString (std::string & outAllLabelsAndValues) const;
134 
143  virtual std::string ToString (const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3) const;
144 
145 public: // Class Methods
158  static std::string ToString (const AJALabelValuePairs & inLabelValuePairs, const size_t inValueWrapLen = 0, const size_t inGutterWidth = 3);
159 
168  static inline AJALabelValuePairs & append (AJALabelValuePairs & inOutTable, const std::string & inLabel, const std::string & inValue = std::string())
169  {inOutTable.push_back(AJALabelValuePair(inLabel,inValue)); return inOutTable;}
170 
171 private: // Instance Data
172  AJASystemInfoImpl* mpImpl;
173 };
174 
175 
182 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJASystemInfo & inData);
183 
190 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePair & inData);
191 
198 AJA_EXPORT std::ostream & operator << (std::ostream & outStream, const AJALabelValuePairs & inData);
199 
200 #endif // AJA_INFO_H
AJA_SystemInfoSection_Path
@ AJA_SystemInfoSection_Path
Definition: info.h:61
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:57
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
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:52
AJA_SystemInfoTag_CPU_Type
@ AJA_SystemInfoTag_CPU_Type
Definition: info.h:39
AJAStatus
AJAStatus
Definition: types.h:365
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:168
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:68
AJA_SystemInfoTag_Mem_Used
@ AJA_SystemInfoTag_Mem_Used
Definition: info.h:42
AJA_SystemInfoSection_GPU
@ AJA_SystemInfoSection_GPU
Definition: info.h:58
AJA_SystemInfoTag_Path_PersistenceStoreUser
@ AJA_SystemInfoTag_Path_PersistenceStoreUser
Definition: info.h:46
AJASystemInfoSections
AJASystemInfoSections
Definition: info.h:55
AJALabelValuePairsConstIter
AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter
Definition: info.h:70
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:64
AJA_SystemInfoSection_OS
@ AJA_SystemInfoSection_OS
Definition: info.h:60
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:59
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:69
AJA_SystemInfoSection_All
@ AJA_SystemInfoSection_All
Definition: info.h:65
AJA_SystemInfoSection_System
@ AJA_SystemInfoSection_System
Definition: info.h:62
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:78