Making an array available outside of a function
I have the following code:
class Transaction : public transactor<>
{
public:
Transaction(arg1, arg2) // can put any number of args
:transactor<>(arg1)
{
//some initialization
}
void operator()(argument_type &T)
{
//create an array
//cannot modify outside program from here
}
void on_commit()
{
//must make array created in operator()() available to outside program here
//cannot return anything
}
Both operator()()
and on_commit()
are called by 3rd party code.
In the operator()()
method, I create an array after querying a database. In case the transaction fails, the outside program cannot be changed at this point. This must all be done in the on_commit()
method.
The question is: How can I make this array available to th开发者_开发技巧e outside program?
I am quite new to C++ and I understand this is likely a rather simple question.
精彩评论