AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
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
AJAStatus
Definition: types.h:380
#define AJA_EXPORT
Definition: export.h:34
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
Definition: info.h:71
AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter
Definition: info.h:72
AJASystemInfoSections
Definition: info.h:57
Master header for the ajabase library.
AJASystemInfoMemoryUnit
Definition: info.h:19
AJASystemInfoTag
Definition: info.h:29
AJA_EXPORT std::ostream & operator<<(std::ostream &outStream, const AJASystemInfo &inData)
Streams a human-readable representation of the AJASystemInfo into the given output stream...
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
std::pair< std::string, std::string > AJALabelValuePair
A pair of strings comprising a label and a value.
Definition: info.h:70