You could try this.

struct Node {}

struct Domain {
   1: i32 id,
   2: string name,
   3: string hb_time,
   4: i32 state,
   5: Node node,
}
typedef list<Domain> Domains

struct Node {
   1: i32 id,
   2: string name,
   3: string hb_time,
   4: i32 running_state,
   5: Domains domains,
}

typedef list<Node> Nodes
typedef i32 IdNum

service Virt {
   Node getNode(1:i32 id),
   IdNum saveNode(1:Node node),
   Domain getDomain(1:i32 id),
   Domains getDomainByNode(1:Node node),
   Node getNodeOfDomain(1:i32 id),
   Nodes getAllNodes(),
}



On 08 Jan 2010, at 8:28 AM, David Reiss wrote:

Short answer: no.  See this thread for details: 
http://markmail.org/thread/4pwhw5d254zrphv5

Tim Hughes wrote:
I am wondering if the following concept is possible in some way, other
than the way i am doing it obviously. It is a bit recursive and is
giving an issue when compiling. The error is:

Type "Domains" has not been defined


and the thrift code is:

struct Node {
   1: i32 id,
   2: string name,
   3: string hb_time,
   4: i32 running_state,
   5: Domains domains,
}


struct Domain {
   1: i32 id,
   2: string name,
   3: string hb_time,
   4: i32 state,
   5: Node node,
}

typedef list<Domain> Domains
typedef list<Node> Nodes
typedef i32 IdNum

service Virt {
   Node getNode(1:i32 id),
   IdNum saveNode(1:Node node),
   Domain getDomain(1:i32 id),
   Domains getDomainByNode(1:Node node),
   Node getNodeOfDomain(1:i32 id),
   Nodes getAllNodes(),
}




Tim Hughes
mailto:[email protected]

Reply via email to