title: gmock mock class does not inherit any classes
body: <p>I have see some sample code about gmock,</p>
  
  <pre><code>#include "gmock/gmock.h"
  #include "gtest/gtest.h"
  #include &lt;stdio.h&gt;
  #include &lt;string&gt;
  
  class MockFoo {
   public:
    MockFoo() {}
  
    MOCK_METHOD3(Bar, char(const std::string&amp; s, int i, double x));
    MOCK_METHOD2(Bar2, bool(int x, int y));
    MOCK_METHOD2(Bar3, void(int x, int y));
  
   private:
    GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
  };
  
  class GMockOutputTest : public testing::Test {
   protected:
    MockFoo foo_;
  };
  
  TEST_F(GMockOutputTest, ExpectedCall) {
    testing::GMOCK_FLAG(verbose) = "info";
  
    EXPECT_CALL(foo_, Bar2(0, _));
    foo_.Bar2(0, 0);  // Expected call
  
    testing::GMOCK_FLAG(verbose) = "warning";
  }
  </code></pre>
  
  <p>The mock class MockFoo is mocking three functions as is in the class body, but the class MockFoo does not inherit any class.</p>
  
  <p>If I understand it correctly, the mock class can mock virtual and non-virtual functions.</p>
  
  <p>1) Mocking virtual functions: mock class should inherit a base class being mocked, and all the functions in that class should be virtual, but in this example, there is no base class.</p>
  
  <p>2) Mocking non-virtual functions: mock class does not need inherit any class, but it needs to add tamplate to the code in order to use hi-perf dependency injection.</p>
  
  <p>Does the code above belong to any of the case? And what is it trying to mock? And how to understand it?</p>