20,741
edits
Line 14: | Line 14: | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
// this is the base class, with the only method being a virtual method | |||
// which needs to be implemented by any child classes | |||
// a pointer of this class will be added to the LinuxMemoryInterface class | |||
class GPUInfo { | class GPUInfo { | ||
private: | private: | ||
Line 20: | Line 23: | ||
virtual int getVRAMUsageInKB() = 0; | virtual int getVRAMUsageInKB() = 0; | ||
}; | }; | ||
// Actually implement the GPUInfo class for all 3 GPU vendors: | |||
class NVIDIA_GPU: public GPUInfo { | class NVIDIA_GPU: public GPUInfo { |