Hi, Ted,
Thanks for your replying,
18 class UserStorageHandler : virtual public UserStorageIf {
19 public:
20 UserStorageHandler() {
21 // Your initialization goes here
22 }
23
24 void store(const UserProfile& user) {
25 // Your implementation goes here
26 printf("store\n");
27 }
28
29 void retrieve(UserProfile& _return, const int32_t uid) {
30 // Your implementation goes here
31 printf("retrieve\n");
32 }
33
34 };
the above is the generated code, do you mean I should remove those {} and
printf(), and change this generated cpp file as a header file, and then
implement the functions in a cpp?
Best
--
Nan Zhu
School of Computer Science,
McGill University
在 2012年9月28日星期五,下午1:13,Ted Dunning 写道:
> You should never modify the generated code by hand. Implement them in a
> separate file.
>
> On Fri, Sep 28, 2012 at 1:07 PM, Nan Zhu <[email protected]
> (mailto:[email protected])> wrote:
>
> > Hi, all
> >
> > I met a question during my development using Thrift
> >
> > e.g. at the beginning of the project, I generate the c++ code from
> > ".thrift" file, and then I work on those RPC callees to implement them,
> > after that, I found I need to add another callee to the system, I modify
> > the .thrift file and generate the C++ code again,
> >
> > how should I merge the new version of generated code with my implemented
> > version? do I need to copy the related part manually(e.g. new callee
> > declaration)?
> >
> > Thank you!
> >
> > Best,
> >
> > --
> > Nan Zhu
> > School of Computer Science,
> > McGill University
> >
>
>
>