This is a discussion on Proxy objects within the C and C++ Programming forums, part of the Software Development category; Proxy objects Objects that stand for other objects are called proxy objects or surrogates. Example: template<class T> ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Proxy objects Objects that stand for other objects are called proxy objects or surrogates. Example: template<class T> class Array2D { public: class Array1D { public: T& operator[] (int index); const T& operator[] (int index) const; ... }; Array1D operator[] (int index); const Array1D operator[] (int index) const; ... }; The following then becomes legal: Array2D<float>data(10,20); ........ cout<<data[3][6]; // fine Here data[3] yields an Array1D object and the operator [] invocation on that object yields the float in position(3,6) of the original two dimensional array. Clients of the Array2D class need not be aware of the presence of the Array1D class. Objects of this latter class stand for one-dimensional array objects that, conceptually, do not exist for clients of Array2D. Such clients program as if they were using real, live, two-dimensional arrays. Each Array1D object stands for a one-dimensional array that is absent from a conceptual model used by the clients of Array2D. In the above example, Array1D is a proxy class. Its instances stand for one-dimensional arrays that, conceptually, do not exist.
__________________ J.Vijayanand |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Proxy objects | vijayanand | C and C++ Programming | 0 | 09-22-2007 03:19 AM |
| I get the error "The page cannot be displayed" and an HTTP 502 Proxy Error. Why? | kingmaker | ASP and ASP.NET Programming | 1 | 07-20-2007 04:43 AM |
| How many objects are there? | vadivelanvaidyanathan | Java Programming | 3 | 07-16-2007 10:49 PM |
| Proxy | vadivelanvaidyanathan | Server Management | 0 | 07-15-2007 06:34 PM |
| the new Net Objects 10 | aquariancore | Web Design Help | 1 | 04-20-2007 08:46 PM |