473,513 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Proxy objects...


What are proxy objects used for in C++? Currently, the only use of proxy
objects I know of is that one can write one-liner code such as:

myobj.foo() (a,b) (c,d) (e,f) ;

where myobj.foo() returns a proxy object with an overloaded operator()
member function, which returns a reference to the proxy object itself. But
writing one-liners cannot be reason enough to use proxy objects.


Jun 27 '08 #1
2 3258
On 19 avr, 18:18, "barcaroller" <barcarol...@music.netwrote:
What are proxy objects used for in C++? Currently, the only
use of proxy objects I know of is that one can write one-liner
code such as:
myobj.foo() (a,b) (c,d) (e,f) ;
where myobj.foo() returns a proxy object with an overloaded
operator() member function, which returns a reference to the
proxy object itself. But writing one-liners cannot be reason
enough to use proxy objects.
The two most frequent reasons I know of are for context
dependent implicit type conversions (where the proxy has a:
template< typename T Proxy::operator T() const
function), and for distinguishing between lvalue and rvalue
accesses (where the proxy will have an implicit conversion to
the target type for rvalue accesses, and an operator= which
modifies the source, rather than the proxy, for lvalue
accesses).

I don't think I've ever seen a proxy used as you've described.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #2

"James Kanze" <ja*********@gmail.comwrote in message
news:ba**********************************@d45g2000 hsc.googlegroups.com...
I don't think I've ever seen a proxy used as you've described.
boost::program_options

Example:

options_description desc("Allowed options");

desc.add_options()
("help", "help message")
("level", value<int>(), "set level");

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1447
by: nitrogenycs | last post by:
Hello, I need a way to get a notification whenever a variable of an object changes. The approach should be non-intrusive so that I can use existing objects without modifying them. I want to be notified no matter who or what did change the wrapped object - even whenever an object internal methods changes the variables. So I coded the piece...
1
1168
by: 0to60 | last post by:
I have an object A, who contains a bunch of maps of other objects B, C, D. Some maps are internal, some are private. Object A inherits from MarshalByRefObject, whereas B, C and D are all marked Serializable. On client computers, I'll obtain a remoting proxy to object A (often proxies to many A's as this is a peer to peer app). Trouble is,...
4
5925
by: Dave Langley | last post by:
I'm using VC++ to write an VC++ unmanaged client to communicate to a C#.NET web service. I have the proxy class for the unmanaged client and it uses the default CSoapSocketClientT<> template as it's HTTP connection. This works fine until I start using a proxy server with authorization rather than a direct HTTP connection. I keep getting a 407...
0
966
by: Jakob | last post by:
I have two domains and in one domain I have proxy objects pointing at actual objects in the other domain. One of the objects has a property which is a home made vector class. When I access the property through my proxy as this Vector2D position = proxyObject.Position position will be null. It seems that for some reason the Vector2D object...
1
5948
by: David Lojudice S. | last post by:
3
2335
by: Ohad Young | last post by:
Hi, I have a webservice method that returns an instance of a custom class I created (e.g., bank account). The class definition in the webservice contains properties, overrides Object.ToString method and etc. However, the proxy created for the webservice contains a definition for this class without the code I wrote. Instead it contains...
0
1234
by: Symon | last post by:
Hi everyone, I'm writing a webservice where I'm trying to expose a framework that contains a number of classes which have read-only properties. I want to expose data-transfer proxies of these objects with both getters and setters and so that all the properties are exposed via the webservice and want to copy all the data to the proxy before...
0
1338
by: Leonid Levin | last post by:
Hi, I am builidng an ASP.Net web application consuming a .Net web service. The web service requires me to log in and keeps my login status in its own session state. I don't want to log in every time I call the web service, so I create an instance of the web service proxy object in my application, log in and set the object into my own session...
3
5381
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate proxy classes (using WSDL) which consume more hard disk space & resources? For e.g. consider the following code which exists in a user-defined...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4759
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.