|
|
|
|||||
|
Pointers and Proxies
Hi,
I want to make a system with a tree structure that constits of nodes. These nodes have a parent and several children. And I use C++. The slice description looks like this: module structure { sequence<Node> NodeSeq; interface Node { void setParent(string); Node getParent(); NodeSeq getChildren(); } } The nodes have internally a vector where the child nodes are saved and a variable where the parent is set. SetParent is called from the parent of a node with the indentifier of the parent node. All nodes know only their children from a configuration file. That is the setup. Now to my problem. When I generate the C++ files from the Slice file, getParent returns a NodePtr and getChildren a vector of NodePtr. When setParten gets called, a child resolves the given identifier and creates a proxy to his parten, so that he can call methodes there. The same happens for his children. But how do I transform now the NodePrx objects into NodePtr objects? And is it possible that pointers point to remote objects and can I call methodes there? I have thried this setup in CORBA before, there there I simply used _var pointers, to call remote functions and for return values. I have found no solution to my problem in the Ice book and in the examples. Have I overread something or am I doing it totally wrong? |
|
|||||
|
Hi Mike,
you could try to use asterixes. Then you get "remote references" to your nodes. We use a similar interface to access remote trees. module structure { sequence<Node *> NodeSeq; interface Node { void setParent(Node *); Node *getParent(); NodeSeq getChildren(); } } Bye Matthias |
|
|||||
|
Hello!
You are confusing classes with interfaces. You should study the Simple File System exposed in the Ice documentation because is similar to your problem. In addition, it seems your application must be persistent... Freeze is the solution. Regards!
__________________
Full name: David Vallejo Fernández University of Castilla-La Mancha (Spain) ICE Project: basic-fipa-multiagentsystem |
|
|||||
|
Oh I see, so I need to know if the object will be a remote or a local reference, when I design the Slice file.
I looked at the simple file server example, but there they never used a function that returns a remote reference, so I was a bit confused. Many thanks, I will try it and let you know if I encounter any other problems. |
|
||||||
|
Quote:
(We try to avoid the term "reference" because it has so many possible meanings.) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Different kinds of proxies | mwilson | Help Center | 5 | 09-09-2005 01:06 PM |
| Smart pointers and proxys | TraxTech | Help Center | 1 | 04-04-2005 06:56 PM |
| Problem with smart pointers | galbe | Help Center | 2 | 06-22-2004 06:22 AM |
| SegFault problems with Proxies | galbe | Help Center | 5 | 11-03-2003 09:55 AM |
| Objects and Proxies | ganzuoni | Help Center | 1 | 06-18-2003 03:49 PM |