thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Hughes <thug...@thegoldfish.org>
Subject Using a type before it has been defined
Date Fri, 08 Jan 2010 01:24:39 GMT
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:thughes@thegoldfish.org

Mime
View raw message