From 96c6280079d9f4f6ab3408aca074c3d1724018aa Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 5 Apr 2004 11:14:02 +0000 Subject: [PATCH] This commit was generated by cvs2git to create branch 'Event_Server'. Sprout from V1_4_1a 2004-04-05 11:14:01 UTC smh 'SALOME PAL V1_4_1' Cherrypick from BRANCH_Superv_DataStream 2004-03-22 16:17:00 UTC rahuel '*** empty log message ***': examples/GraphStream.py examples/GraphStream.xml examples/GraphStreams.py examples/GraphStreams.xml src/AddComponent/AddComponent_Impl.cxx src/DivComponent/DivComponent.cxx Delete: src/MulComponent/MulComponent.cxx src/SubComponent/SubComponent.cxx src/SyrComponent/SyrComponent_Impl.cxx --- examples/GraphStream.py | 91 ++ examples/GraphStream.xml | 292 ++++++ examples/GraphStreams.py | 278 ++++++ examples/GraphStreams.xml | 922 ++++++++++++++++++ .../DivComponent.cxx} | 37 +- src/SubComponent/SubComponent.cxx | 90 -- src/SyrComponent/SyrComponent_Impl.cxx | 398 -------- 7 files changed, 1602 insertions(+), 506 deletions(-) create mode 100644 examples/GraphStream.py create mode 100644 examples/GraphStream.xml create mode 100644 examples/GraphStreams.py create mode 100644 examples/GraphStreams.xml rename src/{MulComponent/MulComponent.cxx => DivComponent/DivComponent.cxx} (67%) delete mode 100644 src/SubComponent/SubComponent.cxx delete mode 100755 src/SyrComponent/SyrComponent_Impl.cxx diff --git a/examples/GraphStream.py b/examples/GraphStream.py new file mode 100644 index 0000000..4941141 --- /dev/null +++ b/examples/GraphStream.py @@ -0,0 +1,91 @@ + +# Generated python file of Graph GraphStream + +from SuperV import * +# Graph creation +GraphStream = Graph( 'GraphStream' ) +GraphStream.SetName( 'GraphStream' ) +GraphStream.SetAuthor( '' ) +GraphStream.SetComment( '' ) +GraphStream.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +Add = GraphStream.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( 'Add from AddComponent' ) +Add.Coords( 15 , 241 ) +Add.InDataStreamPort( 'istream' , 'long' ) +Add.OutDataStreamPort( 'ostream' , 'long' ) +Add.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub = GraphStream.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( 'Sub from SubComponent' ) +Sub.Coords( 227 , 99 ) +Sub.InDataStreamPort( 'istream' , 'long' ) +Sub.InDataStreamPort( 'Istream' , 'long' ) + +Mul = GraphStream.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( 'Mul from MulComponent' ) +Mul.Coords( 444 , 241 ) + +Div = GraphStream.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'FactoryServer' ) +Div.SetComment( 'Div from DivComponent' ) +Div.Coords( 634 , 98 ) +Div.OutDataStreamPort( 'ostream' , 'long' ) + +# Creation of Links +Addz = Add.Port( 'z' ) +Suby = GraphStream.Link( Addz , Sub.Port( 'y' ) ) +Suby.AddCoord( 1 , 189 , 207 ) +Suby.AddCoord( 2 , 189 , 350 ) + +Muly = GraphStream.Link( Addz , Mul.Port( 'y' ) ) + +Addostream = Add.Port( 'ostream' ) +Subistream = GraphStream.Link( Addostream , Sub.Port( 'istream' ) ) +Subistream.AddCoord( 1 , 201 , 237 ) +Subistream.AddCoord( 2 , 200 , 378 ) + +AddOstream = Add.Port( 'Ostream' ) +SubIstream = GraphStream.Link( AddOstream , Sub.Port( 'Istream' ) ) +SubIstream.AddCoord( 1 , 212 , 267 ) +SubIstream.AddCoord( 2 , 211 , 409 ) + +Subz = Sub.Port( 'z' ) +Mulx = GraphStream.Link( Subz , Mul.Port( 'x' ) ) +Mulx.AddCoord( 1 , 420 , 322 ) +Mulx.AddCoord( 2 , 419 , 180 ) + +Divx = GraphStream.Link( Subz , Div.Port( 'x' ) ) + +Mulz = Mul.Port( 'z' ) +Divy = GraphStream.Link( Mulz , Div.Port( 'y' ) ) +Divy.AddCoord( 1 , 622 , 207 ) +Divy.AddCoord( 2 , 623 , 320 ) + +# Creation of Input datas +Addx = Add.Input( 'x' , 3) +Addy = Add.Input( 'y' , 4.5) +Subx = Sub.Input( 'x' , 1.5) +Addistream = Add.Input( 'istream' , 1) + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Divz = Div.Port( 'z' ) +Divostream = Div.Port( 'ostream' ) + +GraphStream.Run() +GraphStream.DoneW() +GraphStream.PrintPorts() diff --git a/examples/GraphStream.xml b/examples/GraphStream.xml new file mode 100644 index 0000000..c593d79 --- /dev/null +++ b/examples/GraphStream.xml @@ -0,0 +1,292 @@ + + + + +? + ? + GraphStream + 1 + ? + +GraphStream + + +double + Add\x + +double + Add\y + +double + Sub\x + + +double + Add\FuncValue + +double + Div\z + + +long + Add\istream + +long + Div\ostream + + 12/3/2004 - 17:16:56 + 12/3/2004 - 17:35:43 + 1.05 + ? + ? + ? + 0 + 0 + + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Add from AddComponent + 15 + 241 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Sub from SubComponent + 227 + 99 + +MulComponent + MulComponent + Mul + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Mul from MulComponent + 444 + 241 + +DivComponent + DivComponent + Div + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 12/3/2004 - 17:35:43 + 12/3/2004 - 17:35:43 + 1.05 + ? + FactoryServer + Div from DivComponent + 634 + 98 + + +Add + z + Sub + y + + +189 + 207 + +189 + 350 + +Add + z + Mul + y + + +Add + ostream + Sub + istream + + +201 + 237 + +200 + 378 + +Add + Ostream + Sub + Istream + + +212 + 267 + +211 + 409 + +Sub + z + Mul + x + + +420 + 322 + +419 + 180 + +Sub + z + Div + x + + +Mul + z + Div + y + + +622 + 207 + +623 + 320 + + +GraphStream + Add\x + Add + x + +7 + 3 + + +GraphStream + Add\y + Add + y + +7 + 4.5 + + +GraphStream + Sub\x + Sub + x + +7 + 1.5 + + +GraphStream + Add\istream + Add + istream + +3 + 1 + diff --git a/examples/GraphStreams.py b/examples/GraphStreams.py new file mode 100644 index 0000000..fc9367b --- /dev/null +++ b/examples/GraphStreams.py @@ -0,0 +1,278 @@ + +# Generated python file of Graph GraphStreams + +from SuperV import * +# Graph creation +GraphStreams = Graph( 'GraphStreams' ) +GraphStreams.SetName( 'GraphStreams' ) +GraphStreams.SetAuthor( '' ) +GraphStreams.SetComment( '' ) +GraphStreams.Coords( 0 , 0 ) + +# Creation of Factory Nodes + +Add = GraphStreams.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add.SetName( 'Add' ) +Add.SetAuthor( '' ) +Add.SetContainer( 'FactoryServer' ) +Add.SetComment( 'Add from AddComponent' ) +Add.Coords( 256 , 156 ) +Add.InDataStreamPort( 'istream' , 'long' ) +Add.OutDataStreamPort( 'ostream' , 'long' ) +Add.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub = GraphStreams.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub.SetName( 'Sub' ) +Sub.SetAuthor( '' ) +Sub.SetContainer( 'FactoryServer' ) +Sub.SetComment( 'Sub from SubComponent' ) +Sub.Coords( 519 , 33 ) +Sub.InDataStreamPort( 'istream' , 'long' ) +Sub.InDataStreamPort( 'Istream' , 'long' ) + +Mul = GraphStreams.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul.SetName( 'Mul' ) +Mul.SetAuthor( '' ) +Mul.SetContainer( 'FactoryServer' ) +Mul.SetComment( 'Mul from MulComponent' ) +Mul.Coords( 723 , 156 ) + +Div = GraphStreams.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div.SetName( 'Div' ) +Div.SetAuthor( '' ) +Div.SetContainer( 'FactoryServer' ) +Div.SetComment( 'Div from DivComponent' ) +Div.Coords( 936 , 34 ) +Div.OutDataStreamPort( 'ostream' , 'long' ) + +Add_1 = GraphStreams.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) +Add_1.SetName( 'Add_1' ) +Add_1.SetAuthor( '' ) +Add_1.SetContainer( 'localhost/FactoryServer' ) +Add_1.SetComment( 'Add from AddComponent' ) +Add_1.Coords( 252 , 499 ) +Add_1.InDataStreamPort( 'istream' , 'long' ) +Add_1.OutDataStreamPort( 'ostream' , 'long' ) +Add_1.OutDataStreamPort( 'Ostream' , 'long' ) + +Sub_1 = GraphStreams.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) +Sub_1.SetName( 'Sub_1' ) +Sub_1.SetAuthor( '' ) +Sub_1.SetContainer( 'localhost/FactoryServer' ) +Sub_1.SetComment( 'Sub from SubComponent' ) +Sub_1.Coords( 518 , 369 ) +Sub_1.InDataStreamPort( 'istream' , 'long' ) +Sub_1.InDataStreamPort( 'Istream' , 'long' ) + +Mul_1 = GraphStreams.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) +Mul_1.SetName( 'Mul_1' ) +Mul_1.SetAuthor( '' ) +Mul_1.SetContainer( 'localhost/FactoryServer' ) +Mul_1.SetComment( 'Mul from MulComponent' ) +Mul_1.Coords( 731 , 498 ) + +Div_1 = GraphStreams.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) +Div_1.SetName( 'Div_1' ) +Div_1.SetAuthor( '' ) +Div_1.SetContainer( 'localhost/FactoryServer' ) +Div_1.SetComment( 'Div from DivComponent' ) +Div_1.Coords( 931 , 369 ) +Div_1.OutDataStreamPort( 'ostream' , 'long' ) + +# Creation of Loop Nodes +PyLoop = [] +PyLoop.append( 'import time ' ) +PyLoop.append( 'def Init(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyLoop.append( ' if Min <= Max : ' ) +PyLoop.append( ' Index = Min ' ) +PyLoop.append( ' else : ' ) +PyLoop.append( ' Index = Max ' ) +PyLoop.append( ' time.sleep( 1 ) ' ) +PyLoop.append( ' return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +PyMoreLoop = [] +PyMoreLoop.append( 'import time ' ) +PyMoreLoop.append( 'def More(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyMoreLoop.append( ' if Index < Max : ' ) +PyMoreLoop.append( ' DoLoop = 1 ' ) +PyMoreLoop.append( ' else : ' ) +PyMoreLoop.append( ' DoLoop = 0 ' ) +PyMoreLoop.append( ' time.sleep( 1 ) ' ) +PyMoreLoop.append( ' return DoLoop,Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +PyNextLoop = [] +PyNextLoop.append( 'import time ' ) +PyNextLoop.append( 'def Next(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) : ' ) +PyNextLoop.append( ' Index = Index + Incr ' ) +PyNextLoop.append( ' time.sleep( 1 ) ' ) +PyNextLoop.append( ' return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' ) +Loop,EndLoop = GraphStreams.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) +EndLoop.SetName( 'EndLoop' ) +EndLoop.SetAuthor( '' ) +EndLoop.SetComment( '' ) +EndLoop.Coords( 1157 , 388 ) +PyEndLoop = [] +EndLoop.SetPyFunction( 'EndInit' , PyEndLoop ) +Loop.SetName( 'Loop' ) +Loop.SetAuthor( '' ) +Loop.SetComment( '' ) +Loop.Coords( 5 , 399 ) +Loop.InPort( 'Index' , 'long' ) +Loop.InPort( 'Min' , 'long' ) +Loop.InPort( 'Max' , 'long' ) +Loop.InPort( 'Incr' , 'long' ) +Loop.InPort( 'z_Div' , 'double' ) +Loop.InPort( 'z_Div_1' , 'double' ) +Loop.InPort( 'y_Add' , 'double' ) +Loop.InPort( 'x_Sub' , 'double' ) + +# Creation of Links +Addz = Add.Port( 'z' ) +Suby = GraphStreams.Link( Addz , Sub.Port( 'y' ) ) +Suby.AddCoord( 1 , 448 , 143 ) +Suby.AddCoord( 2 , 447 , 266 ) + +Muly = GraphStreams.Link( Addz , Mul.Port( 'y' ) ) + +Addostream = Add.Port( 'ostream' ) +Subistream = GraphStreams.Link( Addostream , Sub.Port( 'istream' ) ) +Subistream.AddCoord( 1 , 474 , 172 ) +Subistream.AddCoord( 2 , 474 , 294 ) + +AddOstream = Add.Port( 'Ostream' ) +SubIstream = GraphStreams.Link( AddOstream , Sub.Port( 'Istream' ) ) +SubIstream.AddCoord( 1 , 499 , 201 ) +SubIstream.AddCoord( 2 , 500 , 322 ) + +Subz = Sub.Port( 'z' ) +Mulx = GraphStreams.Link( Subz , Mul.Port( 'x' ) ) +Mulx.AddCoord( 1 , 707 , 237 ) +Mulx.AddCoord( 2 , 706 , 114 ) + +Divx = GraphStreams.Link( Subz , Div.Port( 'x' ) ) + +Mulz = Mul.Port( 'z' ) +Divy = GraphStreams.Link( Mulz , Div.Port( 'y' ) ) +Divy.AddCoord( 1 , 912 , 143 ) +Divy.AddCoord( 2 , 912 , 236 ) + +Divz = Div.Port( 'z' ) +EndLoopz_Div = GraphStreams.Link( Divz , EndLoop.Port( 'z_Div' ) ) +EndLoopz_Div.AddCoord( 1 , 1147 , 537 ) +EndLoopz_Div.AddCoord( 2 , 1148 , 113 ) + +Divostream = Div.Port( 'ostream' ) +Add_1istream = GraphStreams.Link( Divostream , Add_1.Port( 'istream' ) ) +Add_1istream.AddCoord( 1 , 232 , 638 ) +Add_1istream.AddCoord( 2 , 232 , 763 ) +Add_1istream.AddCoord( 3 , 1126 , 763 ) +Add_1istream.AddCoord( 4 , 1125 , 144 ) + +Add_1z = Add_1.Port( 'z' ) +Sub_1y = GraphStreams.Link( Add_1z , Sub_1.Port( 'y' ) ) +Sub_1y.AddCoord( 1 , 445 , 478 ) +Sub_1y.AddCoord( 2 , 445 , 608 ) + +Mul_1y = GraphStreams.Link( Add_1z , Mul_1.Port( 'y' ) ) + +Add_1ostream = Add_1.Port( 'ostream' ) +Sub_1istream = GraphStreams.Link( Add_1ostream , Sub_1.Port( 'istream' ) ) +Sub_1istream.AddCoord( 1 , 473 , 508 ) +Sub_1istream.AddCoord( 2 , 474 , 638 ) + +Add_1Ostream = Add_1.Port( 'Ostream' ) +Sub_1Istream = GraphStreams.Link( Add_1Ostream , Sub_1.Port( 'Istream' ) ) +Sub_1Istream.AddCoord( 1 , 498 , 535 ) +Sub_1Istream.AddCoord( 2 , 498 , 667 ) + +Sub_1z = Sub_1.Port( 'z' ) +Mul_1x = GraphStreams.Link( Sub_1z , Mul_1.Port( 'x' ) ) +Mul_1x.AddCoord( 1 , 708 , 579 ) +Mul_1x.AddCoord( 2 , 707 , 450 ) + +Div_1x = GraphStreams.Link( Sub_1z , Div_1.Port( 'x' ) ) + +Mul_1z = Mul_1.Port( 'z' ) +Div_1y = GraphStreams.Link( Mul_1z , Div_1.Port( 'y' ) ) +Div_1y.AddCoord( 1 , 913 , 479 ) +Div_1y.AddCoord( 2 , 913 , 579 ) + +Div_1z = Div_1.Port( 'z' ) +EndLoopz_Div_1 = GraphStreams.Link( Div_1z , EndLoop.Port( 'z_Div_1' ) ) +EndLoopz_Div_1.AddCoord( 1 , 1138 , 567 ) +EndLoopz_Div_1.AddCoord( 2 , 1138 , 449 ) + +Div_1ostream = Div_1.Port( 'ostream' ) +Addistream = GraphStreams.Link( Div_1ostream , Add.Port( 'istream' ) ) +Addistream.AddCoord( 1 , 230 , 293 ) +Addistream.AddCoord( 2 , 229 , 426 ) +Addistream.AddCoord( 3 , 475 , 425 ) +Addistream.AddCoord( 4 , 475 , 352 ) +Addistream.AddCoord( 5 , 1110 , 352 ) +Addistream.AddCoord( 6 , 1111 , 477 ) + +LoopIndex = Loop.Port( 'Index' ) +EndLoopIndex = GraphStreams.Link( LoopIndex , EndLoop.Port( 'Index' ) ) + +Addx = GraphStreams.Link( LoopIndex , Add.Port( 'x' ) ) +Addx.AddCoord( 1 , 201 , 236 ) +Addx.AddCoord( 2 , 202 , 433 ) + +Add_1x = GraphStreams.Link( LoopIndex , Add_1.Port( 'x' ) ) +Add_1x.AddCoord( 1 , 199 , 578 ) +Add_1x.AddCoord( 2 , 200 , 435 ) + +LoopMin = Loop.Port( 'Min' ) +EndLoopMin = GraphStreams.Link( LoopMin , EndLoop.Port( 'Min' ) ) + +LoopMax = Loop.Port( 'Max' ) +EndLoopMax = GraphStreams.Link( LoopMax , EndLoop.Port( 'Max' ) ) + +LoopIncr = Loop.Port( 'Incr' ) +EndLoopIncr = GraphStreams.Link( LoopIncr , EndLoop.Port( 'Incr' ) ) + +Loopy_Add = Loop.Port( 'y_Add' ) +EndLoopy_Add = GraphStreams.Link( Loopy_Add , EndLoop.Port( 'y_Add' ) ) + +Addy = GraphStreams.Link( Loopy_Add , Add.Port( 'y' ) ) +Addy.AddCoord( 1 , 183 , 266 ) +Addy.AddCoord( 2 , 183 , 608 ) + +Add_1y = GraphStreams.Link( Loopy_Add , Add_1.Port( 'y' ) ) + +Loopx_Sub = Loop.Port( 'x_Sub' ) +EndLoopx_Sub = GraphStreams.Link( Loopx_Sub , EndLoop.Port( 'x_Sub' ) ) + +Subx = GraphStreams.Link( Loopx_Sub , Sub.Port( 'x' ) ) +Subx.AddCoord( 1 , 167 , 113 ) +Subx.AddCoord( 2 , 165 , 636 ) + +Sub_1x = GraphStreams.Link( Loopx_Sub , Sub_1.Port( 'x' ) ) +Sub_1x.AddCoord( 1 , 167 , 450 ) +Sub_1x.AddCoord( 2 , 165 , 637 ) + +# Creation of Input datas +LoopIndex = Loop.Input( 'Index' , 0) +LoopMin = Loop.Input( 'Min' , 1) +LoopMax = Loop.Input( 'Max' , 10) +LoopIncr = Loop.Input( 'Incr' , 1) +Loopz_Div = Loop.Input( 'z_Div' , 0) +Loopz_Div_1 = Loop.Input( 'z_Div_1' , 0) +Loopy_Add = Loop.Input( 'y_Add' , 4.5) +Loopx_Sub = Loop.Input( 'x_Sub' , 1.5) + +# Creation of Output variables +AddFuncValue = Add.Port( 'FuncValue' ) +Add_1FuncValue = Add_1.Port( 'FuncValue' ) +Loopz_Div = Loop.Port( 'z_Div' ) +Loopz_Div_1 = Loop.Port( 'z_Div_1' ) +EndLoopIndex = EndLoop.Port( 'Index' ) +EndLoopMin = EndLoop.Port( 'Min' ) +EndLoopMax = EndLoop.Port( 'Max' ) +EndLoopIncr = EndLoop.Port( 'Incr' ) +EndLoopz_Div = EndLoop.Port( 'z_Div' ) +EndLoopz_Div_1 = EndLoop.Port( 'z_Div_1' ) +EndLoopy_Add = EndLoop.Port( 'y_Add' ) +EndLoopx_Sub = EndLoop.Port( 'x_Sub' ) + +GraphStreams.Run() +GraphStreams.DoneW() +GraphStreams.PrintPorts() diff --git a/examples/GraphStreams.xml b/examples/GraphStreams.xml new file mode 100644 index 0000000..8ab2d9b --- /dev/null +++ b/examples/GraphStreams.xml @@ -0,0 +1,922 @@ + + + + +? + ? + GraphStreams + 1 + ? + +GraphStreams + + +long + Loop\Index + +long + Loop\Min + +long + Loop\Max + +long + Loop\Incr + +double + Loop\z_Div + +double + Loop\z_Div_1 + +double + Loop\y_Add + +double + Loop\x_Sub + + +double + Add\FuncValue + +double + Add_1\FuncValue + +double + Loop\z_Div + +double + Loop\z_Div_1 + +long + EndLoop\Index + +long + EndLoop\Min + +long + EndLoop\Max + +long + EndLoop\Incr + +double + EndLoop\z_Div + +double + EndLoop\z_Div_1 + +double + EndLoop\y_Add + +double + EndLoop\x_Sub + + + 15/3/2004 - 14:26:30 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 0 + 0 + + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Add from AddComponent + 256 + 156 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Sub from SubComponent + 519 + 33 + +MulComponent + MulComponent + Mul + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Mul from MulComponent + 723 + 156 + +DivComponent + DivComponent + Div + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + FactoryServer + Div from DivComponent + 936 + 34 + +AddComponent + AddComponent + Add_1 + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + +long + istream + +long + ostream + +long + Ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Add from AddComponent + 252 + 499 + +SubComponent + SubComponent + Sub_1 + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + +long + istream + +long + Istream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Sub from SubComponent + 518 + 369 + +MulComponent + MulComponent + Mul_1 + 0 + ? + +Mul + + +double + x + +double + y + + +double + z + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Mul from MulComponent + 731 + 498 + +DivComponent + DivComponent + Div_1 + 0 + ? + +Div + + +double + x + +double + y + + +double + z + + +long + ostream + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + localhost/FactoryServer + Div from DivComponent + 931 + 369 + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + + +Init + + + + + + + + + +More + + + + + + + + + +Next + + + + + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 5 + 399 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + +long + Index + +long + Min + +long + Max + +long + Incr + +double + z_Div + +double + z_Div_1 + +double + y_Add + +double + x_Sub + + + +EndInit + + 15/3/2004 - 14:28:51 + 15/3/2004 - 14:28:51 + 1.05 + ? + ? + ? + 1157 + 388 + + +Add + z + Sub + y + + +448 + 143 + +447 + 266 + +Add + z + Mul + y + + +Add + ostream + Sub + istream + + +474 + 172 + +474 + 294 + +Add + Ostream + Sub + Istream + + +499 + 201 + +500 + 322 + +Sub + z + Mul + x + + +707 + 237 + +706 + 114 + +Sub + z + Div + x + + +Mul + z + Div + y + + +912 + 143 + +912 + 236 + +Div + z + EndLoop + z_Div + + +1147 + 537 + +1148 + 113 + +Div + ostream + Add_1 + istream + + +232 + 638 + +232 + 763 + +1126 + 763 + +1125 + 144 + +Add_1 + z + Sub_1 + y + + +445 + 478 + +445 + 608 + +Add_1 + z + Mul_1 + y + + +Add_1 + ostream + Sub_1 + istream + + +473 + 508 + +474 + 638 + +Add_1 + Ostream + Sub_1 + Istream + + +498 + 535 + +498 + 667 + +Sub_1 + z + Mul_1 + x + + +708 + 579 + +707 + 450 + +Sub_1 + z + Div_1 + x + + +Mul_1 + z + Div_1 + y + + +913 + 479 + +913 + 579 + +Div_1 + z + EndLoop + z_Div_1 + + +1138 + 567 + +1138 + 449 + +Div_1 + ostream + Add + istream + + +230 + 293 + +229 + 426 + +475 + 425 + +475 + 352 + +1110 + 352 + +1111 + 477 + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Index + Add + x + + +201 + 236 + +202 + 433 + +Loop + Index + Add_1 + x + + +199 + 578 + +200 + 435 + +Loop + Min + EndLoop + Min + + +Loop + Max + EndLoop + Max + + +Loop + Incr + EndLoop + Incr + + +Loop + y_Add + EndLoop + y_Add + + +Loop + y_Add + Add + y + + +183 + 266 + +183 + 608 + +Loop + y_Add + Add_1 + y + + +Loop + x_Sub + EndLoop + x_Sub + + +Loop + x_Sub + Sub + x + + +167 + 113 + +165 + 636 + +Loop + x_Sub + Sub_1 + x + + +167 + 450 + +165 + 637 + +EndLoop + DoLoop + Loop + InitLoop + + + +GraphStreams + Loop\Index + Loop + Index + +3 + 0 + + +GraphStreams + Loop\Min + Loop + Min + +3 + 1 + + +GraphStreams + Loop\Max + Loop + Max + +3 + 10 + + +GraphStreams + Loop\Incr + Loop + Incr + +3 + 1 + + +GraphStreams + Loop\z_Div + Loop + z_Div + +7 + 0 + + +GraphStreams + Loop\z_Div_1 + Loop + z_Div_1 + +7 + 0 + + +GraphStreams + Loop\y_Add + Loop + y_Add + +7 + 4.5 + + +GraphStreams + Loop\x_Sub + Loop + x_Sub + +7 + 1.5 + diff --git a/src/MulComponent/MulComponent.cxx b/src/DivComponent/DivComponent.cxx similarity index 67% rename from src/MulComponent/MulComponent.cxx rename to src/DivComponent/DivComponent.cxx index 1b4c41f..4a4522f 100644 --- a/src/MulComponent/MulComponent.cxx +++ b/src/DivComponent/DivComponent.cxx @@ -1,4 +1,4 @@ -// SuperVisionTest MulComponent : example of component that multiplies two numbers +// SuperVisionTest DivComponent : example of component that devides two numbers // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -21,7 +21,7 @@ // // // -// File : MulComponentEngine.cxx +// File : DivComponentEngine.cxx // Author : MARC TAJCHMAN, CEA // Module : SuperVisionTest @@ -33,57 +33,58 @@ using namespace std; #include //#include "utilities.h" -#include "MulComponent.hxx" +#include "DivComponent.hxx" -MulComponentEngine::MulComponentEngine( CORBA::ORB_ptr orb, +DivComponentEngine::DivComponentEngine( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) : Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) { -// MESSAGE("MulComponentEngine::MulComponentEngine activate object instanceName(" +// MESSAGE("DivComponentEngine::DivComponentEngine activate object instanceName(" // << instanceName << ") interfaceName(" << interfaceName << ")" ) _thisObj = this ; _id = _poa->activate_object(_thisObj); _nexec = 0 ; } -MulComponentEngine::MulComponentEngine() +DivComponentEngine::DivComponentEngine() { } -MulComponentEngine::~MulComponentEngine() +DivComponentEngine::~DivComponentEngine() { } -void MulComponentEngine::Mul( double x , double y , double & z ) { - beginService( " MulComponentEngine::Mul" ); - z = x * y ; +void DivComponentEngine::Div( double x , double y , double & z ) { + beginService( " DivComponentEngine::Div" ); + z = x / y ; int S; - sendMessage(NOTIF_STEP, "Mul is Computing"); + sendMessage(NOTIF_STEP, "Div is Computing"); S = 1+(int) (15.0*rand()/(RAND_MAX+1.0)); sleep(S); - MESSAGE( "MulComponentEngine::Mul( " << x << " , " << y << " , " << z + sendMessage(NOTIF_TRACE, "Div is Much More Difficult Operation"); + MESSAGE("DivComponentEngine::Div( " << x << " , " << y << " , " << z << " ) after " << S << " seconds" ) - endService( " MulComponentEngine::Mul" ); + endService( " DivComponentEngine::Div" ); } extern "C" { - PortableServer::ObjectId * MulComponentEngine_factory + PortableServer::ObjectId * DivComponentEngine_factory (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) { - MESSAGE("MulComponentEngine_factory MulComponentEngine (" + MESSAGE("DivComponentEngine_factory DivComponentEngine (" << instanceName << "," << interfaceName << ")"); - MulComponentEngine * myMulComponent - = new MulComponentEngine(orb, poa, contId, instanceName, interfaceName); - return myMulComponent->getId() ; + DivComponentEngine * myDivComponent + = new DivComponentEngine(orb, poa, contId, instanceName, interfaceName); + return myDivComponent->getId() ; } } diff --git a/src/SubComponent/SubComponent.cxx b/src/SubComponent/SubComponent.cxx deleted file mode 100644 index 76ed6e1..0000000 --- a/src/SubComponent/SubComponent.cxx +++ /dev/null @@ -1,90 +0,0 @@ -// SuperVisionTest SubComponent : example of component that sunstracts one number from another -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SubComponentEngine.cxx -// Author : MARC TAJCHMAN, CEA -// Module : SuperVisionTest - -using namespace std; -#include -#include -#include -#include -#include - -//#include "utilities.h" -#include "SubComponent.hxx" - -SubComponentEngine::SubComponentEngine( CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) -{ -// MESSAGE("SubComponentEngine::SubComponentEngine activate object instanceName(" -// << instanceName << ") interfaceName(" << interfaceName << ")" ) - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - _nexec = 0 ; -} - -SubComponentEngine::SubComponentEngine() -{ -} - -SubComponentEngine::~SubComponentEngine() -{ -} - -void SubComponentEngine::Sub( double x , double y , double & z ) { - beginService( " SubComponentEngine::Sub" ); - z = x - y ; - int S; - - sendMessage(NOTIF_STEP, "Sub is Computing"); - S = 1+(int) (15.0*rand()/(RAND_MAX+1.0)); - sleep(S); - MESSAGE( "SubComponentEngine::Sub( " << x << " , " << y << " , " << z - << " ) after " << S << " seconds" ) - endService( " SubComponentEngine::Sub" ); -} - -extern "C" -{ - PortableServer::ObjectId * SubComponentEngine_factory - (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) - { - MESSAGE("SubComponentEngine_factory SubComponentEngine (" - << instanceName << "," << interfaceName << ")"); - SubComponentEngine * mySubComponent - = new SubComponentEngine(orb, poa, contId, instanceName, interfaceName); - return mySubComponent->getId() ; - } -} - - diff --git a/src/SyrComponent/SyrComponent_Impl.cxx b/src/SyrComponent/SyrComponent_Impl.cxx deleted file mode 100755 index 3c93ed7..0000000 --- a/src/SyrComponent/SyrComponent_Impl.cxx +++ /dev/null @@ -1,398 +0,0 @@ -// SuperVisionTest SyrComponent : example of component performing some mathinatical operations -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : SyrComponent_Impl.cxx -// Author : Jean Rahuel, CEA -// Module : SuperVisionTest - -using namespace std; -#include -#include -#include -#include -#include - -//#include "utilities.h" - -#include "SyrComponent_Impl.hxx" -#include "Adder_Impl.hxx" - -SyrComponent_Impl::SyrComponent_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - const bool kactivate ) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) { - MESSAGE("SyrComponent_Impl::SyrComponent_Impl this " << hex << this << dec - << "activate object instanceName(" - << instanceName << ") interfaceName(" << interfaceName << ")" ) - if ( kactivate ) { - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - } -} - -SyrComponent_Impl::SyrComponent_Impl() { -} - -SyrComponent_Impl::~SyrComponent_Impl() { -} - -long SyrComponent_Impl::C_ISEVEN( const long anInteger ) { - bool RetVal ; - beginService( " SyrComponent_Impl::C_ISEVEN" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_ISEVEN is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - RetVal = ( anInteger & 1 ) == 0 ; - endService( " SyrComponent_Impl::C_ISEVEN" ); - return RetVal ; -} - -long SyrComponent_Impl::C_ISONE( const long anOddInteger ) { - bool RetVal ; - beginService( " SyrComponent_Impl::C_ISONE" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_ISONE is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - RetVal = ( anOddInteger == 1 ) ; - endService( " SyrComponent_Impl::C_ISONE" ); - return RetVal ; -} - -long SyrComponent_Impl::C_M3( const long anOddInteger ) { - beginService( " SyrComponent_Impl::C_M3" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_M3 is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " SyrComponent_Impl::C_M3" ); - if ( C_ISEVEN( anOddInteger ) ) - return 0 ; - return ( 3*anOddInteger ) ; -} - -long SyrComponent_Impl::C_M3P1( const long anOddInteger ) { - beginService( " SyrComponent_Impl::C_M3P1" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_M3P1 is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " SyrComponent_Impl::C_M3P1" ); - if ( C_ISEVEN( anOddInteger ) ) - return 0 ; - return ( 3*anOddInteger + 1 ) ; -} - -long SyrComponent_Impl::C_DIV2( const long anEvenInteger ) { - beginService( " SyrComponent_Impl::C_DIV2" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_DIV2 is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " SyrComponent_Impl::C_DIV2" ); - if ( !C_ISEVEN( anEvenInteger ) ) - return 0 ; - return ( anEvenInteger >> 1 ) ; -} - -long SyrComponent_Impl::C_INCR( const long aCount ) { - beginService( " SyrComponent_Impl::C_INCR" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_INCR is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " SyrComponent_Impl::C_INCR" ); - return ( aCount + 1 ) ; -} - -long SyrComponent_Impl::C_MIN( const long aMinVal , const long anInteger ) { - beginService( " SyrComponent_Impl::C_MIN" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_MIN is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - int min = aMinVal ; - if ( anInteger < min || aMinVal == 0 ) { - min = anInteger ; - } - string trace = "SyrComponent_Impl::C_MIN : " ; - char cmin[ 30 ] ; - sprintf( cmin , "%d" , min ) ; - trace += cmin ; - sendMessage(NOTIF_TRACE, trace.c_str() ); - endService( " SyrComponent_Impl::C_MIN" ); - return min ; -} - -long SyrComponent_Impl::C_MAX( const long aMaxVal , const long anInteger ) { - beginService( " SyrComponent_Impl::C_MAX" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_MAX is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - int max = aMaxVal ; - if ( anInteger > max ) { - max = anInteger ; - } - string trace = "SyrComponent_Impl::C_MAX : " ; - char cmax[ 30 ] ; - sprintf( cmax , "%d" , max ) ; - trace += cmax ; - sendMessage(NOTIF_TRACE, trace.c_str() ); - endService( " SyrComponent_Impl::C_MAX" ); - return max ; -} - -SuperVisionTest::ListOfSyr_ptr SyrComponent_Impl::C_LISTOFSYR() { - beginService( " SyrComponent_Impl::C_LISTOFSYR" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_LISTOFSYR is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - ListOfSyr_Impl * aNewListOfSyr = new ListOfSyr_Impl( _orb , _poa, _contId, - instanceName() , interfaceName() , - graphName() , nodeName() ) ; - SuperVisionTest::ListOfSyr_var iobject = (SuperVisionTest::ListOfSyr_var ) NULL ; - PortableServer::ObjectId * id = aNewListOfSyr->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - iobject = SuperVisionTest::ListOfSyr::_narrow(obj) ; - endService( " SyrComponent_Impl::C_LISTOFSYR" ); - return SuperVisionTest::ListOfSyr::_duplicate( iobject ) ; -// return ( aNewListOfSyr._retn() ) ; -} - -SuperVisionTest::ListOfSyr_ptr SyrComponent_Impl::C_AVERAGE( - const SuperVisionTest::ListOfSyr_ptr aListOfSyr , - const long anInteger , - const long aCount , - double & anAverage ) { - beginService( " SyrComponent_Impl::C_AVERAGE" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl::C_AVERAGE is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - SuperVisionTest::SeqOfSyr * aSeqOfSyr = aListOfSyr->GetSeqOfSyr() ; - int len = aSeqOfSyr->length() ; - aSeqOfSyr->length( len + 1 ) ; - (*aSeqOfSyr)[ len ] = anInteger ; - aListOfSyr->SetSeqOfSyr( *aSeqOfSyr ) ; - anAverage = 0 ; - int i ; - for ( i = 0 ; i < len + 1 ; i++ ) { - anAverage += (*aSeqOfSyr)[ i ] ; - } - anAverage = anAverage / ( len + 1 ) ; - string end = " SyrComponent_Impl::C_AVERAGE " ; - char caverage[ 30 ] ; - sprintf( caverage , "%fd" , anAverage ) ; - end += caverage ; - endService( end.c_str() ); - return SuperVisionTest::ListOfSyr::_duplicate( aListOfSyr ) ; -} - -SuperVisionTest::Syr_ptr SyrComponent_Impl::Init( const long anOddInteger ) { - beginService( "SyrComponent_Impl::Init" ); - sendMessage(NOTIF_STEP, "SyrComponent_Impl creates Syr_Impl"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - Syr_Impl * mySyr ; - mySyr = new Syr_Impl( _orb , _poa, _contId, - instanceName() , interfaceName() , - graphName() , nodeName() , anOddInteger ) ; - SuperVisionTest::Syr_var iobject = (SuperVisionTest::Syr_var ) NULL ; - PortableServer::ObjectId * id = mySyr->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - iobject = SuperVisionTest::Syr::_narrow(obj) ; - endService( "SyrComponent_Impl::Init" ); - return SuperVisionTest::Syr::_duplicate(iobject) ; -} - -ListOfSyr_Impl::ListOfSyr_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char * instanceName , - const char * interfaceName , - const char * graphName , - const char * nodeName ) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) { - Names( graphName , nodeName ) ; - MESSAGE("ListOfSyr_Impl::ListOfSyr_Impl activate object instanceName(" - << instanceName << ") interfaceName(" << interfaceName << ") --> " - << hex << (void *) this << dec ) - beginService( "ListOfSyr_Impl::ListOfSyr_Impl" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - sendMessage(NOTIF_STEP, "ListOfSyr_Impl is Created"); - endService( "ListOfSyr_Impl::ListOfSyr_Impl" ); -} - -ListOfSyr_Impl::ListOfSyr_Impl() { -} - -ListOfSyr_Impl::~ListOfSyr_Impl() { - beginService( "ListOfSyr_Impl::~ListOfSyr_Impl" ); - endService( "ListOfSyr_Impl::~ListOfSyr_Impl" ); -} - -SuperVisionTest::SeqOfSyr * ListOfSyr_Impl::GetSeqOfSyr() { - SuperVisionTest::SeqOfSyr_var aSeqOfSyr = new SuperVisionTest::SeqOfSyr( _SeqOfSyr ) ; - return ( aSeqOfSyr._retn() ) ; -} - -void ListOfSyr_Impl::SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & aSeqOfSyr ) { - _SeqOfSyr = aSeqOfSyr ; - return ; -} - -extern "C" -{ - PortableServer::ObjectId * SyrComponentEngine_factory - (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) - { - MESSAGE("SyrComponentEngine_factory SyrComponentEngine (" - << instanceName << "," << interfaceName << "," << getpid() << ")"); - SyrComponent_Impl * mySyrComponent - = new SyrComponent_Impl(orb, poa, contId, instanceName, interfaceName); - return mySyrComponent->getId() ; - } -} - -Syr_Impl::Syr_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char * instanceName , - const char * interfaceName , - const char * graphName , - const char * nodeName , - const long anOddInteger ) : - SyrComponent_Impl(orb, poa, contId, instanceName, interfaceName,false) { - Names( graphName , nodeName ) ; - MESSAGE("Syr_Impl::Syr_Impl activate object instanceName(" - << instanceName << ") interfaceName(" << interfaceName << ") --> " - << hex << (void *) this << dec ) - beginService( "Syr_Impl::Syr_Impl" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - _InitialInteger = anOddInteger ; - _CurrentInteger = anOddInteger ; - _Count = 0 ; - sendMessage(NOTIF_STEP, "Syr_Impl is Created"); - endService( "Syr_Impl::Syr_Impl" ); -} - -Syr_Impl::Syr_Impl() { -} - -Syr_Impl::~Syr_Impl() { - beginService( "Syr_Impl::~Syr_Impl" ); - endService( "Syr_Impl::~Syr_Impl" ); -} - -long Syr_Impl::Initial() { - beginService( " Syr_Impl::Initial" ); - sendMessage(NOTIF_STEP, "Syr_Impl::Initial is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " Syr_Impl::Initial" ); - return _InitialInteger ; -} - -long Syr_Impl::Current() { - beginService( " Syr_Impl::Current" ); - sendMessage(NOTIF_STEP, "Syr_Impl::Current is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - endService( " Syr_Impl::Current" ); - return _CurrentInteger ; -} - -long Syr_Impl::IsEven() { - bool RetVal ; - beginService( " Syr_Impl::IsEven" ); - sendMessage(NOTIF_STEP, "Syr_Impl::IsEven is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - RetVal = ( _CurrentInteger & 1 ) == 0 ; - MESSAGE( " Syr_Impl::IsEven " << _CurrentInteger << " " << RetVal ); - endService( " Syr_Impl::IsEven" ); - return RetVal ; -} - -long Syr_Impl::IsOne() { - bool RetVal ; - beginService( " Syr_Impl::IsOne" ); - sendMessage(NOTIF_STEP, "Syr_Impl::IsOne is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - RetVal = ( _CurrentInteger == 1 ) ; - MESSAGE( " Syr_Impl::IsOne " << _CurrentInteger << " " << RetVal ); - endService( " Syr_Impl::IsOne" ); - return RetVal ; -} - -long Syr_Impl::Count() { - beginService( " Syr_Impl::Count" ); - sendMessage(NOTIF_STEP, "Syr_Impl::Count is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - MESSAGE( " Syr_Impl::Count " << _Count ); - endService( " Syr_Impl::Count" ); - return _Count ; -} - -void Syr_Impl::M3p1() { - beginService( " Syr_Impl::M3p1" ); - sendMessage(NOTIF_STEP, "Syr_Impl::M3p1 is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - if ( IsEven() ) - _CurrentInteger = 0 ; - else - _CurrentInteger = 3*_CurrentInteger + 1 ; - MESSAGE( " Syr_Impl::M3p1 " << _CurrentInteger ); - endService( " Syr_Impl::M3p1" ); -} - -void Syr_Impl::Div2() { - beginService( " Syr_Impl::Div2" ); - sendMessage(NOTIF_STEP, "Syr_Impl::Div2 is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - if ( !IsEven() ) - _CurrentInteger = 0 ; - else - _CurrentInteger = ( _CurrentInteger >> 1 ) ; - MESSAGE( " Syr_Impl::Div2 " << _CurrentInteger ); - endService( " Syr_Impl::Div2" ); -} - -void Syr_Impl::Incr() { - beginService( " Syr_Impl::Incr" ); - sendMessage(NOTIF_STEP, "Syr_Impl::Incr is Computing"); - int S = 1+(int) (2.0*rand()/(RAND_MAX+1.0)); - sleep(S); - _Count = _Count + 1 ; - MESSAGE( " Syr_Impl::Incr " << _Count ); - endService( " Syr_Impl::Incr" ); -} - - - -- 2.39.2