// ********** ProxyDemo.cpp ********** #include #include using namespace std; class ProductIF { public: virtual int getValue() = 0; virtual void setValue(int i) = 0; }; class Product : public ProductIF { private: int i; public: Product(int i) { this->i = i; } int getValue() { this->i = i; } void setValue(int i) { this->i = i; } }; class ProductProxy : public ProductIF { Product* p; public: ProductProxy(int i) { p = new Product(i); } int getValue() { return p->getValue(); } void setValue(int i) { p->setValue(i); } }; const int MAX = 1000; int main() { hrtime_t t1 = gethrtime(); for (int i=0; isetValue(j); int k = proxy->getValue(); } } hrtime_t t2 = gethrtime(); cout << (t2-t1)/1000000 << " "; return 1; }