proxy class

Can someone explain to me what is a proxy class?
I need explanation not a link thanks in advance
I need an explanation, not a link


If you can't take a moment from your time to read about it, why do you think we should spare our time to write a response for you?
Proxy is a class which adds indirection layer to another object. There could be several reasons for that:
1) Security or stability: proxy will not forward call to actual object unless calling object has right to access it or call is sensible. This might be done for example to add debug checking capabilities to existing third-party class without changing it.
2) You need to do something on object access. For example smart pointers are proxies for raw pointers. shared_ptr does reference counting and throws on illegal access for example. Additionally you might use mutex inside proxy to add thread safety to non-thread-safe object.
3) To give lazy-evaluation semantic for another object, instantiating it only if needed, caching calculation results, or providing COW semantics.
Topic archived. No new replies allowed.