I am new to CAP'N PROTO. I have created cap'n proto a structure and part of structure mentioned below:
**struct InjectorRequestMsg {
dataFrame @0: InjectorDataFrame;
injectorRequestID @1: UInt32;
injectorID @2: UInt32;
injectorScriptPath @3: Text;
injectorFuncName @4: Text;
injectorLogPath @5: Text;
}**
Then, I am writing a builder in my C++ code as follows:
::capnp::MallocMessageBuilder message;
InjectorRequestMsg::Builder injectorRequestMsg = message.initRoot<InjectorRequestMsg>();
Then, subsequent allocations also working fine and I am able to set all the values.
But, when I try to declare and initialize InjectorRequestMsg::Builder like
InjectorRequestMsg::Builder injectorRequestMsg;
injectorRequestMsg = message.initRoot<InjectorRequestMsg>();
Then, it gives below error: capnproto/InjectorMessage.capnp.h:197:3: error: declared here Builder() = delete; // Deleted to discourage incorrect usage.
Hence, could you please help me to understand how can I declare and initialize InjectorRequestMsg::Builder injectorRequestMsg in two different steps, so that I will make InjectorRequestMsg::Builder injectorRequestMsg as data-member of a C++ class and all member functions of C++ class can access it?