1 //===-- MICmnBase.h ---------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #pragma once 11 12 // In-house headers: 13 #include "MIDataTypes.h" 14 #include "MIUtilString.h" 15 16 // Declarations: 17 class CMICmnLog; 18 19 //++ 20 //============================================================================ 21 // Details: MI common code implementation base class. 22 //-- 23 class CMICmnBase { 24 // Methods: 25 public: 26 /* ctor */ CMICmnBase(); 27 28 bool HaveErrorDescription() const; 29 const CMIUtilString &GetErrorDescription() const; 30 void SetErrorDescription(const CMIUtilString &vrTxt) const; 31 void SetErrorDescriptionn(const char *vFormat, ...) const; 32 void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const; 33 void ClrErrorDescription() const; 34 35 // Overrideable: 36 public: 37 /* dtor */ virtual ~CMICmnBase(); 38 39 // Attributes: 40 protected: 41 mutable CMIUtilString m_strMILastErrorDescription; 42 bool m_bInitialized; // True = yes successfully initialized, false = no yet or 43 // failed 44 CMICmnLog *m_pLog; // Allow all derived classes to use the logger 45 MIint m_clientUsageRefCnt; // Count of client using *this object so not 46 // shutdown() object to early 47 }; 48