// /*-------------------------------------------------------------------*\
// | Concrete Template : Sequence_Put_To_1
// \*-------------------------------------------------------------------*/
#ifndef CT_SEQUENCE_PUT_TO_1
#define CT_SEQUENCE_PUT_TO_1 1
///------------------------------------------------------------------------
/// Global Context --------------------------------------------------------
///------------------------------------------------------------------------
#include "AT/General/Put_To.h"
/*!
#include "AT/Sequence/Kernel.h"
!*/
///------------------------------------------------------------------------
/// Interface -------------------------------------------------------------
///------------------------------------------------------------------------
concrete_template <
concrete_instance class Item,
/*!
implements
abstract_instance General_Put_To <Item>
!*/
concrete_instance class Sequence_Base
/*!
implements
abstract_instance Sequence_Kernel <Item>
!*/
>
class Sequence_Put_To_1 :
extends
concrete_instance Sequence_Base,
implements
abstract_instance General_Put_To <Sequence_Base>
{
public:
procedure_body Put_To (
alters Character_OStream& outs
)
{
object Integer pos;
// Open scope of string
outs.Open_Scope ("<");
// Put contents of self
while (pos < self.Length ())
/*!
alters pos
preserves self
maintains
there exists a, b: string of Item
(self = a * b and
|a| = pos and
[items in a have been output already])
decreases
|self| - pos
!*/
{
outs.New_Line ();
outs << self[pos];
pos++;
}
// Close scope of string
outs.Close_Scope (">");
}
};
#endif // CT_SEQUENCE_PUT_TO_1
Last modified: Thu Jan 11 17:05:57 EST 2007