Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C + + Proxy objects > Modify Proxy.h and Proxy.cpp to add proxy objects 1 . Due to the improved optimization ability of the compiler
C Proxy objects
Modify Proxy.h and Proxy.cpp to add proxy objects
Due to the improved optimization ability of the compilerSome restrictions apply...
You cannot implement the following function in the header, you should be implementing the appropriate proxy with vectors.
VectD operator const VectD &tmp const;
Data needs to stay private. You cannot make it public
You CAN do work in the header for your proxies
Proxy.h
#ifndef PROXYH
#define PROXYH
Modify This File
class VectD
public:
VectDconst VectD &tmp default;
VectD &operator const VectD &tmp default;
VectD default;
~VectD default;
VectDconst float inX, const float inY;
void setXconst float inX;
void setYconst float inY;
void setconst float inX, const float inY;
float getX const;
float getY const;
Rules : this function cannot be inlined or implemented directly
VectD operator const VectD &tmp const; cannot be inlined or implemented directly
private:
float x;
float y;
Add friends here...
friend class ProxyVectD;
;
#endif
End of File
Proxy.cpp
#include "Proxy.h
Modify This File
End of File
ProxyReadonly.cpp
DO NOT MODIFY THIS FILE
#include "Proxy.h
VectD::VectDconst float inX, const float inY
: xinX yinY
float VectD::getX const
return thisx;
;
float VectD::getY const
return thisy;
;
void VectD::setXconst float inX
thisx inX;
;
void VectD::setYconst float inY
thisy inY;
;
void VectD::setconst float inX, const float inY
thisx inX;
thisy inY;
;
End of File
Please Modify Proxy.h Proxy.cpp
Please check annotaion comments carefully.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started