You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Eric Anderson <an...@hpl.hp.com> on 2008/12/03 17:48:52 UTC

Re: [jira] Updated: (THRIFT-219) Inject user-created templates into generated code

Fredrik Hedberg writes:
 > [ code injection for Java, not other languages ]

We have added this for c++, we extended the idl to allow us to say 
struct NodeID {
    1: i32 id;
cpp_verbatim
    uint32_t hash() const {
        return static_cast<uint32_t>(id);
    }
    std::string toStr() const;
end_verbatim 
}

I can send in a patch that does this, but it seems like a decision
would have to be made on which way to do this (in the idl explicitly
vs in extra files)
	-Eric