You can open the tcl file in notepad, from there you should be able to follows the test logic. Have a look at what it is testing for and where you are failing. This is what I did to figure out where I was going wrong. I also found that I wasn't passing my exceptions correctly (had and & where I should have had one) and once I corrected this everything went better.by lionelzone - COS3114
http://osprey.unisa.ac.za/download/COS311-4/solution_code/client_ass3.zipby lionelzone - COS3114
You shouldn't mess with us like this. There were only 11 tests in the client.tcl file.by lionelzone - COS3114
When you edited the MakeVars file did you only change c:\mico to c:\unisa\mico? I ask because I have compared my Makevar and your Makevar and found that my LDLIBS line is different. This is the line in my makevars: LDLIBS = $(MICO)/bin/mico2311.dll -lmicocoss2.3.11 -lpthread I also setup my makefile to use a copy of the Makevars which I put directly into c:\unisa\mico. So my include line is:by lionelzone - COS3114
Firstly, I submitted my assignment on the 19th of May at the UNISA offices in Kimberley. No I know that there was a backlog with the assignments department, but I am a bit concerned that myUnisa now shows that my assignment was only submitted on 4th of July!, more than a month late! Secondly, I downloaded the 202 tut and see that everyone that submitted an assignment will get the 100 credits.by lionelzone - INF320E
Have a look at the thread I posted "Assigning a dummy account pointer". You should be able to get most of your answers there. Including how I destroy() the account. Hope it helps.by lionelzone - COS3114
I was looking at your makefile and there does seem to be a line missing after server and client: server: $(SERVEROBJS) <tab> $(LD) $(LDFLAGS) -o server.exe $(SERVEROBJS) $(LDLIBS) client: $(CLIENTOBJS) <tab> $(LD) $(LDFLAGS) -o server.exe $(SERVEROBJS) $(LDLIBS) I know is wasn't in the tut letter but I needed it to get a the exe files. I'm also not sure if this isby lionelzone - COS3114
In the 5 years I have been studying at UNISA I can definitely say that you have been the most approachable and accessible lecturer (Oops, senior lecturer) in all that time. I have received more assistance from you in this one module than I have received in all the other modules combined. You will be sorely missed. Good luck for the future and thank you once again. Lionel.by lionelzone - COS3114
P.S. The flow of my program is not in the sequence as I specified above though. First I check for an empty map (if ... else). Then I check for active accounts if the map is not empty. Then I test the account name and password. But I figured you would have done all this already.by lionelzone - COS3114
When I create a new account implementation from bank.open(), i.e.: Account_impl * ai = new Account_impl(); I then store ai in the map: // Store Name and Account_impl activeAccounts.insert(pair<string, Account_impl*> (nstr, ai)); Now when I check for active I can assign a temp account_impl (called impl) to the account_impl stored in the map: ... for (activeCheckby lionelzone - COS3114
I still can't get reference counting to work. But I have finished my assignment and it passes all the tests (and I didn't even have to change the tests to get it to work!!!). FYI, this is what I did. I declare a CORBA::Boolean variable called active in the account_impl.h file. When I access Account_impl::Account_impl I set active to true and when I run the destroy() methode I sby lionelzone - COS3114
Oops, my bad. Firstly, the function is _this(), and secondly you should add an instance to your map using insert. So the code would be something like: ::Account_ptr ptr = account->_this(); backup.insert(pair<string, Account_ptr> (name, ptr));by lionelzone - COS3114
Nope, I just deactivate the account and all the references to it. Do you think we need to do reference counting, and then remove references as we goi along?by lionelzone - COS3114
If you deactivate the account in the destroy() method using: PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this); // deactivate object _default_POA ()->deactivate_object (*oid); transList.erase(transList.begin(), transList.end()); Then you release the used memory back to the OS. If you then try to access it (even using _non_existent() which does not geneby lionelzone - COS3114
I also realised that this would not work, quite possibly under any OS, but expecially under XP. I am now only stuck with removing the account name from the various maps I have created to store the account names, password and pointers. Both the two ideas that I posted above have not worked. I therefore decided to try a third option that I was sure would work. Namely, I changed the Account_iby lionelzone - COS3114
You can get the account pointer by using: account->this(); It will return a referance to the account of type ::Account_ptr. So you can store it in your map by using: std::map<std::string, ::Account_ptr> currentList; and then use: currentList = account->this(); Hope this helps.by lionelzone - COS3114
Hi Mariusvn I tried this as well (using the _non_existent() method) to check if the account still exists. The problem is when you deactive the account using the POA, the memory is released back to the OS. I am running on windows XP, so when I try to check if the account still exists Windows XP has a bit of a fit because the server.exe is trying to access a memory address that it no longer hasby lionelzone - COS3114
Oops, forgot to mention. I now realise that the windows cmd box is crashing because I am trying to access a memory address that has been released (i.e. control has been returned to the OS). That is why Windows XP is having a bit of a fit.by lionelzone - COS3114
I have used the method you suggested for releasing the memory that the account implementation is using, namely: // find out our object id in the POA PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this); // deactivate object _default_POA ()->deactivate_object (*oid); transList.erase(transList.begin(), transList.end()); What I am stuggling with is beinby lionelzone - COS3114
I think your 6th line in Bank_impl.h should be: ::Account_ptr open( const char* name, const char* password ) Regards, Lionelby lionelzone - COS3114
I gave up on trying to redirect a new PTR to an old PTR and thought I would try to check if the PTR exisits directly from my map of PTR records. I was pleasantly surprised when I came across the _non_existant_() call that is not supposed to raise any exceptions. So I used it as follows: // Check for inactive accounts std::map<string, Account_ptr>::iterator activeCheck;by lionelzone - COS3114
I want to try and use a dummy account ptr to check if the account is still active by calling an Active() function. I create a dummy account_impl using: - Account_impl* at = new Account_impl; I then use a for loop to go through my map of account pointer records and now want to redirect "at" to the first of these pointers, but I have not been able to get it to work. At firstby lionelzone - COS3114
Just to make sure. Have you included the declarations: #include "account.h" #include "bank_impl.h" in your server.cc file, as well as all the other bits and bobs, like initializing the orb?by lionelzone - COS3114
I have setup a map to store the account name and password and all the logic for existing account names versus new account names is working. What I wanted to do now was create a second map using the same account name but this time store the account pointer (Account_ptr) that is generated when the account is first created. I was going to use this map to return the Account_ptr if the account namby lionelzone - COS3114
Is there anyway to submit Assignment 2 electronically?by lionelzone - INF320E
Thanks for everything. It working well now.by lionelzone - COS3114
Thanks for all the help. At least my program is not bombing any longer. But I am still not getting the incorrect country code. Now I get the following on the client side: Unknown currency code: IDL:Currency/Convertor/unknownCode:1.0 I assign the unknownCode as follows: Currency::Convertor::unknownCode e(toCode); This seems to compile find, but if I put in the following code:by lionelzone - COS3114
It still does the same thing. I obviously don't want to display all my code here but I think I can show you the following: My currency_impl.cc has the following procedure header: CORBA::double Convertor_impl::convert( CORBA::double amount, const char* fromCode, const char* toCode ) throw( ::Currency::Convertor::unknownCode) So from this you can see that I have created thisby lionelzone - COS3114
In my currency_impl.cc file I have converted the fromCode and toCode to string. I then test for a valid string (i.e. ZAR, GWP or USD) using if statements. If the string is invalid I "throw()" the invalid string. In the client.cc file I "try" the execute the convertor program and if it is invalid I catch the error string using "catch (string unknownCode)". Everyby lionelzone - COS3114