%!PS-Adobe-2.0 %%Creator: dvips, version 5.396 (C) 1986-90 Radical Eye Software %%Title: cxx-pkg.dvi %%Pages: 13 1 %%BoundingBox: 0 0 612 792 %%DocumentFonts: Times-Roman Times-Bold Courier Times-Italic %%EndComments %%BeginProcSet: tex.pro /TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{ isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale Resolution VResolution vsize neg mul TR}B /@letter{/vsize 10 N}B /@landscape{ /isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B /@legal{/vsize 13 N} B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[ 1 0 0 -1 0 0]N /FBB[0 0 0 0]N /df{/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /df-tail{/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /E{pop nn dup definefont setfont}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ctr 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{ ]}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto}B /eop{ clear SI restore showpage userdict /eop-hook known{eop-hook}if}B /@start{ userdict /start-hook known{start-hook}if /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for} B /p /show load N /RMat[1 0 0 -1 0 0]N /BDot 8 string N /v{/ruley X /rulex X V }B /V{gsave TR -.1 -.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}B /a{moveto}B /delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{ 1 M}B /i{2 M}B /j{3 M}B /k{4 M}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w }B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /w{0 rmoveto}B /x{0 S rmoveto} B /y{3 2 roll p a}B /bos{/SS save N}B /eos{clear SS restore}B end %%EndProcSet %%BeginProcSet: texps.pro TeXDict begin /rf{655360 div mul Resolution mul 7227 div /PixPerEm X findfont dup length 1 add dict /nn X{1 index /FID ne{nn 3 1 roll put}{pop pop}ifelse} forall 256 dict begin nn /Encoding get 0 1 255{2 copy get 3 index 2 index get 1000 mul PixPerEm div N pop}for pop pop nn /Metrics currentdict put end /fontname X /nn dup nn definefont[PixPerEm 0 0 PixPerEm neg 0 0]makefont N fontname{/foo setfont}2 array copy cvx N fontname load 0 nn put}B /ObliqueSlant{dup sin S cos div neg}B /SlantFont{/foo X[1 0 foo 1 0 0] TransFont}B /ExtendFont{/foo X 3 2 roll[S{foo div}forall]3 1 roll[foo 0 0 1 0 0]TransFont}B /TransFont{S findfont S makefont dup length dict /nn X{1 index /FID ne{nn 3 1 roll put}{pop pop}ifelse}forall dup nn definefont pop}B end %%EndProcSet TeXDict begin 1000 300 300 @start /Fa 1 16 df<03C00FF01FF83FFC7FFE7FFEFFFFFFFF FFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80FF003C010127D9317>15 D E /Fb [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 15 19 23 23 38 35 15 15 15 23 31 11 15 11 13 23 23 23 23 23 23 23 23 23 23 15 15 31 31 31 23 42 28 28 30 33 28 28 33 33 15 20 30 25 38 30 33 28 33 28 23 25 33 28 38 28 25 25 18 13 18 19 23 15 23 23 20 23 20 13 23 23 13 13 20 13 33 23 23 23 23 18 18 13 23 20 30 20 20 18 18 12 18 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 23 23 8 23 23 23 23 10 25 23 15 15 23 23 0 23 23 23 11 0 24 16 15 25 25 23 40 45 0 23 0 15 15 15 15 15 15 15 15 0 15 15 0 15 15 15 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 0 13 0 0 0 0 25 33 43 14 0 0 0 0 0 30 0 0 0 13 0 0 13 23 30 23 0 0 0 0 ] /Times-Italic 1000 717619 rf /Fc [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 15 25 23 23 45 38 15 15 15 23 26 11 15 11 13 23 23 23 23 23 23 23 23 23 23 15 15 26 26 26 23 42 33 30 33 33 30 28 35 35 18 23 35 30 43 33 35 28 35 33 25 30 33 33 45 33 33 30 15 13 15 26 23 15 23 25 20 25 20 15 23 25 13 15 25 13 38 25 23 25 25 20 18 15 25 23 33 23 23 20 18 10 18 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 23 23 8 23 23 23 23 13 23 23 15 15 25 25 0 23 23 23 11 0 25 16 15 23 23 23 45 45 0 23 0 15 15 15 15 15 15 15 15 0 15 15 0 15 15 15 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 45 0 14 0 0 0 0 30 35 45 15 0 0 0 0 0 33 0 0 0 13 0 0 13 23 33 25 0 0 0 0 ] /Times-Bold 1000 717619 rf /Fd [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 8 10 12 12 21 19 8 8 8 12 14 6 8 6 7 12 12 12 12 12 12 12 12 12 12 7 7 14 14 14 11 23 18 17 17 18 15 14 18 18 8 10 18 15 22 18 18 14 18 17 14 15 18 18 24 18 18 15 8 7 8 12 12 8 11 12 11 12 11 8 12 12 7 7 12 7 19 12 12 12 12 8 10 7 12 12 18 12 12 11 12 5 12 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 12 12 4 12 12 12 12 4 11 12 8 8 14 14 0 12 12 12 6 0 11 9 8 11 11 12 25 25 0 11 0 8 8 8 8 8 8 8 8 0 8 8 0 8 8 8 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 0 7 0 0 0 0 15 18 22 8 0 0 0 0 0 17 0 0 0 7 0 0 7 12 18 12 0 0 0 0 ] /Times-Roman 1000 393216 rf /Fe [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 22 22 22 22 22 22 22 22 22 22 22 22 0 0 0 22 22 22 22 0 22 22 22 22 22 22 22 0 0 22 0 22 22 22 22 22 22 22 22 0 22 22 0 22 22 22 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 0 0 0 0 22 22 0 22 0 0 0 0 0 0 0 0 0 22 0 0 22 22 0 22 0 0 0 0 ] /Courier 1000 589824 rf /Ff [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 11 14 17 17 28 26 11 11 11 17 19 8 11 8 9 17 17 17 17 17 17 17 17 17 17 9 9 19 19 19 15 31 24 22 22 24 20 18 24 24 11 13 24 20 30 24 24 18 24 22 18 20 24 24 31 24 24 20 11 9 11 16 17 11 15 17 15 17 15 11 17 17 9 9 17 9 26 17 17 17 17 11 13 9 17 17 24 17 17 15 16 7 16 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 17 17 6 17 17 17 17 6 15 17 11 11 18 18 0 17 17 17 8 0 15 12 11 15 15 17 33 33 0 15 0 11 11 11 11 11 11 11 11 0 11 11 0 11 11 11 33 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 9 0 0 0 0 20 24 30 10 0 0 0 0 0 22 0 0 0 9 0 0 9 17 24 17 0 0 0 0 ] /Times-Roman 1000 524288 rf /Fg [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 17 28 25 25 50 41 17 17 17 25 28 12 17 12 14 25 25 25 25 25 25 25 25 25 25 17 17 28 28 28 25 46 36 33 36 36 33 30 39 39 19 25 39 33 47 36 39 30 39 36 28 33 36 36 50 36 36 33 17 14 17 29 25 17 25 28 22 28 22 17 25 28 14 17 28 14 41 28 25 28 28 22 19 17 28 25 36 25 25 22 20 11 20 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 25 25 8 25 25 25 25 14 25 25 17 17 28 28 0 25 25 25 12 0 27 17 17 25 25 25 50 50 0 25 0 17 17 17 17 17 17 17 17 0 17 17 0 17 17 17 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 50 0 15 0 0 0 0 33 39 50 16 0 0 0 0 0 36 0 0 0 14 0 0 14 25 36 28 0 0 0 0 ] /Times-Bold 1000 786432 rf /Fh [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 12 15 19 19 31 29 12 12 12 19 21 9 12 9 10 19 19 19 19 19 19 19 19 19 19 10 10 21 21 21 17 34 27 25 25 27 23 21 27 27 12 15 27 23 33 27 27 21 27 25 21 23 27 27 35 27 27 23 12 10 12 18 19 12 17 19 17 19 17 12 19 19 10 10 19 10 29 19 19 19 19 12 15 10 19 19 27 19 19 17 18 7 18 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 19 19 6 19 19 19 19 7 17 19 12 12 21 21 0 19 19 19 9 0 17 13 12 17 17 19 37 37 0 17 0 12 12 12 12 12 12 12 12 0 12 12 0 12 12 12 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33 0 10 0 0 0 0 23 27 33 12 0 0 0 0 0 25 0 0 0 10 0 0 10 19 27 19 0 0 0 0 ] /Times-Roman 1000 589824 rf /Fi 1 4 df<0C000C008C40EDC07F80 0C007F80EDC08C400C000C000A0B7D8B10>3 D E /Fj [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27 27 27 27 27 27 27 0 0 0 27 27 27 27 0 27 27 27 27 27 27 27 0 0 27 0 27 27 27 27 27 27 27 27 0 27 27 0 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 27 27 0 27 0 0 0 0 0 0 0 0 0 27 0 0 27 27 0 27 0 0 0 0 ] /Courier 1000 717619 rf /Fk [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 15 19 23 23 38 35 15 15 15 23 26 11 15 11 13 23 23 23 23 23 23 23 23 23 23 13 13 26 26 26 20 42 33 30 30 33 28 25 33 33 15 18 33 28 40 33 33 25 33 30 25 28 33 33 43 33 33 28 15 13 15 21 23 15 20 23 20 23 20 15 23 23 13 13 23 13 35 23 23 23 23 15 18 13 23 23 33 23 23 20 22 9 22 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 23 23 8 23 23 23 23 8 20 23 15 15 25 25 0 23 23 23 11 0 21 16 15 20 20 23 45 45 0 20 0 15 15 15 15 15 15 15 15 0 15 15 0 15 15 15 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 40 0 13 0 0 0 0 28 33 40 14 0 0 0 0 0 30 0 0 0 13 0 0 13 23 33 23 0 0 0 0 ] /Times-Roman 1000 717619 rf /Fl [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 20 33 30 30 60 50 20 20 20 30 34 15 20 15 17 30 30 30 30 30 30 30 30 30 30 20 20 34 34 34 30 56 43 40 43 43 40 37 47 47 23 30 47 40 56 43 47 37 47 43 33 40 43 43 60 43 43 40 20 17 20 35 30 20 30 33 27 33 27 20 30 33 17 20 33 17 50 33 30 33 33 27 23 20 33 30 43 30 30 27 24 13 24 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 30 30 10 30 30 30 30 17 30 30 20 20 33 33 0 30 30 30 15 0 32 21 20 30 30 30 60 60 0 30 0 20 20 20 20 20 20 20 20 0 20 20 0 20 20 20 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 0 18 0 0 0 0 40 47 60 20 0 0 0 0 0 43 0 0 0 17 0 0 17 30 43 33 0 0 0 0 ] /Times-Bold 1000 943718 rf /Fm 1 4 df<020002000200C218F2783AE00F800F803AE0F278C21802000200 02000D0E7E8E12>3 D E /Fn [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 17 20 25 25 41 39 17 17 17 25 28 12 17 12 14 25 25 25 25 25 25 25 25 25 25 14 14 28 28 28 22 46 36 33 33 36 30 28 36 36 17 19 36 30 44 36 36 28 36 33 28 30 36 36 47 36 36 30 17 14 17 23 25 17 22 25 22 25 22 17 25 25 14 14 25 14 39 25 25 25 25 17 19 14 25 25 36 25 25 22 24 10 24 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 25 25 8 25 25 25 25 9 22 25 17 17 28 28 0 25 25 25 12 0 23 17 17 22 22 25 50 50 0 22 0 17 17 17 17 17 17 17 17 0 17 17 0 17 17 17 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 0 14 0 0 0 0 30 36 44 15 0 0 0 0 0 33 0 0 0 14 0 0 14 25 36 25 0 0 0 0 ] /Times-Roman 1000 786432 rf /Fo [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 24 29 36 36 60 56 24 24 24 36 40 18 24 18 20 36 36 36 36 36 36 36 36 36 36 20 20 40 40 40 32 66 52 48 48 52 44 40 52 52 24 28 52 44 64 52 52 40 52 48 40 44 52 52 68 52 52 44 24 20 24 34 36 24 32 36 32 36 32 24 36 36 20 20 36 20 56 36 36 36 36 24 28 20 36 36 52 36 36 32 34 14 34 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 36 36 12 36 36 36 36 13 32 36 24 24 40 40 0 36 36 36 18 0 32 25 24 32 32 36 72 72 0 32 0 24 24 24 24 24 24 24 24 0 24 24 0 24 24 24 72 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 0 20 0 0 0 0 44 52 64 22 0 0 0 0 0 48 0 0 0 20 0 0 20 36 52 36 0 0 0 0 ] /Times-Roman 1000 1132462 rf end %%EndProlog %%BeginSetup %%Feature: *Resolution 300 TeXDict begin @letter %%EndSetup %%Page: 1 1 bop 580 298 a Fo(Libus++)18 b(Reference)f(Manual)837 425 y Fn(Paulo)12 b(Guedes)1112 407 y Fm(\003)744 483 y Fn(OSF)g(Research)h (Institute)773 541 y(1)f(Cambridge)g(Center)743 599 y(Cambridge,)h(MA)f (02142)851 657 y(pjg@osf.or)o(g)776 758 y(November)g(13,)h(1992)75 1022 y Fl(1)60 b(Intr)o(oduction)75 1126 y Fk(This)9 b(document)h(describes)g (the)g(use)g(of)g(libus++,)f(a)i(C++)f(library)g(to)g(support)e(the)j (construction)d(of)i(clients)f(and)75 1182 y(servers)g(in)h(the)f(Mach)h(3)f (multi-server)g(project.)16 b(Some)10 b(familiarity)f(with)f(the)h (multi-server)g(and)h(MachObjects)75 1239 y(is)h(expected.)146 1295 y(The)18 b(Mach)i(3)f(multi-server)f(was)h(initially)e(implemented)i(in) f(MachObjects.)40 b(This)18 b(library)g(aims)h(at)75 1352 y(replacing)10 b(MachObjects)h(entirely)f(with)h(C++.)75 1498 y Fl(2)60 b(Overview)12 b(of)j(the)g(pr)o(ogramming)e(model)75 1601 y Fk(The)k(services)g(exported)g (by)g(the)h(servers)f(are)h(de\256ned)g(by)f(C++)g(abstract)g(classes.)35 b(Single)17 b(and)g(multiple)75 1657 y(inheritance)11 b(may)h(be)h(used)e(to) g(compose)h(various)f(classes)h(to)f(specify)g(the)h(interface)g(of)g(a)h (service.)18 b(The)12 b(code)75 1714 y(of)f(the)g(clients)f(uses)g(the)h (interface)g(classes)g(to)g(represent)f(the)h(services)g(of)o(fered)h(by)e (the)h(servers.)17 b(A)11 b(service)g(in)75 1770 y(a)h(server)f(is)g (requested)f(by)h(invoking)e(a)j(method)e(of)h(an)h(interface)f(class.)146 1827 y(The)17 b(actual)f(objects)g(instantiated)f(at)i(the)g(client')m(s)g (program)g(are,)j(in)c(fact,)k(subtypes)15 b(of)i(the)g(interface)75 1883 y(classes.)f(These)9 b(derived)g(classes)h(contain)f(a)h(particular)f (implementation.)15 b(In)10 b(the)f(simple)g(cases,)i(they)e(simply)75 1940 y(forward)j(the)g(invocations)e(to)i(the)g(server)n(,)h(acting)e(as)h(a) h(stub.)18 b(In)13 b(more)f(sophisticated)e(cases,)j(they)f(may)g(keep)75 1996 y(local)f(state)f(and)h(perform)h(local)f(processing.)146 2053 y(An)k(implementation)e(class)i(always)g(derives)f(from)i(an)g (interface)f(class.)28 b(In)16 b(general,)g(it)f(uses)f(multiple)75 2109 y(inheritance)d(to)g(also)h(inherit)e(implementation)h(from)h(another)g (class.)18 b(In)12 b(a)g(hierarchy)g(with)f(several)h(layers)f(of)75 2165 y(interface)g(classes,)g(an)g(implementation)f(class)h(that)f (implements)h(the)f(interface)i(of)f(level)g Fj(i)g Fk(inherits)f(from)h(the) 75 2222 y(interface)i(class)f(of)h(level)g Fj(i)g Fk(and)f(from)i(the)e (implementation)g(class)g(that)g(implements)g(the)h(interface)g(of)g(level)75 2278 y Fj(i-1)p Fk(.)146 2335 y(A)f(server)h(may)g(itself)e(be)i(a)g(client)f (of)g(other)g(servers.)21 b(A)12 b(remote)h(invocation)e(service)h(is)g (responsible)f(for)75 2391 y(instantiating)f(the)j(correct)g(objects)g(at)g (the)g(client')m(s)f(address)h(space)g(and)g(interact)g(with)f(the)h (underlying)e(RPC)75 2448 y(service.)146 2504 y(The)e(model)f(recognizes)h (that)g(some)g(applications)e(need)i(to)g(modify)f(their)h(view)g(of)g(the)g (type)f(of)h(the)g(objects)75 2561 y(at)i(run-time)f(and)h(provides)f (mechanisms)g(to)h(safely)f(change)h(at)g(run-time)g(the)f(type)h(of)g (object)f(references)h(to)g(a)75 2617 y(derived)g(type.)p 75 2658 720 2 v 124 2685 a Fi(\003)142 2700 y Fh(Author)q(')n(s)f(present)e (address:)k(INESC,)d(R.)h(Alves)f(Redol)f(9,)i(1000)e(Lisboa,)g(Portugal,)h (pjg@inesc.inesc.pt)964 2899 y Fk(1)p eop %%Page: 2 2 bop 146 116 a Fk(There)14 b(are)h(three)f(important)f(classes)h(in)f(the)h (library)m(.)25 b(Class)14 b Fj(usTop)h Fk(is)f(the)g(root)f(of)i(the)e (hierarchy)m(,)j(all)75 173 y(classes)e(that)g(need)h(the)g(functionality)d (described)i(here)h(must)g(derive)f(from)i(this)d(class.)27 b(Class)15 b Fj(usRemote)75 229 y Fk(derives)c(from)i Fj(usTop)g Fk(and)f(is)g(the)f(base)h(class)g(for)g(all)g(classes)f(that)g(contain)g (methods)h(that)f(may)h(be)h(invoked)75 286 y(remotely)m(.)j(Finally)m(,)11 b(class)g Fj(usItem)i Fk(is)d(the)h(base)g(class)g(of)g(the)g(multi-server)g (speci\256c)g(class)g(hierarchy)g(and)g(is)75 342 y(used)f(as)h(base)g(class) f(for)h(almost)f(all)h(other)f(classes)g(in)h(the)f(library)m(.)16 b(These)11 b(three)f(classes)h(together)f(implement)75 399 y(almost)h(all)f(the)h(functionality)e(described)i(here.)75 523 y Fg(2.1)50 b(Interface)12 b(classes)75 610 y Fk(The)f(declaration)f(of)i (an)f(interface)g(class)g(is)g(represented)f(in)h(Figure)g(1)1206 593 y Ff(1)1225 610 y Fk(.)75 745 y Fe(/*)23 b(us_name_)q(ifc)q(.h)j(*/)75 836 y(class)e(usName:)i(public)f(virtual)g(usItem)g({)209 881 y(public:)254 927 y(DECLARE_)q(MEM)q(BE)q(RS)q(_AB)q(ST)q(RAC)q(T_)q(CL)q (ASS)q(\(u)q(sNa)q(me)q(\);)75 973 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_resolv)q(e\()q(cha)q(r*)q(,)g(ns_mode_t,)g(ns_access)q (_t)q(,)972 1018 y(usItem**)f(,)e(ns_type_)q(t*,)j(char*,)972 1064 y(int*,)e(ns_action)q(_t)q(*\))i(=0;)75 1110 y(};)75 1201 y(EXPORT_ME)q(TH)q(OD\()q(ns)q(_re)q(so)q(lv)q(e\);)531 1349 y Fk(Figure)11 b(1:)16 b(Declaration)10 b(of)h(interface)h(class)e Fj(usName)146 1455 y Fk(This)22 b(\256gure)h(represents)g(the)f(declaration)h (of)g(class)f Fj(usName)j Fk(as)f(a)f(C++)g(abstract)g(class.)52 b(Class)75 1512 y Fj(usRemote)35 b Fk(is)e(the)f(base)h(class)f(for)h(all)g (classes)f(that)g(may)i(be)e(invoked)g(remotely)m(.)81 b(Macro)75 1568 y Fj(DECLARE)p 267 1568 14 2 v 18 w(MEMBERS)p 474 1568 V 19 w(ABSTRACT)p 709 1568 V 18 w(CLASS)15 b Fk(declares)f(a)g(number)g(of)g (methods)f(and)h(class)f(members)i(that)75 1625 y(must)9 b(be)h(present)f(in) g(every)h(class.)16 b(The)9 b(rest)g(is)h(simply)e(the)i(declaration)e(of)i (the)f(methods)g(exported)g(by)g(service)75 1681 y Fj(usName)k Fk(as)e(pure)g(virtual)f(functions.)146 1737 y(Methods)j(that)h(may)h(be)f (invoked)f(remotely)i(are)g(de\256ned)f(by)g(macro)h Fj(EXPORT)p 1461 1737 V 18 w(METHOD)p Fk(.)i(This)c(macro)75 1794 y(de\256nes)i(a)g (variable)g(to)f(be)h(used)g(by)f(the)h(RPC)h(package.)28 b(Macro)15 b Fj(REMOTE)i Fk(hints)d(a)h(possible)e(notation)g(for)75 1850 y(specifying)h(the)i(exported)e(methods)h(\(currently)g(this)g(macro)h(does)g (nothing\).)28 b(Macro)16 b Fj(EXPORT)p 1696 1850 V 18 w(METHOD)75 1907 y Fk(needs)11 b(to)g(appear)g(only)f(once)h(in)g(any)g(class)g (hierarchy)m(,)g(although)f(multiple)g(uses)g(are)i(not)f(an)g(error)m(.)146 1963 y(The)k(recomended)h(style)f(is)g(to)g(use)h(macro)g Fj(EXPORT)p 1040 1963 V 18 w(METHOD)i Fk(once)d(in)g(the)h(interface)g(class)f(and)g(the) 75 2020 y(keyword)10 b Fj(REMOTE)i Fk(in)e(every)h(implementation)e(class)i (that)f(exports)f(the)h(method)h(remotely)m(.)16 b(This)9 b(provides)h(a)75 2076 y(clear)i(and)f(easy)g(description)e(of)i(what)g(methods)g(are)g (exported)g(by)g(a)g(class.)146 2133 y(The)g(implementation)e(of)j(class)e Fj(usName)j Fk(is)e(represented)g(in)g(\256gure)g(2.)146 2189 y(This)e(\256le)h(contains)f(type)g(information)g(about)g(the)h(parameters)g (and)g(is)g(necessary)g(to)f(construct)g(messages.)75 2246 y(Macro)18 b Fj(DEFINE)p 376 2246 V 18 w(ABSTRACT)p 610 2246 V 19 w(CLASS)g Fk(de\256nes)f(the)g(implementation)f(of)h(some)g(methods)g (that)f(must)h(be)75 2302 y(present)12 b(in)h(all)f(abstract)h(classes.)21 b(Macro)14 b Fj(DEFINE)p 937 2302 V 18 w(METHOD)p 1117 2302 V 18 w(ARGS)g Fk(de\256nes)f(the)g(type)f(of)h(the)g(parameters)75 2358 y(of)g(a)g(method)f(and)h(must)f(be)h(used)f(for)h(all)g(methods)f(that) g(may)h(be)g(invoked)e(remotely)m(.)21 b(A)13 b(call)f(to)h(this)e(macro)75 2415 y(parallels)f(the)h(de\256nition)f(of)h(a)h(function)e(interface)h(with) f(MiG.)146 2471 y(A)j(service)g(provided)f(by)h(a)g(server)h(is)e(requested)h (by)g(invoking)e(a)j(method)e(of)i(an)f(interface)g(class.)23 b(From)75 2528 y(the)10 b(perspective)g(of)h(a)g(programmer)g(who)f(wants)g (to)g(use)g(class)g Fj(usName)j Fk(as)d(a)h(client,)f(\256le)h Fj(us)p 1599 2528 V 17 w(name)p 1724 2528 V 18 w(ifc.h)75 2584 y Fk(contains)g(all)g(the)h(information)f(needed.)19 b(File)12 b Fj(us)p 890 2584 V 17 w(name.cc)i Fk(contains)d(the)g(information)g (necessary)h(for)g(the)75 2641 y(run-time)f(to)g(send)f(and)h(receive)h (messages)f(for)g(this)f(class.)p 75 2681 720 2 v 128 2709 a Fd(1)142 2725 y Fh(The)d(classes)f(shown)g(here)h(are)g(only)g(examples.)12 b(They)6 b(may)h(resemble)g(actual)g(classes)e(used)h(in)i(libus++)g(but)f (they)g(are)h(not)f(exactly)75 2771 y(equal.)964 2899 y Fk(2)p eop %%Page: 3 3 bop 75 150 a Fe(/*)23 b(us_name.)q(cc)j(*/)75 241 y(#include)g()75 332 y(#define)f(BASE)f(usItem)75 378 y(DEFINE_AB)q(ST)q(RAC)q (T_)q(CLA)q(SS)q(\(u)q(sNa)q(me)q(\);)75 469 y(DEFINE_ME)q(TH)q(OD_)q(AR)q (GS\()q(ns)q(_r)q(eso)q(lv)q(e,")q(rp)q(c:)i(IN)d(string;)j(IN)d(int;)h(IN)f (int;)h(OUT)g(*)f(object)q(;)i(OUT)f(*)f(int;)h(OUT)g(*)e (char[102)q(4])q(;)j(OUT)f(*)f(int;)h(OUT)g(*)e(int;"\);)493 617 y Fk(Figure)11 b(2:)16 b(Implementation)10 b(of)h(interface)h(class)e Fj(usName)75 752 y Fg(2.2)50 b(Implementation)12 b(classes)75 839 y Fk(Implementation)h(classes)g(derive)h(from)h(the)e(interface)h (classes.)25 b(There)14 b(are)h(two)e(kinds)g(of)h(implementation)75 895 y(classes,)d(client-side)f(implementations,)f(or)j(proxy)e(classes,)h (and)g(server)o(-side)g(implementations.)75 1018 y Fc(2.2.1)45 b(Pr)o(oxy)11 b(classes)75 1105 y Fk(The)g(declaration)f(of)i(a)f(proxy)g (for)g(class)g Fj(usName)i Fk(is)d(represented)h(in)g(\256gure)g(3.)75 1239 y Fe(/*)23 b(us_name_)q(pro)q(xy)q(_if)q(c.)q(h)j(*/)75 1331 y(#include)g()75 1376 y(#include)g()75 1468 y(class)e(usName_p)q(ro)q(xy:)i (public)f(usName,)h(public)e(usItem_p)q(ro)q(xy)i({)209 1513 y(public:)254 1559 y(DECLARE_)q(PRO)q(XY)q(_M)q(EMB)q(ER)q(S\(u)q(sN)q(am)q (e_p)q(ro)q(xy\))q(;)254 1605 y(usName_p)q(rox)q(y\()q(\))g({};)254 1650 y(/*)277 1696 y(*)d(Methods)i(exported)h(remotely)277 1742 y(*/)75 1787 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_resolv)q (e\()q(cha)q(r*)q(,)g(ns_mode_t,)g(ns_access)q(_t)q(,)972 1833 y(usItem**)f(,)e(ns_type_)q(t*,)j(char*,)972 1879 y(int*,)e(ns_action)q(_t)q (*\))q(;)75 1924 y(};)481 2118 y Fk(Figure)11 b(3:)16 b(Declaration)10 b(of)h(proxy)g(class)g Fj(usName)p 1318 2118 14 2 v 18 w(proxy)146 2224 y Fk(Implementation)g(class)h Fj(usName)p 712 2224 V 18 w(proxy)i Fk(inherits)d(the)i(interface)f(of)h(class)f Fj(usName)p Fk(.)22 b(It)13 b(also)f(inherits)75 2280 y(the)17 b(implementation)f(of)h Fj(usItem)p 671 2280 V 18 w(proxy)p Fk(,)j(which)d(is)g(the)g(proxy)f (implementation)g(of)h Fj(usName)p Fk(')m(s)i(base)75 2337 y(class,)11 b Fj(usItem)p Fk(.)146 2393 y(This)21 b(\256le)i(redeclares)g (all)g(the)f(methods)g(of)h Fj(usName)p Fk(,)28 b(as)23 b(is)f(required)g(in) h(C++)f(when)h(a)g(derived)75 2450 y(class)c(reimplements)h(a)g(method)g (from)g(the)g(parent)f(class.)42 b(Macro)21 b Fj(DECLARE)p 1438 2450 V 18 w(PROXY)p 1591 2450 V 18 w(MEMBERS)h Fk(de-)75 2506 y(clares)e(the)f(members)h(that)f(must)g(exist)g(in)g(all)g(proxy)g (classes.)41 b(This)19 b(macro)h(is)f(a)h(dif)o(ferent)g(\257avour)f(of)75 2563 y Fj(DECLARE)p 267 2563 V 18 w(MEMBERS)p 474 2563 V 19 w(ABSTRACT)p 709 2563 V 18 w(CLASS)p Fk(.)146 2619 y(The)34 b(implementation)f(of)h(class)g Fj(usName)p 931 2619 V 18 w(proxy)i Fk(is)e(represented)g(in)g(\256gure)g(4.)86 b(Macro)75 2676 y Fj(DEFINE)p 240 2676 V 18 w(PROXY)p 393 2676 V 18 w(CLASS)22 b Fk(de\256nes)f(the)g(implementation)f(of)h(several)g(methods)f(nedded)h(by) f(all)h(proxy)75 2732 y(classes.)40 b(Method)19 b Fj(init)p 525 2732 V 17 w(class)i Fk(initializes)c(the)i(methods)f(that)g(can)i(be)f (invoked)f(remotely)m(.)40 b(First)19 b(it)964 2899 y(3)p eop %%Page: 4 4 bop 75 116 a Fk(calls)14 b(the)g(corresponding)e(method)i(on)g(the)g(base)h (class)e(and)i(than)e(it)h(initializes)e(all)i(the)g(remote)h(methods)f(in)75 173 y Fj(usName)p 240 173 14 2 v 18 w(Proxy)f Fk(with)d(macro)i Fj(SETUP)p 758 173 V 18 w(METHOD)p 938 173 V 18 w(WITH)p 1064 173 V 17 w(ARGS)p Fk(.)146 229 y(Methods)f(acting)h(as)h(stubs)e(\(e.g.)21 b Fj(ns)p 756 229 V 17 w(resolve\(\))p Fk(\))15 b(simply)d(call)g(function)f Fj(outgoing)p 1641 229 V 19 w(invoke\(\))75 286 y Fk(to)j(perform)g(the)g (RPC.)h(The)f(\256rst)g(parameter)h(to)e(this)g(function)g(is)g(the)h (identi\256er)f(of)h(the)g(function,)f(obtained)75 342 y(with)d(macro)i Fj(mach)p 403 342 V 18 w(method)p 583 342 V 18 w(id)p Fk(,)g(the)f(others)f (are)i(the)f(parameters)h(of)f(the)g(function.)75 477 y Fe(/*)23 b(us_name_)q(pro)q(xy)q(.cc)j(*/)75 568 y(#include)g()75 659 y(DEFINE_PR)q(OX)q(Y_C)q(LA)q(SS\()q(us)q(Na)q(me_)q (pr)q(oxy)q(\);)75 705 y(DEFINE_CA)q(ST)q(DOW)q(N2)q(\(us)q(Na)q(me)q(_pr)q (ox)q(y,)g(usItem_pr)q(oxy)q(,)g(usName\))75 796 y(void)e(usName_pr)q(ox)q (y::)q(in)q(it)q(_cl)q(as)q(s\(u)q(sC)q(la)q(ss*)i(class_ob)q(j\))75 842 y({)254 888 y(usName::)q(ini)q(t_)q(cl)q(ass)q(\(c)q(las)q(s_)q(ob)q (j\);)254 933 y(usItem_p)q(rox)q(y:)q(:i)q(nit)q(_c)q(las)q(s\()q(cl)q(ass)q (_o)q(bj\))q(;)254 1025 y(BEGIN_SE)q(TUP)q(_M)q(ET)q(HOD)q(_W)q(ITH)q(_A)q (RG)q(S\(u)q(sN)q(ame)q(_p)q(ro)q(xy\))q(;)254 1070 y(SETUP_ME)q(THO)q(D_)q (WI)q(TH_)q(AR)q(GS\()q(us)q(Na)q(me_)q(pr)q(oxy)q(,n)q(s_)q(res)q(ol)q(ve\)) q(;)254 1116 y(END_SETU)q(P_M)q(ET)q(HO)q(D_W)q(IT)q(H_A)q(RG)q(S;)75 1162 y(})75 1253 y(mach_erro)q(r_)q(t)75 1299 y(usName_pr)q(ox)q(y::)q(ns)q (_re)q(so)q(lv)q(e\(c)q(ha)q(r)f(*path,)g(ns_mode_)q(t)h(mode,)e(ns_access)q (_t)i(access,)635 1344 y(usItem**)g(newobj,ns)q(_t)q(yp)q(e_t)g(*newtype)q (,ch)q(ar)g(*newpath,)635 1390 y(int)e(*usedlen,)i(ns_actio)q(n_t)g (*action\))75 1436 y({)254 1481 y(return)f(outgoing)q(_in)q(vo)q(ke\()q(ma)q (ch)q(_me)q(th)q(od_)q(id)q(\(n)q(s_r)q(es)q(olv)q(e\))q(,p)q(ath)q(,m)q(ode) q(,a)q(cc)q(ess)q(,)770 1527 y(newobj,ne)q(wty)q(pe)q(,n)q(ewp)q(at)q(h,u)q (se)q(dl)q(en,)q(ac)q(tio)q(n\))q(;)75 1573 y(})443 1720 y Fk(Figure)11 b(4:)16 b(Implementation)10 b(of)h(proxy)g(class)g Fj(usName)p 1356 1720 V 18 w(proxy)75 1893 y Fc(2.2.2)45 b(Server)n(-side)13 b(implementation)e(classes)75 1980 y Fk(Server)k(side)f(implementation)f (classes)h(are)i(constructed)d(much)i(in)f(the)g(same)h(way)g(as)f(the)h (implementation)75 2036 y(classes)9 b(at)g(the)h(client)e(side.)16 b(Appendix)8 b(B.3)i(represents)f(one)g(such)g(class)g Fj(dir)p Fk(,)i(a)f(server)g(side)f(implementation)75 2093 y(of)16 b Fj(usName)h Fk(that)e(also)g(inherits)f(implementation)g(from)i(class)f Fj(vol)p 1226 2093 V 17 w(agency)i Fk(internal)e(to)g(servers.)29 b(This)75 2149 y(class)12 b(uses)h(basically)f(the)g(same)i(constructs)d (already)i(seen)g(in)f(class)h Fj(usName)p 1371 2149 V 18 w(proxy)p Fk(,)i(although)c(dif)o(ferent)75 2206 y(variants)f(of)h(some)h(macros)f(are) h(used.)75 2352 y Fl(3)60 b(Declaration)12 b(Files)75 2455 y Fk(A)h(declaration)e(\256le)i(contains)e(the)h(C++)h(declaration)e(of)i (the)f(class)g(and)h(normally)e(has)i(the)f(extension)f Fj(.h)p Fk(.)21 b(In)75 2511 y(libus++)6 b(these)j(\256les)f(are)i(standard)d(C++)i (\256les.)15 b(Class)9 b Fj(usTop)h Fk(\(\256le)f Fj(include/top)p 1465 2511 V 19 w(ifc.h)p Fk(\))h(de\256nes)f(some)75 2568 y(macros)k(that)g (facilitate)f(the)h(declaration)f(of)h(classes.)21 b(These)13 b(macros)h(declare)f(a)g(number)g(of)g(member)i(\256elds)75 2624 y(and)c(functions)f(that)g(must)h(exist)f(in)h(all)g(classes)f(and)h (declare)h(the)f(variables)f(needed)h(by)g(the)g(RPC)h(subsystem.)146 2681 y(Macro)f Fj(DECLARE)p 467 2681 V 18 w(MEMBERS)i Fk(declares)d(a)h (number)f(of)h(members)g(that)f(must)g(exist)f(in)h(all)g(classes,)h(in)e (the)75 2737 y(form:)964 2899 y(4)p eop %%Page: 5 5 bop 293 116 a Fj(DECLARE_MEMBE)q(RS\()q(clas)q(s_na)q(me\))q(;)146 222 y Fk(There)11 b(are)h(several)f(variants)f(of)h(this)f(macro:)75 316 y Fc(DECLARE)p 300 316 14 2 v 17 w(MEMBERS)23 b Fk(declares)7 b(the)g(members)g(of)g(a)g(\252normal\272)g(class)g(whose)g(methods)g(may)g (be)g(invoked)224 373 y(remotely)k(or)h(whose)e(references)i(may)g(be)f (passed)g(as)g(parameters)h(in)e(remote)i(invocations.)75 467 y Fc(DECLARE)p 300 467 V 17 w(MEMBERS)p 551 467 V 17 w(ABSTRACT)p 815 467 V 17 w(CLASS)23 b Fk(same)10 b(as)g Fj(DECLARE)p 1341 467 V 18 w(MEMBERS)i Fk(for)e(abstract)g(class-)224 523 y(es.)75 617 y Fc(DECLARE)p 300 617 V 17 w(LOCAL)p 478 617 V 17 w(MEMBERS)23 b Fk(same)9 b(as)f Fj(DECLARE)p 1089 617 V 18 w(MEMBERS)j Fk(for)d(local)g (classes)f(whose)h(methods)224 673 y(are)k(not)f(accessible)f(remotely)m(.)75 767 y Fc(DECLARE)p 300 767 V 17 w(PROXY)p 479 767 V 16 w(MEMBERS)23 b Fk(same)12 b(as)f(DECLARE)p 1116 767 V 16 w(MEMBERS)i(for)e(proxy)f (classes.)146 861 y(Macro)16 b Fj(EXPORT)p 445 861 V 18 w(METHOD)h Fk(de\256nes)f(an)g(external)f(variable)g(that)g(contains)g(the)g(method)g (identi\256er)g(for)75 917 y(that)c(method,)g(and)g(has)g(the)f(form:)293 1024 y Fj(EXPORT_METHOD)q(\(me)q(thod)q(_nam)q(e\);)75 1170 y Fl(4)60 b(Implementation)13 b(Files)75 1275 y Fg(4.1)50 b(Generic)12 b(de\256nitions)75 1362 y Fk(Implementation)c(\256les)h(for)f(interface)h (classes)g(contain)e(the)i(description)e(of)h(the)h(parameters)g(and)g(are)g (necessary)75 1418 y(to)i(construct)f(the)h(messages)g(between)f(clients)h (and)g(servers.)146 1475 y(Macro)32 b Fj(DEFINE)p 461 1475 V 18 w(CLASS)h Fk(provides)e(the)g(implementation)f(for)i(the)g(members)g (declared)g(with)75 1531 y Fj(DECLARE)p 267 1531 V 18 w(MEMBERS)14 b Fk(in)c(the)h(header)h(\256le)f(and)g(has)g(the)g(form:)293 1637 y Fj(#define)29 b(BASE)g(base_class_nam)q(e)293 1694 y(DEFINE_CLASS\()q (cla)q(ss_n)q(ame\))q(;)146 1800 y Fk(There)11 b(are)h(several)f(variants)f (of)h(this)f(macro:)75 1894 y Fc(DEFINE)p 250 1894 V 16 w(CLASS)23 b Fk(de\256nes)16 b(the)f(members)h(of)g(a)g(\252normal\272)f(class)g(whose)g (methods)g(may)h(be)f(invoked)g(re-)224 1950 y(motely)d(or)h(whose)e (references)i(may)g(be)g(passed)e(as)i(parameters)g(in)e(remote)i (invocations.)18 b(Assumes)224 2007 y(that)11 b Fj(BASE)h Fk(was)f(de\256ned) h(with)e(the)h(name)h(of)f(the)g(base)g(class.)75 2101 y Fc(DEFINE)p 250 2101 V 16 w(CLASS)p 412 2101 V 17 w(MI)22 b Fk(same)13 b(as)g Fj(DEFINE)p 831 2101 V 18 w(CLASS)h Fk(for)f(classes)f(that)g(inherit) f(from)j(multiple)d(base)i(class-)224 2157 y(es.)22 b(Method)12 b('castdown')g(must)h(be)g(implemented)f(\252by)h(hand\272)f(with)g(DEFINE)p 1531 2157 V 16 w(CASTDOWN2)g(or)224 2213 y(DEFINE)p 389 2213 V 16 w(CASTDOWN3.)75 2307 y Fc(DEFINE)p 250 2307 V 16 w(ABSTRACT)p 513 2307 V 17 w(CLASS)23 b Fk(equivalent)7 b(to)h(DEFINE)p 1103 2307 V 16 w(CLASS)i(for)e(abstract)g(classes.)15 b(These)9 b(classes)224 2364 y(normally)14 b(de\256ne)h(an)g(interface.)27 b(This)14 b(macro)h(de\256nes)g(all)f(the)g(methods)g(of)h(these)f(classes.) 27 b(Their)224 2420 y(implementation)10 b(contains)f(only)h(the)h (de\256nition)e(of)i(the)g(parameters)g(of)g(the)g(methods)f(\(de\256ned)h (with)224 2477 y(macro)h(DEFINE)p 514 2477 V 16 w(METHOD)p 725 2477 V 16 w(ARGS\).)75 2570 y Fc(DEFINE)p 250 2570 V 16 w(ABSTRACT)p 513 2570 V 17 w(CLASS)p 676 2570 V 17 w(MI)22 b Fk(same)16 b(as)f(DEFINE)p 1100 2570 V 16 w(ABSTRACT)p 1353 2570 V 17 w(CLASS)h(for)f(abstract)g(classes)224 2627 y(with)9 b(multiple)g(base)g(classes.)16 b(Methods)9 b('init)p 970 2627 V 15 w(class')g(and)h('castdown')e(must)i(by)f(de\256ned)h(\252by)f (hand\272.)224 2683 y(Use)i(DEFINE)p 471 2683 V 16 w(CASTDOWN2)g(or)g(DEFINE) p 990 2683 V 16 w(CASTDOWN3.)964 2899 y(5)p eop %%Page: 6 6 bop 75 116 a Fc(DEFINE)p 250 116 14 2 v 16 w(LOCAL)p 427 116 V 17 w(CLASS)23 b Fk(de\256nes)d(the)f(methods)g(for)g(a)h(class)f(whose)g (methods)g(are)h(not)f(accessible)224 173 y(remotely)m(.)e(These)10 b(classes)h(derive)f(from)h('usT)m(op')f(and)h(have)g(garbage)g(collection,)e (synchronization,)224 229 y(etc.)75 323 y Fc(DEFINE)p 250 323 V 16 w(LOCAL)p 427 323 V 17 w(CLASS)p 590 323 V 17 w(MI)22 b Fk(same)11 b(as)e(DEFINE)p 1003 323 V 16 w(LOCAL)p 1171 323 V 16 w(CLASS)h(for)g(local)g(classes)f(with)f(multiple)224 379 y(base)j(classes.)k(Method)10 b('castdown')g(must)g(be)g(de\256ned)g (\252by)g(hand\272)g(with)g(DEFINE)p 1582 379 V 16 w(CASTDOWN2)224 436 y(or)i(DEFINE)p 439 436 V 16 w(CASTDOWN3.)75 530 y Fc(DEFINE)p 250 530 V 16 w(PROXY)p 428 530 V 16 w(CLASS)23 b Fk(de\256nes)11 b(the)g(methods)g(for)g(a)h(proxy)e(class.)75 654 y Fg(4.2)50 b(RPC)13 b(Interface)75 741 y Fk(All)d(classes)g(that)f(invoke)h(or)g(are)h (invoked)e(remotely)i(must)f(initialize)e(the)j(RPC)g(dispatcher)m(.)16 b(This)10 b(is)f(achieved)75 797 y(with)h(method)h Fj(init)p 426 797 V 17 w(class)i Fk(as)e(follows:)293 904 y Fj(void)29 b(class_name::ini)q(t_cl)q(ass)q(\(usC)q(lass)q(*)h(class_obj\))293 960 y({)511 1017 y(base_class1:)q(:ini)q(t_c)q(lass)q(\(cla)q(ss_)q(obj\))q (;)511 1073 y(base_class2:)q(:ini)q(t_c)q(lass)q(\(cla)q(ss_)q(obj\))q(;)511 1130 y(...)511 1186 y(base_classN:)q(:ini)q(t_c)q(lass)q(\(cla)q(ss_)q(obj\)) q(;)511 1299 y(BEGIN_SETUP_)q(METH)q(OD_)q(WITH)q(_ARG)q(S\(c)q(lass)q(_nam)q (e\);)511 1355 y(SETUP_METHOD)q(_WIT)q(H_A)q(RGS\()q(clas)q(s_n)q(ame,)q (meth)q(od1)q(_nam)q(e\);)511 1412 y(SETUP_METHOD)q(_WIT)q(H_A)q(RGS\()q (clas)q(s_n)q(ame,)q(meth)q(od2)q(_nam)q(e\);)511 1468 y(...)511 1525 y(SETUP_METHOD)q(_WIT)q(H_A)q(RGS\()q(clas)q(s_n)q(ame,)q(meth)q(odN)q (_nam)q(e\);)511 1581 y(END_SETUP_ME)q(THOD)q(_WI)q(TH_A)q(RGS;)75 1638 y(})146 1744 y Fk(First)c(all)i(base)f(classes)g(have)g(to)g(be)g (initialized)f(by)h(calling)f(the)h(same)h(method,)k(than)26 b(macro)75 1800 y Fj(SETUP)p 213 1800 V 18 w(METHOD)p 393 1800 V 18 w(WITH)p 519 1800 V 17 w(ARGS)12 b Fk(is)e(called)h(for)g(all)f(methods) g(of)h(the)f(class)g(that)g(may)h(be)g(accessed)g(remotely)m(.)75 1857 y(The)g(calls)g(to)f(this)g(macro)i(are)g(enclosed)e(by)h(calls)g(to)f (macros)i Fj(BEGIN)p 1216 1857 V 18 w(SETUP)p 1369 1857 V 18 w(METHOD)p 1549 1857 V 18 w(WITH)p 1675 1857 V 17 w(ARGS)g Fk(and)75 1913 y Fj(END)p 159 1913 V 17 w(SETUP)p 311 1913 V 18 w(METHOD)p 491 1913 V 18 w(WITH)p 617 1913 V 17 w(ARGS)p Fk(.)146 1970 y(Abstract)c(classes)h(must)g(have)g(an)g(implementation)f (\256le)i(where)f(the)g(types)g(of)g(the)g(parameters)h(are)g(de\256ned.)75 2026 y(This)g(is)h(achieved)g(with)f(macro)i Fj(DEFINE)p 764 2026 V 18 w(METHOD)p 944 2026 V 18 w(ARGS)p Fk(,)h(which)d(has)h(the)g(form:) 293 2132 y Fj(DEFINE_METHOD)q(_AR)q(GS\(m)q(etho)q(d_n)q(ame,)31 b("parameter)f(types"\);)146 2239 y Fk(All)17 b(the)g(information)g(needed)h (for)g(packing)f(and)h(unpacking)e(of)i(the)g(ar)o(guments)f(for)i(one)e (method)h(is)75 2295 y(speci\256ed)11 b(using)f(a)h(simple)g(ASCII)h(string.) 146 2352 y(This)f(string)g(contains)g(a)i(method)f(speci\256cation)g(for)h (global)e(properties)g(of)i(the)f(method)g(itself,)g(followed)75 2408 y(by)f(a)h(list)f(of)h(ar)o(gument)g(speci\256cations,)e(one)i(for)g (each)g(ar)o(gument)g(in)f(the)h(order)g(in)f(which)g(they)g(appear)h(in)f (the)75 2465 y(method)h(declaration.)22 b(Either)12 b(of)h(these)f(elements)h (may)g(be)g(missing:)18 b(if)13 b(there)g(is)g(no)f(method)h (speci\256cation,)75 2521 y(the)f(method)g(defaults)f(to)h(a)g(simple)g (message)g(with)f(no)h(response;)g(if)g(there)g(are)h(no)f(ar)o(gument)g (speci\256cations,)75 2577 y(the)i(method)f(will)g(be)g(invoked)g(with)g(no)g (ar)o(guments.)24 b(There)14 b(is)f(no)h(ar)o(gument)g(speci\256cation)e(for) i(the)g(object)75 2634 y(that)d(is)f(the)h(tar)o(get)g(of)g(the)g(method)g (invocation,)f(since)g(that)h(ar)o(gument)g(is)g(always)f(present.)146 2690 y(Each)f(speci\256cation)f(consists)f(of)i(a)g(series)g(of)g(keywords)f (or)h(symbols)f(separated)g(by)h(spaces.)16 b(Extra)8 b(spaces)75 2747 y(are)k(ignored,)e(unless)g(they)h(appear)g(inside)f(a)h(keyword.)16 b(Only)10 b(the)h(\256rst)g(letter)g(of)g(each)h(symbol)e(is)g (signi\256cant,)964 2899 y(6)p eop %%Page: 7 7 bop 75 116 a Fk(and)13 b(the)g(rest)g(of)g(the)g(word)g(can)g(be)g(omitted.) 22 b(The)13 b(case)h(is)e(signi\256cant)g(for)h(the)g(\256rst)g(letter)g(of)g (each)h(symbol.)75 173 y(The)d(parser)g(for)h(method)e(ar)o(gument)i(strings) d(is)i(very)g(primitive.)k(Many)d(syntax)e(errors)h(are)h(not)e(detected,)h (and)75 229 y(lead)h(to)f(unpredicatable)f(results)h(when)g(the)g(method)g (is)h(used)f(at)g(run-time.)18 b(In)12 b(addition,)e(many)i(combination)75 286 y(of)f(keywords)f(are)i(meaningless,)f(and)g(will)f(also)g(not)h(be)g (detected)g(by)g(the)g(parser)m(.)146 342 y(The)k(method)h(speci\256cation)f (consists)f(of)i(one)g(or)g(more)h(of)f(the)g(following)e(keywords,)i (followed)f(by)h(a)75 399 y(colon)10 b(\()p Fj(':')p Fk(\):)75 492 y Fc(knownID)23 b Fk(indicates)10 b(that)g(the)h Fb(method)f(id)h Fk(is)g(well-known,)f(and)h(should)f(be)h(used)g(to)f(designate)h(this)f (method)224 549 y(everywhere.)38 b(Otherwise,)20 b(the)e(method)f(name)i(is)f (used)g(to)g(designate)f(it)g(across)h(address)g(space)224 605 y(boundaries.)75 699 y Fc(rpc)23 b Fk(indicates)14 b(that)g(the)g(method) h(should)e(be)i(treated)f(as)h(an)g(RPC,)h(returning)d(a)j(32-bit)d(error)i (code)g(of)g(type)224 756 y Fj(mach_error_t)22 b Fk(in)17 b(addition)f(to)h (any)g(OUT)g(ar)o(guments)h(that)f(it)g(may)h(have.)36 b(Otherwise,)18 b(the)224 812 y(method)11 b(is)g(forwarded)g(as)g(a)h(single)e(message)h (with)f(no)h(reply)g(and)g(no)g(success)f(indication.)146 906 y(Each)d(ar)o(gument)g(speci\256cation)g(contains)g(all)g(th)o(e)g (information)g(n)o(eeded)g(to)g(encode)g(the)g(data)g(correspo)o(ndin)o(g)75 962 y(to)17 b(one)h(ar)o(gument)f(into)g(a)h(message.)36 b(Unless)16 b(otherwise)h(speci\256ed,)i(the)e(system)g(decides)h(automatically)75 1019 y(whether)13 b(or)h(not)e(to)h(use)h(the)f(Mach)h(IPC)g(out-of-line)e (transmission)g(mode)i(when)f(applicable,)g(based)g(on)g(the)75 1075 y(amount)f(of)h(data)g(to)f(transfer)m(.)22 b(The)12 b(speci\256cation)g (consists)f(of)h(the)h(following)e(elements,)i(and)f(is)h(terminated)75 1132 y(by)e(a)g(semi-colon)g(\()p Fj(';')p Fk(\):)179 1225 y Fa(\017)22 b Fk(the)13 b Fc(dir)o(ection)g Fk(indicates)e(whether)h(the)g (ar)o(gument)h(is)f(meaningful)g(on)g(entry)g(to)g(the)g(method)g(imple-)224 1282 y(mentation,)i(on)f(exit,)g(or)g(both.)22 b(It)13 b(is)g(a)h (combination)e(of)h(the)g(keywords)f Fj(IN)i Fk(and)f Fj(OUT)p Fk(.)i(Ar)o(guments)224 1338 y(with)9 b(the)g Fj(IN)h Fk(attributes)d(are)j (passed)f(in)f(the)h(request)g(message;)h(ar)o(guments)f(with)f(the)h Fj(OUT)h Fk(are)g(passed)224 1395 y(in)h(the)g(response)f(message.)17 b(If)12 b(no)f(direction)f(is)g(speci\256ed,)i Fj(IN)g Fk(is)e(assumed.)179 1489 y Fa(\017)22 b Fk(the)c Fc(indir)o(ection)g(count)g Fk(indicates)e(if)i (the)f(section)g(of)g(the)h(caller)r(')m(s)f(stack)h(corresponding)d(to)i (the)224 1545 y(ar)o(gument)11 b(contains)e(the)h(data)h(to)f(be)g (transmitted)f(itself,)i(or)f(a)h(pointer)e(to)h(that)g(data,)h(or)g(a)f (pointer)g(to)g(a)224 1601 y(pointer)h(to)f(that)h(data.)16 b(It)11 b(is)g(represented)g(as)g(zero,)h(one)f(or)g(two)g Fj('*')h Fk(symbols.)224 1677 y(All)d(three)g(possibilities)d(are)k(valid)e (for)i(the)f Fj(IN)h Fk(direction,)f(but)f(for)i(the)f Fj(OUT)h Fk(direction,)f(only)f Fj('*')i Fk(and)224 1733 y Fj('**')k Fk(are)g(meaningful.)20 b(In)13 b(the)f(\256rst)g(case,)i(the)f(caller)f (must)h(pass)f(in)g(a)h(pointer)f(to)g(a)h(pre-allocated)224 1790 y(memory)h(area)g(in)e(which)g(the)h(desired)f(data)h(will)f(be)h (copied)f(before)h(the)f(method)h(invocation)e(exits.)224 1846 y(In)i(the)g(second)f(case,)i(the)f(caller)f(must)h(pass)f(in)g(a)i(pointer)d (to)i(an)g(empty)f(pointer)g(variable,)h(and)g(that)224 1902 y(variable)d(will)e(be)i(initialized)e(to)h(point)f(to)h(a)i(newly-allocated) d(memory)i(area)h(containing)c(the)j(desired)224 1959 y(data.)19 b(The)12 b(user)g(must)f(explicitly)f(destroy)h(that)g(memory)i(area)f(with)f Fj(vm_deallocat)q(e\(\))16 b Fk(when)224 2015 y(it)11 b(is)g(no)g(longer)f (needed.)224 2090 y(It)i(is)e(meaningless)g(to)h(specify)g(the)g Fj(OUT)h Fk(keyword)e(without)f(an)j(indirection)d(count)h(of)i(at)f(least)g (one.)224 2166 y(For)19 b(Mach)f(IPC,)h(the)f(data)g(is)f(always)h(sent)f (out-of-line)g(when)g(double)g(indirection)f(is)h(speci\256ed)224 2222 y(\()p Fj('**')p Fk(\).)179 2316 y Fa(\017)22 b Fk(the)10 b Fc(copy)g(\257ag)g Fk(is)g(meaningful)f(only)g(for)h(the)g Fj(IN)h Fk(direction,)e(with)g(an)h(indirection)e(count)h(greater)i(than)224 2372 y(zero.)24 b(It)13 b(indicates)f(that)h(the)g(pointer)f(to)h(the)g (data,)h(passed)e(to)h(the)g(server)o(-side)g(object)g(as)g(a)h(method)224 2429 y(ar)o(gument,)e(should)e(point)g(to)h(an)g(area)h(of)f(memory)h(that)f (is)g(not)f(automatically)g(deallocated)h(after)g(the)224 2485 y(current)k(method)f(invocation)f(exits.)26 b(This)14 b(\257ag)h(is)f (speci\256ed)h(by)f(the)g(presence)h(or)g(absence)g(of)f(the)224 2542 y Fj(Copy)f Fk(keyword.)224 2617 y(It)g(is)e(up)h(to)g(the)g(user)g(to)g (destroy)f(the)h(memory)h(with)e Fj(vm_deallocate)q(\(\))16 b Fk(when)c(it)f(is)h(no)g(longer)224 2673 y(needed.)224 2748 y(For)g(Mach)g(IPC,)g(this)e(\257ag)i(forces)f(the)g(data)g(to)g(be)g(sent)g (out-of-line.)964 2899 y(7)p eop %%Page: 8 8 bop 179 116 a Fa(\017)22 b Fk(the)12 b Fc(deallocation)e(\257ag)i Fk(indicates)e(that)h(the)g(data)g(to)g(be)h(transmitted)e(must)h(be)h (deallocated)e(from)i(the)224 173 y(sender)r(')m(s)h(address)f(space.)20 b(This)12 b(\257ag)g(is)g(speci\256ed)h(by)f(the)g(presence)g(or)h(absence)f (of)h(the)f Fj(Dealloc)224 229 y Fk(keyword,)f(and)g(is)g(meaningful)f(both)g (for)i Fj(IN)g Fk(and)f Fj(OUT)h Fk(ar)o(guments.)224 304 y(For)g(Mach)g (IPC,)g(this)e(\257ag)i(forces)f(the)g(data)g(to)g(be)g(sent)g(out-of-line,)f (with)g(the)h Fb(dealloc)f Fk(bit)h(set.)179 398 y Fa(\017)22 b Fk(the)15 b Fc(data)f(type)i Fk(indicates)d(which)h(data-type)g(conversion) f(may)i(have)g(to)f(be)h(performed)g(in)f(transit,)224 455 y(and)g(implies)e(the)h(size)h(of)f(each)h(data)f(element.)24 b(It)13 b(is)g(one)h(of)f(the)g(keywords)g Fj(char)p Fk(,)i Fj(float)p Fk(,)h Fj(int)224 511 y Fk(\(32-bit\),)g Fj(object)p Fk(,)h Fj(word)f Fk(\(16-bit\),)g Fj(unstructured)i Fk(\(32-bit\),)d Fj(byte)p Fk(,)i Fj(string)p Fk(,)h Fj(ps)e Fk(\(send)224 567 y(rights)10 b(for)i(port\),)f(or)g Fj(pr)h Fk(\(receive)g(rights)e(for)h (port\).)224 643 y(For)g(type)e Fj(string)p Fk(,)k(the)d(ar)o(gument)g(is)g (a)g(pointer)f(to)h(a)g(zero-terminated)g(array)h(of)f(characters,)h(unless) 224 699 y(the)g(indirection)f(count)g(is)g(one,)i(in)e(which)h(case)g(the)g (ar)o(gument)g(is)g(a)g(pointer)g(to)f(a)i(pointer)e(to)g(an)i(array)224 756 y(of)g(characters.)17 b(It)11 b(is)f(illegal)g(to)h(use)g(type)g Fj(string)i Fk(with)d(explicit)g(double)g(indirection.)224 831 y(For)16 b(type)e Fj(object)p Fk(,)k(the)d(ar)o(gument)g(is)g(a)g (pointer)f(to)h(an)g(object)f(instance,)i(subject)e(to)g(the)h(normal)224 887 y(meaning)g(of)f(the)h(indirection)d(count.)26 b(Details)13 b(on)i(the)f(transmission)e(of)j(objects)e(are)j(given)d(in)h(the)224 944 y(next)d(section.)179 1037 y Fa(\017)22 b Fk(the)e Fc(data)f(count)i Fk(indicates)d(how)h(many)h(data)f(elements)h(of)f(the)h(speci\256ed)f(type)g (constitute)e(the)224 1094 y(ar)o(gument)12 b(to)e(be)i(transmitted.)j(It)c (consists)e(of)j(a)f(number)n(,)h(enclosed)e(in)h(square)g(brackets)g(\()p Fj([n])p Fk(\).)224 1169 y(If)f(there)g(is)e(no)h(data)h(count)e (speci\256cation,)h(the)g(ar)o(gument)g(is)g(assumed)g(to)g(represent)g(a)h (single)e(instance)224 1225 y(of)k(the)f(speci\256ed)g(data)g(type;)f (otherwise,)g(it)h(is)g(treated)g(as)g(an)g(array)m(.)224 1301 y(If)c(the)g(data)g(count)g(speci\256cation)g(is)g(the)g(special)g(construct) g Fj([*])p Fk(,)g(the)g(current)g(ar)o(gument)g(is)g(interpreted)224 1357 y(as)13 b(a)g(variable-size)g(array)m(,)h(and)e(the)h(actual)f(count)g (of)h(elements)g(is)f(taken)h(from)g(the)g(next)f(ar)o(gument,)224 1413 y(which)7 b(must)g(be)g(a)g(simple)g(integer)g(and)g(have)g(th)o(e)g (same)g(direction)f(attrib)o(utes)h(as)g(t)o(he)g(current)g(ar)o(gument.)224 1470 y(Note)14 b(that)g(this)g(next)f(ar)o(gument)i(must)f(be)h(described)e (normally)h(in)g(the)g(method)g(ar)o(guments)g(string)224 1526 y(\(i.e.)19 b(its)11 b(speci\256cation)g(is)g(not)g(implied)g(by)g(the)g (presence)h(of)g(a)g(variable-size)f(array\).)19 b(It)12 b(is)f(illegal)g(to) 224 1583 y(specify)e(such)g(a)g(variable-size)g(array)h(with)e(an)h (indirection)e(count)i(of)g(zero,)h(since,)g(the)f(next)f(ar)o(gument)224 1639 y(could)j(then)f(not)h(be)g(located)g(on)g(the)g(stack.)224 1714 y(If)g(a)f(variable-size)f(array)h(is)g(used)f(as)h(an)g Fj(OUT)g Fk(ar)o(gument)g(with)f(an)h(indirection)e(count)h(of)h(one,)g(it)f (is)g(the)224 1771 y(responsibility)g(of)j(the)f(user)h(to)g(allocated)f (enough)g(space)h(in)f(the)g(buf)o(fer)i(area)f(to)g(receive)g(the)g(lar)o (gest)224 1827 y(area)h(possible.)i(In)d(this)e(case,)i(a)g(maximum)g(size)f (can)h(be)f(speci\256ed)h(by)f(using)f(a)i(speci\256cation)e(of)h(the)224 1884 y(form)k Fj([*:n])p Fk(,)j(where)c Fj(n)h Fk(indicates)e(the)i(maximum)g (number)f(of)h(elements)f(that)g(can)g(be)h(copied)f(in)224 1940 y(the)f(buf)o(fer)f(area)i(pointed)d(to)h(by)g(the)g(call)g(ar)o (gument.)20 b(This)12 b(maximum)h(size)f(is)g(ignored)g(in)g(all)g(other)224 1997 y(cases.)179 2090 y Fa(\017)22 b Fk(the)14 b Fc(r)o(ecord)h(size)e Fk(applies)g(only)g(for)h(arrays.)24 b(It)14 b(indicates)e(that)h(each)i (element)e(of)h(the)g(array)g(\(\256xed-)224 2147 y(or)f(variable-size\))e (contains)g(a)i(speci\256c)f(number)g(of)g(data)g(items)g(of)g(the)g(type)g (speci\256ed,)g(and)g(acts)g(as)224 2203 y(a)i(simple)f(multiplier)f(for)h (the)g(array)h(size.)23 b(It)14 b(consists)d(of)j(a)f(number)h(enclosed)e(in) h(square)h(brackets)224 2260 y(\()p Fj([n])p Fk(\),)f(just)d(like)h(a)g (\256xed-size)g(array)h(speci\256cation,)f(but)f(coming)h(just)f(after)i (such)e(a)i(speci\256cation.)224 2335 y(If)h(there)e(is)h(no)f(record)h(size) g(speci\256cation,)f(a)h(size)g(of)g(one)f(is)h(assumed.)18 b(It)11 b(is)h(not)f(possible)f(to)h(de\256ne)224 2391 y(variable-size)d (records,)i(or)e(heterogeneous)g(records,)h(whose)f(elements)g(are)h(not)f (all)g(of)h(the)f(same)h(type.)75 2516 y Fg(4.3)50 b(Using)12 b(Objects)g(as)h(Method)e(Arguments)75 2603 y Fk(When)c(an)h(object)f(is)g (used)g(as)h(an)g(ar)o(gument)f(for)h(a)g(method)g(used)f(remotely)m(,)h(the) g(actual)f(information)f(transmitted)75 2659 y(in)11 b(the)g(message)g(is)g (an)g(object)f(port.)146 2716 y(When)i(an)i(object)e(is)h(received)g(in)f(a)i (message,)g(the)f(port)f(that)h(represents)f(is)h(checked)g(against)f(a)i (table)e(of)75 2772 y(all)g(external)h(ports)e(present)i(in)f(the)g(address)g (space.)22 b(If)13 b(there)g(is)f(already)h(an)f(object)g(with)g(that)g (external)g(port,)964 2899 y(8)p eop %%Page: 9 9 bop 75 116 a Fk(a)11 b(new)g(reference)i(is)d(taken)h(for)g(that)g(object,)f (and)h(used)g(as)g(the)g(method)f(ar)o(gument.)17 b(Otherwise,)10 b(a)i(new)f(object)75 173 y(is)j(instantiated,)g(and)h(associated)f(with)g (the)h(speci\256ed)f(port.)27 b(The)15 b(abstract)g(class)f(of)h(the)g(new)f (object)h(to)f(be)75 229 y(instantiated)e(is)i(speci\256ed)g(by)g(the)g (method)g(ar)o(guments)g(string)f(and)h(is)g(the)g(name)h(that)f(appears)g (enclosed)g(in)75 286 y(angle)e(brackets)f(\()p Fj()p Fk(\))k(following)10 b(the)i Fj(object)i Fk(keyword.)19 b(The)12 b(actual)f(class)h(of)g(the)g(object)75 342 y(to)f(be)h(instatiated)e (\(proxy)g(class\))i(is)f(de\256ned)g(by)h(the)f(server)h(and)f(is)g (transmitted)g(in)g(the)g(message.)18 b(It)12 b(must)f(be)75 399 y(a)h(subclass)f(of)g(the)h(abstract)f(class)h(de\256ned)f(in)h(the)f (method)g(ar)o(guments)h(string)e(and)i(its)f(value)g(is)h(de\256ned)f(by)h (a)75 455 y(method)f(called)g Fj(remote)p 508 455 14 2 v 18 w(class)p 661 455 V 17 w(name)i Fk(as)e(follows:)293 558 y Fj(char*)29 b(class_name::re)q(mote)q(_cl)q(ass_)q(name)q(\(\))i(const)293 614 y({)539 671 y(return)e("proxy_class_na)q(me";)293 727 y(})75 873 y Fl(5)60 b(Cast-down)75 976 y Fk(In)11 b(some)h(situations)c(a)k (pointer)e(to)h(a)h(base)f(class)f(has)h(to)g(be)h(converted)e(to)h(a)h (derived)e(class)h(\(cast-down\).)16 b(This)75 1032 y(is)d(illegal)f(in)g (C++)h(with)f(virtual)g(base)h(classes,)g(therefore)h(libus++)d(provides)h(a) h(mechanism)g(for)h(converting)75 1089 y(pointers)8 b(to)h(objects)f(at)i (run-time)f(that)g(is)g(type-safe.)15 b(All)9 b(classes)g(contain)f(a)i (method)f(called)g Fj(castdown\(p\))75 1145 y Fk(that)i(is)f(used)h(as)g (follows:)293 1248 y Fj(base_class)30 b(*p;)293 1304 y(derived_class)h(*q)d (=)f(derived_clas)q(s::c)q(ast)q(down)q(\(p\);)146 1407 y Fk(Pointer)12 b Fj(p)i Fk(will)f(be)g(converted)g(to)g(class)g Fj(derived)p 1008 1407 V 18 w(class)i Fk(if)e(and)h(only)e(if)h(class)g Fj(derived)p 1723 1407 V 19 w(class)75 1463 y Fk(is)d(a)h(derived)g(class)f (of)h Fj(base)p 554 1463 V 17 w(class)i Fb(and)d Fk(the)g(object)h(pointed)e (to)h(by)h Fj(p)g Fk(is)f(of)h(type)f Fj(derived)p 1643 1463 V 19 w(class)i Fk(of)f(a)75 1520 y(derived)g(type)f(of)i(it.)k(Otherwise)10 b(this)g(method)h(returns)f(the)h Fj(nil)h Fk(pointer)m(.)75 1665 y Fl(A)60 b(Normal)14 b(Form)f(for)i(Method)g(Arguments)f(Strings)75 1769 y Fk(The)c(following)e(set)i(of)h(rules)f(provides)f(a)h(normal-form)h (speci\256cation)e(for)i(the)f(syntax)f(of)i(method)e(ar)o(guments)75 1825 y(strings.)20 b(In)13 b(this)e(speci\256cation,)i(non-terminals)e(are)j (enclosed)e(in)g Fj({)i Fk(and)e Fj(})p Fk(,)i(and)f(terminals)f(are)i (enclosed)e(in)75 1882 y(quotes.)20 b(The)13 b(symbol)e Fj(|)j Fk(represents)e(an)h(alternative)e(within)g(a)j(production.)19 b(A)13 b(line)f(with)f(no)i(left-hand)f(side)75 1938 y(is)f(a)g(continuation) e(line.)146 1995 y(The)h(special)f(non-terminals)g Fj({class-name})p Fk(,)14 b Fj({number})e Fk(and)e Fj({})h Fk(correspond)f(respectively)e(to)i (an)75 2051 y(identi\256er)g(representing)h(a)g(class)g(name,)h(a)g(positive) d(integer)h(number)n(,)i(and)f(the)g(null)f(\(epsilon\))g(symbol.)75 2154 y Fj({method-args-)q(stri)q(ng})113 b(::)27 b({method-attr)q(ibut)q(es}) k({argument-list)q(})75 2210 y({method-attri)q(bute)q(s})140 b(::)27 b({id-spec})j({method-type-)q(spec)q(})g(':')e(|)g({})75 2267 y({id-spec})412 b(::)27 b('knownID')j(|)e({})75 2323 y({method-type-)q (spec)q(})167 b(::)27 b('rpc')i(|)f({})75 2380 y({argument-lis)q(t})249 b(::)27 b({argument-sp)q(ec})k({argument-list)q(})f(|)e({})75 2436 y({argument-spe)q(c})249 b(::)27 b({direction})k({indirection-co)q(unt)q (})730 2492 y({copy-flag})f({dealloc-flag})730 2549 y({data-type})g ({size-spec})g(';')75 2605 y({direction})358 b(::)27 b('IN')i(|)e('OUT')i(|)e ('IN')i('OUT')f(|)g({})75 2662 y({indirection-)q(coun)q(t})140 b(::)27 b({})h(|)g('*')g(|)f('**')75 2718 y({copy-flag})358 b(::)27 b('Copy')i(|)f({})75 2775 y({dealloc-flag)q(})276 b(::)27 b('Dealloc')j(|)e({})964 2899 y Fk(9)p eop %%Page: 10 10 bop 75 116 a Fj({data-type})358 b(::)27 b('char')i(|)f('float')h(|)f('int')g (|)g('word')730 173 y(|)f('byte')i(|)f('unstructured')j(|)c('string')730 229 y(|)g({port-type})j(|)e({object-type})75 286 y({port-type})358 b(::)27 b('ps')i(|)e('pr')75 342 y({object-type})304 b(::)27 b('object')j({class-spec})75 399 y({class-spec})331 b(::)27 b('<'{class-na)q(me}')q(>')75 455 y({size-spec})358 b(::)27 b({data-count})k({record-size})g(|)c({})75 511 y({data-count})331 b(::)27 b('['{number}')q(]')j(|)e('[*]')730 568 y(|)f('[*:'{number})q(']')75 624 y({record-size})304 b(::)27 b('['{number}')q(]')j(|)e({})146 731 y Fk(Note)11 b(that)g(because)h(of)g(the)g(particular)f(parser)i(used,)f (many)g(other)f(grammars)i(are)g(also)e(accepted.)20 b(How-)75 787 y(ever)n(,)15 b(the)e(grammar)h(given)f(here)h(is)e(suf)o(\256cient)h(to) g(express)g(all)g(the)g(features)g(of)h(method)e(ar)o(guments)h(strings.)75 844 y(Note)e(also)g(that)f(although)g(all)h(the)g(strings)e(accepted)j(by)f (this)f(grammar)i(are)g(accepted)g(by)f(the)g(parser)n(,)h(they)f(do)75 900 y(not)f(necessarily)h(correspond)f(to)h(meaningful)f(ar)o(guments)h (strings,)f(and)h(may)h(cause)f(run-time)g(errors.)75 1046 y Fl(B)60 b(Examples)75 1151 y Fg(B.1)50 b(Abstract)12 b(classes)75 1238 y Fc(B.1.1)46 b(Declaration)11 b(File)f(us)p 588 1238 14 2 v 16 w(name)p 710 1238 V 17 w(ifc.h)75 1314 y Fe(/*)23 b(us_name_)q(ifc)q(.h)j(*/)75 1405 y(class)e(usName:)i(public)f(virtual)g (usItem)g({)209 1451 y(public:)254 1497 y(DECLARE_)q(MEM)q(BE)q(RS)q(_AB)q (ST)q(RAC)q(T_)q(CL)q(ASS)q(\(u)q(sNa)q(me)q(\);)75 1542 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_resolv)q(e\()q(cha)q(r*)q(,)g(ns_mode_t,) g(ns_access)q(_t)q(,)972 1588 y(usItem**)f(,)e(ns_type_)q(t*,)j(char*,)972 1634 y(int*,)e(ns_action)q(_t)q(*\))i(=0;)75 1679 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_create)q(\(c)q(har)q(*,)g(ns_type_t)q(,)g (ns_prot_t,)g(int,)949 1725 y(ns_acces)q(s_t)q(,)g(usItem**\))g(=0;)75 1771 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_list_t)q(yp)q(es\()q(ns) q(_t)q(ype)q(_t)q(**,)g(int*\))f(=0;)75 1816 y(};)75 1908 y(EXPORT_ME)q(TH)q (OD\()q(ns)q(_re)q(so)q(lv)q(e\);)75 1953 y(EXPORT_ME)q(TH)q(OD\()q(ns)q(_cr) q(ea)q(te)q(\);)75 1999 y(EXPORT_ME)q(TH)q(OD\()q(ns)q(_li)q(st)q(_t)q(ype)q (s\))q(;)75 2122 y Fc(B.1.2)46 b(De\256nition)11 b(File)g(us)p 553 2122 V 16 w(name.cc)75 2198 y Fe(/*)23 b(us_name.)q(cc)j(*/)75 2289 y(#include)g()75 2381 y(#define)f(BASE)f(usItem) 75 2426 y(DEFINE_AB)q(ST)q(RAC)q(T_)q(CLA)q(SS)q(\(u)q(sNa)q(me)q(\);)75 2518 y(DEFINE_ME)q(TH)q(OD_)q(AR)q(GS\()q(ns)q(_r)q(eso)q(lv)q(e,")q(rp)q(c:) i(IN)d(string;)j(IN)d(int;)h(IN)f(int;)h(OUT)g(*)f(object)q(;)i (OUT)f(*)f(int;)h(OUT)g(*)e(char[102)q(4])q(;)j(OUT)f(*)f(int;)h(OUT)g(*)e (int;"\);)75 2563 y(DEFINE_ME)q(TH)q(OD_)q(AR)q(GS\()q(ns)q(_c)q(rea)q(te)q (,"r)q(pc)q(:)k(IN)d(string;)i(IN)e(int;)h(IN)g(*)f(int[*];)i(IN)e(int;)h(IN) f(int;)i(OUT)e(*)g(object)q(;")q(\);)75 2609 y(DEFINE_ME)q(TH)q(OD_)q(AR)q(GS\()q(ns)q(_l)q(ist)q(_t)q(ype)q(s,)q("r)q (pc:)j(OUT)e(COPY)g(DEALLOC)h(**)f(int[*];)h(OUT)f(*)e(int;"\);)952 2899 y Fk(10)p eop %%Page: 11 11 bop 75 116 a Fg(B.2)50 b(Pr)o(oxy)13 b(Classes)75 203 y Fc(B.2.1)46 b(Declaration)11 b(File)f(us)p 588 203 14 2 v 16 w(name)p 710 203 V 17 w(pr)o(oxy)p 840 203 V 16 w(ifc.h)75 279 y Fe(/*)23 b(us_name_)q(pro)q(xy)q(_if)q(c.)q(h)j(*/)75 371 y(#include)g()75 416 y(#include)g()75 508 y(class)e(usName_p)q(ro)q(xy:)i(public)f(usName,)h(public)e(usItem_p)q (ro)q(xy)i({)209 553 y(public:)254 599 y(DECLARE_)q(PRO)q(XY)q(_M)q(EMB)q(ER) q(S\(u)q(sN)q(am)q(e_p)q(ro)q(xy\))q(;)254 645 y(usName_p)q(rox)q(y\()q(\))g ({};)254 690 y(/*)277 736 y(*)d(Methods)i(exported)h(remotely)277 782 y(*/)75 827 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_resolv)q(e\() q(cha)q(r*)q(,)g(ns_mode_t,)g(ns_access)q(_t)q(,)972 873 y(usItem**)f(,)e (ns_type_)q(t*,)j(char*,)972 919 y(int*,)e(ns_action)q(_t)q(*\))q(;)75 964 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_create)q(\(c)q(har)q(*,)g (ns_type_t)q(,)g(ns_prot_t,)g(int,)949 1010 y(ns_acces)q(s_t)q(,)g (usItem**\);)75 1056 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_list_t)q (yp)q(es\()q(ns)q(_t)q(ype)q(_t)q(**,)g(int*\);)75 1101 y(};)75 1270 y Fc(B.2.2)46 b(De\256nition)11 b(File)g(us)p 553 1270 V 16 w(name)p 675 1270 V 17 w(pr)o(oxy)m(.cc)75 1346 y Fe(/*)23 b(us_name_)q(pro)q(xy)q(.cc)j(*/)75 1437 y(#include)g()75 1529 y(DEFINE_PR)q(OX)q(Y_C)q(LA)q(SS\()q(us)q(Na)q(me_)q (pr)q(oxy)q(\);)75 1574 y(DEFINE_CA)q(ST)q(DOW)q(N2)q(\(us)q(Na)q(me)q(_pr)q (ox)q(y,)g(usItem_pr)q(oxy)q(,)g(usName\))75 1665 y(void)e(usName_pr)q(ox)q (y::)q(in)q(it)q(_cl)q(as)q(s\(u)q(sC)q(la)q(ss*)i(class_ob)q(j\))75 1711 y({)254 1757 y(usName::)q(ini)q(t_)q(cl)q(ass)q(\(c)q(las)q(s_)q(ob)q (j\);)254 1802 y(usItem_p)q(rox)q(y:)q(:i)q(nit)q(_c)q(las)q(s\()q(cl)q(ass)q (_o)q(bj\))q(;)254 1894 y(BEGIN_SE)q(TUP)q(_M)q(ET)q(HOD)q(_W)q(ITH)q(_A)q (RG)q(S\(u)q(sN)q(ame)q(_p)q(ro)q(xy\))q(;)254 1939 y(SETUP_ME)q(THO)q(D_)q (WI)q(TH_)q(AR)q(GS\()q(us)q(Na)q(me_)q(pr)q(oxy)q(,n)q(s_)q(res)q(ol)q(ve\)) q(;)254 1985 y(SETUP_ME)q(THO)q(D_)q(WI)q(TH_)q(AR)q(GS\()q(us)q(Na)q(me_)q (pr)q(oxy)q(,n)q(s_)q(cre)q(at)q(e\);)254 2031 y(SETUP_ME)q(THO)q(D_)q(WI)q (TH_)q(AR)q(GS\()q(us)q(Na)q(me_)q(pr)q(oxy)q(,n)q(s_)q(lis)q(t_)q(typ)q(es)q (\);)254 2076 y(END_SETU)q(P_M)q(ET)q(HO)q(D_W)q(IT)q(H_A)q(RG)q(S;)75 2122 y(})75 2213 y(mach_erro)q(r_)q(t)75 2259 y(usName_pr)q(ox)q(y::)q(ns)q (_re)q(so)q(lv)q(e\(c)q(ha)q(r)f(*path,)g(ns_mode_)q(t)h(mode,)e(ns_access)q (_t)i(access,)635 2305 y(usItem**)g(newobj,ns)q(_t)q(yp)q(e_t)g(*newtype)q (,ch)q(ar)g(*newpath,)635 2350 y(int)e(*usedlen,)i(ns_actio)q(n_t)g (*action\))75 2396 y({)254 2442 y(return)f(outgoing)q(_in)q(vo)q(ke\()q(ma)q (ch)q(_me)q(th)q(od_)q(id)q(\(n)q(s_r)q(es)q(olv)q(e\))q(,p)q(ath)q(,m)q(ode) q(,a)q(cc)q(ess)q(,)770 2487 y(newobj,ne)q(wty)q(pe)q(,n)q(ewp)q(at)q(h,u)q (se)q(dl)q(en,)q(ac)q(tio)q(n\))q(;)75 2533 y(})75 2624 y(mach_erro)q(r_)q(t) 75 2670 y(usName_pr)q(ox)q(y::)q(ns)q(_cr)q(ea)q(te)q(\(ch)q(ar)h(*name,)f (ns_type_t)h(type,)f(ns_prot_t)h(prot,)613 2716 y(int)e(protlen,)h(ns_acces)q (s_)q(t)g(access,)h(usItem**)f(newobj\))75 2761 y({)952 2899 y Fk(11)p eop %%Page: 12 12 bop 254 116 a Fe(return)25 b(outgoing)q(_in)q(vo)q(ke\()q(ma)q(ch)q(_me)q(th) q(od_)q(id)q(\(n)q(s_c)q(re)q(ate)q(\),)q(na)q(me,)q(ty)q(pe,)q(pr)q(ot)q(,) 770 162 y(protlen,a)q(cce)q(ss)q(,n)q(ewo)q(bj)q(\)\);)75 208 y(})75 299 y(mach_erro)q(r_)q(t)g(usName_p)q(ro)q(xy:)q(:n)q(s_l)q(is)q(t_)q (typ)q(es)q(\(ns)q(_t)q(yp)q(e_t)h(**types,)g(int)e(*count\))75 345 y({)254 390 y(return)h(outgoing)q(_in)q(vo)q(ke\()q(ma)q(ch)q(_me)q(th)q (od_)q(id)q(\(n)q(s_l)q(is)q(t_t)q(yp)q(es)q(\),t)q(yp)q(es,)q(co)q(un)q (t\);)75 436 y(})75 560 y Fg(B.3)50 b(Server)n(-Side)12 b(Classes)75 647 y Fc(B.3.1)46 b(Declaration)11 b(File)f(dir)p 603 647 14 2 v 17 w(ifc.h)75 723 y Fe(/*)23 b(dir_ifc.)q(h)i(*/)75 815 y(class)f(dir:)h(public)f(usName,)i(public)f(vol_agency)h({)254 860 y(struct)f(mutex)361 b(lock;)209 906 y(public:)254 952 y(DECLARE_)q(MEM)q(BE)q(RS)q(\(di)q(r\))q(;)254 997 y(dir\(\);)75 1043 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_get_at)q(tr)q(ibu)q(te)q (s\()q(ns_)q(at)q(tr_)q(t,)g(int*\);)75 1089 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_resolv)q(e\()q(ns_)q(pa)q(th)q(_t,)g(ns_mode_)q(t,)g (ns_access)q(_t,)972 1134 y(usItem**)f(,)e(ns_type_)q(t*,)j(ns_path_)q(t,)972 1180 y(int*,)e(ns_action)q(_t)q(*\))q(;)75 1226 y(REMOTE)47 b(virtual)26 b(mach_error)q(_t)g(ns_list_t)q(yp)q(es\()q(ns)q(_t)q(ype)q(_t)q (**,)g(int*\);)75 1271 y(};)75 1394 y Fc(B.3.2)46 b(De\256nition)11 b(File)g(dir)l(.cc)75 1470 y Fe(/*)23 b(dir.cc)i(*/)75 1516 y(#include)h()75 1607 y(DEFINE_CL)q(AS)q(S_M)q(I\()q(dir)q(\);) 75 1653 y(DEFINE_CA)q(ST)q(DOW)q(N2)q(\(di)q(r,)g(usName,)f(vol_agen)q(cy)q (\);)75 1744 y(void)f(dir::init)q(_c)q(las)q(s\()q(us)q(Cla)q(ss)q(*)h (class_ob)q(j\))75 1790 y({)254 1835 y(usName::)q(ini)q(t_)q(cl)q(ass)q(\(c)q (las)q(s_)q(ob)q(j\);)254 1881 y(vol_agen)q(cy:)q(:i)q(ni)q(t_c)q(la)q(ss\()q (cl)q(as)q(s_o)q(bj)q(\);)254 1972 y(BEGIN_SE)q(TUP)q(_M)q(ET)q(HOD)q(_W)q (ITH)q(_A)q(RG)q(S\(d)q(ir)q(\);)254 2018 y(SETUP_ME)q(THO)q(D_)q(WI)q(TH_)q (AR)q(GS\()q(di)q(r,)q(ns_)q(re)q(sol)q(ve)q(\);)254 2064 y(SETUP_ME)q(THO)q (D_)q(WI)q(TH_)q(AR)q(GS\()q(di)q(r,)q(ns_)q(cr)q(eat)q(e\))q(;)254 2109 y(SETUP_ME)q(THO)q(D_)q(WI)q(TH_)q(AR)q(GS\()q(di)q(r,)q(ns_)q(li)q(st_) q(ty)q(pe)q(s\);)254 2155 y(END_SETU)q(P_M)q(ET)q(HO)q(D_W)q(IT)q(H_A)q(RG)q (S;)75 2201 y(})75 2292 y(dir::dir\()q(\))75 2338 y({)254 2383 y(mutex_in)q(it\()q(&t)q(hi)q(s->)q(lo)q(ck\))q(;)75 2429 y(})75 2520 y(char*)f(dir::rem)q(ot)q(e_c)q(la)q(ss)q(_na)q(me)q(\(\))i(const)75 2566 y({)254 2612 y(return)f(``usName)q(_pr)q(ox)q(y'')q(;)75 2657 y(})75 2749 y(mach_erro)q(r_)q(t)952 2899 y Fk(12)p eop %%Page: 13 13 bop 75 116 a Fe(dir::ns_r)q(es)q(olv)q(e\()q(ns_)q(pa)q(th)q(_t)26 b(path,)e(ns_mode_)q(t)h(mode,)g(ns_access)q(_t)h(access,)434 162 y(usItem)f(**newobj,)h(ns_type_t)g(*newtype,)g(ns_path_t)g(newpath,)434 208 y(int)d(*usedlen)q(,)i(ns_actio)q(n_)q(t)g(*action\))75 253 y({)75 299 y(...)75 345 y(})75 390 y(mach_erro)q(r_)q(t)75 436 y(dir::ns_c)q(re)q(ate)q(\(n)q(s_n)q(am)q(e_)q(t)g(name,)g(ns_type_t)h (type,)f(ns_prot_t)h(prot,)e(int)g(protlen,)411 482 y(ns_acces)q(s_t)i (access,)g(usItem)e(**newobj)q(\))75 527 y({)75 573 y(...)75 619 y(})75 664 y(mach_erro)q(r_)q(t)h(dir::ns_)q(li)q(st_)q(ty)q(pes)q(\(n)q (s_)q(typ)q(e_)q(t)g(**types,)h(int)e(*count\))75 710 y({)75 756 y(...)75 801 y(})952 2899 y Fk(13)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF