transfering a container of data to different classes

Posted by user340699 on Stack Overflow See other posts from Stack Overflow or by user340699
Published on 2010-05-13T21:06:20Z Indexed on 2010/05/13 21:14 UTC
Read the original article Hit count: 212

Filed under:

I am passing a vector of bids from Trader class to Simulator class.which class then passes it on to the auctioneer class.something seems messed up, can anyone spot it please.

Below is part of the code: Error: 199 expected primary-expression before '&' token

//Class of Origin of the vector. 
class Trader {    
private:    
        int nextBidId;  

public:    
        Trader();  
        ~Trader(){};   
        Bid getNextBid();   
        Bid getNextBid(int trdId, int qty, int price, char type);   
        void loadRange( vector <Bid> & bids ) {} ; 
        void loadRange(BidList &, int trdId, int qty, int price, char type, int size);  

};  
//To be received by the Simulator 
 class Simulator  
{  
    vector <Bid> list; 
    Trader trader;  
    Auctioneer auctioneer;  

public: 
    void run();  
};  

// Passing the vector into a function in simulator 
Simulator::accept_bids(bid_vector::const_iterator begin, bid_vector::const_iterator end){ 
     vector<Bid>::iterator itr; 
} 
//Its journey should end with the Auctioneer. who displays the data 
class Auctioneer  
{  

public:  
    vector <Bid>v2;// created a new vector to hold the objects 
    void accept_bids(vector<Bid> & bids); 
    void displayBids(){return bids} 
};

© Stack Overflow or respective owner

Related posts about c++