// /*----------------------------------------------------------------------*\
// | Concrete Template : Tree_Put_To_1
// \*----------------------------------------------------------------------*/
#ifndef CT_TREE_PUT_TO_1
#define CT_TREE_PUT_TO_1 1
///------------------------------------------------------------------------
/// Global Context --------------------------------------------------------
///------------------------------------------------------------------------
#include "AT/General/Put_To.h"
/*!
#include "AT/Tree/Kernel.h"
!*/
///------------------------------------------------------------------------
/// Interface -------------------------------------------------------------
///------------------------------------------------------------------------
concrete_template <
concrete_instance class Item,
concrete_instance class Tree_Base
/*!
implements
abstract_instance Tree_Kernel <
Item,
Tree_Base
>
!*/
>
class Tree_Put_To_1 :
extends
concrete_instance Tree_Base,
implements
abstract_instance General_Put_To <Tree_Base>
{
public:
procedure_body Put_To (
alters Character_OStream& outs
)
{
object Integer pos;
outs << self[current];
outs.Open_Scope ("<");
while (pos < self.Number_Of_Children ())
{
object catalyst Tree_Put_To_1 temp;
self.Remove (pos, temp);
outs.New_Line ();
outs << temp;
if (pos < self.Number_Of_Children ())
{
outs << ",";
}
self.Add (pos, temp);
pos++;
}
outs.Close_Scope(">");
}
};
//-------------------------------------------------------------------------
#endif // CT_TREE_PUT_TO_1
Last modified: Thu Jan 11 17:05:57 EST 2007