Untitled thread
Hi all Part of an interface definition in c++ is as follows: interface Account { struct Transaction { enum ttype {deposit, withdraw} direction; unsigned long amount; }; typedef sequence<Transaction> Statement;.
Hi all
Part of an interface definition in c++ is as follows:
interface Account {
struct Transaction {
enum ttype {deposit, withdraw} direction;
unsigned long amount;
};
typedef sequence<Transaction> Statement;
.....
.....
void deposit (in unsigned long amount);
.....
.....
}; //interface
void Account_impl::deposit( CORBA::ULong amount )
throw(
::CORBA::SystemException)
{
bal += amount;
std::map<std::string, Account::Transaction> trans_details;
trans.amount = amount;
trans.direction = deposit; (<<----)
trans_details.insert( std::pair<std::string,Account::Transaction>("Deposit",trans) );
}
When running the function deposit, I need to keep a track of all the transactions.
<trans> and <trans_details> already defined elsewhere.
Now I am getting error message on line (<<---) above - "Cannot resolve overloaded function based on conversion to type Account:Transaction:ttype".
How can I keep alog of t he transaction taking place in Function deposit().
Thanks
Part of an interface definition in c++ is as follows:
interface Account {
struct Transaction {
enum ttype {deposit, withdraw} direction;
unsigned long amount;
};
typedef sequence<Transaction> Statement;
.....
.....
void deposit (in unsigned long amount);
.....
.....
}; //interface
void Account_impl::deposit( CORBA::ULong amount )
throw(
::CORBA::SystemException)
{
bal += amount;
std::map<std::string, Account::Transaction> trans_details;
trans.amount = amount;
trans.direction = deposit; (<<----)
trans_details.insert( std::pair<std::string,Account::Transaction>("Deposit",trans) );
}
When running the function deposit, I need to keep a track of all the transactions.
<trans> and <trans_details> already defined elsewhere.
Now I am getting error message on line (<<---) above - "Cannot resolve overloaded function based on conversion to type Account:Transaction:ttype".
How can I keep alog of t he transaction taking place in Function deposit().
Thanks
Participate on our website and join the conversation
This topic is archived. New comments cannot be posted and votes cannot be cast.