// /*-------------------------------------------------------------------*\
// | Concrete Template : Static_Array_Put_To_1
// \*-------------------------------------------------------------------*/
#ifndef CT_STATIC_ARRAY_PUT_TO_1
#define CT_STATIC_ARRAY_PUT_TO_1 1
///------------------------------------------------------------------------
/// Global Context --------------------------------------------------------
///------------------------------------------------------------------------
#include "AT/General/Put_To.h"
/*!
#include "AT/Static_Array/Kernel.h"
!*/
///------------------------------------------------------------------------
/// Interface -------------------------------------------------------------
///------------------------------------------------------------------------
concrete_template <
concrete_instance class Item,
/*!
implements
abstract_instance General_Put_To <Item>
!*/
Integer_constant lower,
Integer_constant upper,
/*!
satisfies restriction
lower <= upper
!*/
concrete_instance class Static_Array_Base
/*!
implements
abstract_instance Static_Array_Kernel <Item, lower, upper>
!*/
>
class Static_Array_Put_To_1 :
extends
concrete_instance Static_Array_Base,
implements
abstract_instance General_Put_To <Static_Array_Base>
{
public:
procedure_body Put_To (
alters Character_OStream& outs
)
{
object Integer i;
// Open scope of set
outs.Open_Scope ("{");
// Put contents of self
i = lower;
while (i <= upper)
/*!
alters self, i
maintains
lower <= i <= upper + 1 and
for all k: integer, x: Item
where (lower <= k < i and (k,x) is in self)
([pair (k,x) has been output])
decreases
upper + 1 - i
!*/
{
outs.New_Line ();
outs << i << " --> " << self[i];
i++;
}
// Close scope of set
outs.Close_Scope ("}");
}
};
#endif // CT_STATIC_ARRAY_PUT_TO_1
Last modified: Thu Jan 11 17:05:57 EST 2007