PDA

View Full Version : Need help in C++ code


lalithkc
10-10-2004, 07:34 PM
This code should work on HP UNIX,I don't want anybody to write source code for me, what i am looking here is general algorithm about how to implement the methods using variables that declared in class


********************************************************
class CSession {
private:
char m_sTellerId[4+1];
char m_sPassword[2+1];
const Int32 m_nId; //The session’s unique id
MsgSwitch* m_pobMsgSwitch; // The message switch
SubsysMessage_ t*_pstRequest; // The API request from the client
SubsysMessage_ t* _pstReply; // The API response to the client
bool m_bApiDone // True if and only if the API is finished
public:
CSession(MsgSwitch* pobMsgSwitch); // Initializes internal fields
~CSession(); // Cleans up the session
Int32 getId(); // Returns the session’s id
bool isApiDone(); // Returns the value of m_bApiDone
void apiDone(); // Sets m_bApiDone to true
void setupApi(); // Sets up the session for a new API
void sendReply(); // Sends m_pstReply to the client
};

The class’s methods should do the following tasks:
----> Constructor(should do below tasks)
1) Ensure that m_nId has a unique number for each session object
2) Set the m_pobMsgSwitch to the incoming parameter
3) Call setupApi() method
4) Get the login information out of the request’s UserData field
5) Perform any other necessary login logic (e.g., setting up the
reply).
---- > Destructor(should do below taks)
1) Clean up all the member variables
2) getId()
Return the value of m_nId
3) isApiDone()
Return true if the reply (m_pstReply) is ready to return to the
client
4) apiDone()
Tell the session that the reply (m_pstReply) is ready to be sent by
setting m_bApiDone to true.

sage45
10-11-2004, 01:40 PM
Off topic post...

Is it safe for me to assume that you are in KC, MO???

-sage-