% Remember to use the lgrind style \File{standard.cc},{12:08},{Oct 24 1996} \L{\LB{\K{\#include}_\S{}\"packers.hh\"\SE{}____________________\1\1_\V{Include}_\V{the}_\V{header}_\V{definition}_\K{for}}} \L{\LB{_________________________________________\1\1__\V{the}_\V{common}_\V{interface}_\V{declaration}}} \L{\LB{_________________________________________\1\1__\K{for}_\V{the}_\V{distributed}_\V{class}}} \L{\LB{\K{\#include}_\S{}\"Buffer.h\"\SE{}______________________\1\1_\V{Provide}_\V{Support}_\K{for}_\V{Buffer}_\V{Class}}} \L{\LB{\K{\#include}_\<\V{iostream}.\V{h}\>____________________\1\1_\V{Provide}_\V{Support}_\K{for}_\V{IO}_\V{handling}_}} \L{\LB{}} \L{\LB{\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1}} \L{\LB{\1\1\V{Function}:_\V{main}_____________________}} \L{\LB{\1\1\V{Author}:_\V{Dean}_\V{Thompson}______________}} \L{\LB{\1\1\V{Created}:_3rd_\V{August}_1996___________}} \L{\LB{\1\1\V{Last}_\V{Modified}:_4th_\V{October}_1996____}} \L{\LB{\1\1\V{Description}:__\V{This}_\V{routine}_\V{is}______}} \L{\LB{\1\1__\V{responsible}_\K{for}_\V{conducting}_\V{the}___}} \L{\LB{\1\1__\V{test}_\V{by}_\V{doing}_\V{the}_\V{following}:_____}} \L{\LB{\1\1___________________________________}} \L{\LB{\1\1____\*_\V{Creating}_\V{two}_\V{objects}_________}} \L{\LB{\1\1____\*_\V{Binding}_\V{to}_\V{two}_\V{servers}_______}} \L{\LB{\1\1____\*_\V{Setting}_\V{the}_\V{data}_\V{up}_\V{into}_\V{the}_}} \L{\LB{\1\1________\V{objects}____________________}} \L{\LB{\1\1____\*_\V{Passing}_\V{the}_\V{data}_\V{between}_\V{the}_}} \L{\LB{\1\1________\V{the}_\V{objects}_10,000_\V{times}___}} \L{\LB{\1\1____\*_\V{Print}_\V{the}_\V{contents}_\V{out}_\V{to}_\V{the}}} \L{\LB{\1\1________\V{screen}_____________________}} \L{\LB{\1\1___________________________________}} \L{\LB{\1\1____\*_(\V{Standard}_\V{Implementation})_____}} \L{\LB{\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1}} \L{\LB{}} \L{\LB{\K{int}_\V{main}()}} \L{\LB{\{}} \L{\LB{__\V{Packers\_var}_\V{aPackerVar},\V{bPackerVar};_____\1\1_\V{CORBA}_\V{variables}_\V{designed}_\V{to}_}} \L{\LB{_________________________________________\1\1__\V{manage}_\V{pointers}_\V{to}_\V{objects}_}} \L{\LB{_________________________________________\1\1__\V{which}_\V{are}_\S{}\"bound\"\SE{}_\V{to}_\V{a}_\V{server}_}} \L{\LB{}} \L{\LB{__\K{short}_\V{aShort},\V{bShort};___________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{short}_\V{data}_\V{member}}} \L{\LB{_}} \L{\LB{__\K{long}_\V{aLong},\V{bLong};______________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{long}_\V{data}_\V{member}}} \L{\LB{_}} \L{\LB{__\K{unsigned}_\K{short}_\V{aUnsignedShort};_________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{unsigned}_\K{short}}} \L{\LB{_________________________________________\1\1__\V{data}_\V{member}}} \L{\LB{_}} \L{\LB{__\K{unsigned}_\K{long}_\V{aUnsignedLong};___________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{unsigned}_\K{long}}} \L{\LB{_________________________________________\1\1__\V{data}_\V{member}}} \L{\LB{}} \L{\LB{__\K{float}_\V{aFloat},\V{bFloat}____________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{float}_\V{data}_\V{member}}} \L{\LB{_}} \L{\LB{__\K{double}_\V{aDouble},\V{bDouble};________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\K{double}_\V{data}_\V{member}}} \L{\LB{_}} \L{\LB{__\K{char}_\V{aCharacter};_______________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\V{character}_\V{data}}} \L{\LB{_________________________________________\1\1__\V{member}_}} \L{\LB{}} \L{\LB{__\V{CORBA}::\V{Boolean}_\V{aBoolean};_______________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\V{boolean}_\V{data}_}} \L{\LB{_________________________________________\1\1__\V{member}__}} \L{\LB{}} \L{\LB{__\V{CORBA}::\V{string}_\V{aString};_________________\1\1_\V{Declare}_\V{a}_\V{local}_\V{variable}_\V{which}_\V{is}}} \L{\LB{_________________________________________\1\1__\V{used}_\V{to}_\V{set}_\V{the}_\V{character}_\V{array}}} \L{\LB{_________________________________________\1\1__\V{data}_\V{member}__}} \L{\LB{}} \L{\LB{__\V{aString}_=_\V{CORBA}::\V{string\_alloc}(1000);___\1\1_\V{Allocate}_\V{memory}_\K{for}_\V{the}_\V{character}}} \L{\LB{_________________________________________\1\1__\V{array}_}} \L{\LB{}} \L{\LB{__\V{aPackerVar}_=_\V{Packers}::\V{\_bind}();_________\1\1_\V{Make}_\V{contact}_\V{with}_\V{one}_\V{server}}} \L{\LB{}} \L{\LB{__\V{bPackerVar}_=_\V{Packers}::\V{\_bind}(\S{}\":ObjectStore2\"\SE{},\S{}\"firefly.sd.monash.edu.au\"\SE{});}} \L{\LB{_________________________________________\1\1_\V{Make}_\V{contact}_\V{with}_\V{a}_\V{second}_\V{server}}} \L{\LB{_________________________________________\1\1__\V{located}_\V{on}_\S{}\"firefly.sd\"\SE{}_}} \L{\LB{}} \L{\LB{__\V{aLong}_=_\-2100000000;___________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"long\"\SE{}_\V{variable}}} \L{\LB{__\V{bLong}_=_\-2100000000;}} \L{\LB{}} \L{\LB{__\V{aUnsignedLong}_=_4200000000;____________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"unsigned_long\"\SE{}}} \L{\LB{_________________________________________\1\1__\V{variable}_}} \L{\LB{}} \L{\LB{__\V{aUnsignedShort}_=_65535;________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"unsigned_short\"\SE{}}} \L{\LB{_________________________________________\1\1__\V{variable}_}} \L{\LB{}} \L{\LB{__\V{aFloat}_=_\-65545.57;____________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"float\"\SE{}_\V{variable}}} \L{\LB{__\V{bFloat}_=_\-65545.57;}} \L{\LB{}} \L{\LB{__\V{aDouble}_=_6000;________________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"double\"\SE{}_\V{variable}}} \L{\LB{__\V{bDouble}_=_6000;}} \L{\LB{}} \L{\LB{__\V{aCharacter}_=_\S{}\'M\'\SE{};______________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"character\"\SE{}_\V{variable}}} \L{\LB{}} \L{\LB{__\V{aBoolean}_=_1;__________________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"boolean\"\SE{}_\V{variable}}} \L{\LB{}} \L{\LB{__\V{strcpy}(\V{aString},_\S{}\"Data_Transfer_Test_for_Communications_Data.\,.\,.\,.\,.\,.\,.\,.\"\SE{});}} \L{\LB{______\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"character_array\"\SE{}_}} \L{\LB{______\1\1__\V{variable}}} \L{\LB{}} \L{\LB{__\K{for}_(\K{int}_\V{i}=0;\V{i}\<10000;\V{i}++)______________\1\1_\V{Setting}_\V{up}_\V{the}_\V{looping}_\V{construct}_}} \L{\LB{_________________________________________\1\1__\K{for}_10,000_\V{iterations}_}} \L{\LB{___\{}} \L{\LB{_____\V{try}_________________________________\1\1_\V{Make}_\V{all}_\V{the}_\V{CORBA}_\V{calls}_\V{with}_\V{the}}} \L{\LB{_________________________________________\1\1__\V{safety}_\V{of}_\V{a}_\S{}\"try\"\SE{}_\V{block}_\V{to}_\S{}\"catch\"\SE{}}} \L{\LB{_________________________________________\1\1__\V{any}_\V{errors}}} \L{\LB{____\{}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Iteration_\#\"\SE{}_\<\<_\V{i}+1_\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{_________________________________________\1\1_\V{Report}_\V{the}_\V{number}_\V{of}_\V{the}_\V{iteration}}} \L{\LB{_________________________________________\1\1__\V{that}_\V{we}_\V{are}_\V{currently}_\V{on}}} \L{\LB{}} \L{\LB{_____\V{aShort}_=_\V{i}+1;_______________________\1\1_\V{Set}_\V{the}_\V{local}_\S{}\"short\"\SE{}_\V{variable}_\V{to}}} \L{\LB{_________________________________________\1\1__\V{the}_\V{current}_\V{iteration}}} \L{\LB{_____\V{bShort}_=_\V{i}+1;}} \L{\LB{_}} \L{\LB{_____\V{aPackerVar}\-\!\>\V{defaultSave}(\V{aShort},_\V{aLong},_\V{aUnsignedShort},_\V{aUnsignedLong},}} \L{\LB{_____________________________\V{aFloat},_\V{aDouble},_\V{aCharacter},_\V{aBoolean},__\V{aString},}} \L{\LB{__}\Tab{24}{_____\V{bFloat},_\V{bDouble},_\V{bShort},_\V{bLong});}} \L{\LB{}} \L{\LB{_________________________________________\1\1_\V{Pass}_\V{all}_\V{the}_\V{local}_\V{data}_\V{to}_\V{the}_}} \L{\LB{_________________________________________\1\1__\V{first}_\V{object}_\V{and}_\V{get}_\V{that}_\V{object}}} \L{\LB{_________________________________________\1\1__\V{to}_\V{store}_\V{the}_\V{data}__}} \L{\LB{}} \L{\LB{_____\V{aPackerVar}\-\!\>\V{defaultLoad}(\V{aShort},_\V{aLong},_\V{aUnsignedShort},_\V{aUnsignedLong},}} \L{\LB{_____________________________\V{aFloat},_\V{aDouble},_\V{aCharacter},_\V{aBoolean},_\V{aString},}} \L{\LB{}\Tab{24}{_____\V{bFloat},_\V{bDouble},_\V{bShort},_\V{bLong});}} \L{\LB{}} \L{\LB{_________________________________________\1\1_\V{Get}_\V{all}_\V{the}_\V{data}_\V{back}_\V{from}_\V{the}}} \L{\LB{_________________________________________\1\1__\V{first}_\V{object}_\V{that}_\V{we}_\V{connected}_\V{to}}} \L{\LB{}} \L{\LB{_____\V{bPackerVar}\-\!\>\V{defaultSave}(\V{aShort},_\V{aLong},_\V{aUnsignedShort},_\V{aUnsignedLong},}} \L{\LB{_____________________________\V{aFloat},_\V{aDouble},_\V{aCharacter},_\V{aBoolean},_\V{aString},}} \L{\LB{}\Tab{24}{_____\V{bFloat},_\V{bDouble},_\V{bShort},_\V{bLong});}} \L{\LB{}} \L{\LB{_________________________________________\1\1_\V{Take}_\V{all}_\V{the}_\V{data}_\V{that}_\V{we}_\V{received}}} \L{\LB{_________________________________________\1\1__\V{from}_\V{the}_\V{first}_\V{object}_\V{and}_\V{use}_\V{it}}} \L{\LB{_________________________________________\1\1__\V{as}_\V{input}_\V{data}_\K{for}_\V{the}_\V{second}}} \L{\LB{_________________________________________\1\1__\V{object}}} \L{\LB{}} \L{\LB{_____\1\1_\V{To}_\V{make}_\V{sure}_\V{that}_\V{the}_\V{data}_\V{was}_\V{sent}_\V{to}_\V{the}_\V{second}_\V{object}_\V{correctly}}} \L{\LB{_____\1\1__\V{the}_\V{client}_\V{request}_\V{all}_\V{that}_\V{data}_\V{to}_\V{be}_\V{sent}_\V{back}_\V{and}_\V{displayed}_\V{to}_\V{the}}} \L{\LB{_____\1\1__\V{screen}}} \L{\LB{}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_short:_\"\SE{}_\<\<_\V{bPackerVar}\-\!\>\V{aShort}()_\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{______________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_short}} \L{\LB{_}} \L{\LB{_____cout_\<\<_\"Reconstructed_long:_\"_\<\<_bPackerVar\-\!\>aLong()_\<\<_\".\"_\<\<_endl;}} \L{\LB{______________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\K{long}}} \L{\LB{}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_unsigned_short:_\"\SE{}_\<\<_\V{bPackerVar}\-\!\>\V{aUnsignedShort}()_}} \L{\LB{__________\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{___________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_unsigned_short_}} \L{\LB{}} \L{\LB{_____cout_\<\<_\"Reconstructed_unsigned_long:_\"_\<\<_bPackerVar\-\!\>aUnsignedLong()_}} \L{\LB{__________\<\<_\".\"_\<\<_endl;}} \L{\LB{___________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\K{unsigned}_\K{long}}} \L{\LB{}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_float:_\"\SE{}_\<\<_\V{bPackerVar}\-\!\>\V{aFloat}()_\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{___________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_float}} \L{\LB{}} \L{\LB{_____cout_\<\<_\"Reconstructed_double:_\"_\<\<_bPackerVar\-\!\>aDouble()_\<\<_\".\"_\<\<_endl;}} \L{\LB{___________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\K{double}}} \L{\LB{_}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_character:_\"\SE{}_\<\<_(\K{char})_\V{bPackerVar}\-\!\>\V{aCharacter}()_}} \L{\LB{__________\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{___________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_character}} \L{\LB{}} \L{\LB{_____cout_\<\<_\"Reconstructed_boolean:_\"_\<\<_(int)_bPackerVar\-\!\>aBoolean()_\<\<_\".\"_}} \L{\LB{__________\<\<_endl;}} \L{\LB{___________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\V{boolean}}} \L{\LB{_}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_string:_\"\SE{}_\<\<_\V{bPacketVar}\-\!\>\V{aString}()_\<\<_\S{}\".\"\SE{}_}} \L{\LB{__________\<\<_\V{endl};}} \L{\LB{___________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_string_after_it_was}} \L{\LB{___________\1\1___return_from_the_inital_object}} \L{\LB{__}} \L{\LB{_____cout_\<\<_\"Reconstructed_short:_\"_\<\<_bPackerVar\-\!\>bShort()_\<\<_\".\"_\<\<_endl;}} \L{\LB{______________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\K{short}}} \L{\LB{_}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_long:_\"\SE{}_\<\<_\V{bPackerVar}\-\!\>\V{bLong}()_\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{______________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_long}} \L{\LB{}} \L{\LB{_____cout_\<\<_\"Reconstructed_float:_\"_\<\<_bPackerVar\-\!\>bFloat()_\<\<_\".\"_\<\<_endl;}} \L{\LB{___________\1\1__Display_the_value_of_the_remote_object\'\SE{}\V{s}_\K{float}}} \L{\LB{}} \L{\LB{_____\V{cout}_\<\<_\S{}\"Reconstructed_double:_\"\SE{}_\<\<_\V{bPackerVar}\-\!\>\V{bDouble}()_\<\<_\S{}\".\"\SE{}_\<\<_\V{endl};}} \L{\LB{___________\1\1__\V{Display}_\V{the}_\V{value}_\V{of}_\V{the}_\V{remote}_\V{object}\S{}\'s_double}} \L{\LB{_}} \L{\LB{}} \L{\LB{_____cout_\<\<_endl;}} \L{\LB{}} \L{\LB{____\}}} \L{\LB{_____catch(CORBA::SystemException_\&se)___\1\1_catch_any_CORBA::SystemException}} \L{\LB{____\{}} \L{\LB{______CORBA::string\_free(aString);_______\1\1_De\-Allocate_any_memory_that_was}} \L{\LB{_________________________________________\1\1__allocated}} \L{\LB{______cout_\<\<_\"Error\"_\<\<_\&se_\<\<_endl;____\1\1_Display_the_data_about_the_}} \L{\LB{_________________________________________\1\1__associated_error}} \L{\LB{}} \L{\LB{______return_1;}} \L{\LB{____\}}} \L{\LB{___\}}} \L{\LB{__CORBA::string\_free(aString);___________\1\1_De\-Allocate_any_memory_that_was}} \L{\LB{_________________________________________\1\1__allocated}} \L{\LB{__return_0;}} \L{\LB{\}}} \L{\LB{}}