Jump to content
Compatible Support Forums
Sign in to follow this  
j_a_rasheed

Untitled thread

Recommended Posts

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

 

 

 

 

 

 

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×