Resolve/C++ Catalog
CT/Queue/Kernel_C.h
Copyright © 2010, Reusable Software Research Group, The Ohio State University

//  /*-------------------------------------------------------------------*\
//  |   Concrete Template : Queue_Kernel_C
//  \*-------------------------------------------------------------------*/

#ifndef CT_QUEUE_KERNEL_C
#define CT_QUEUE_KERNEL_C 1

///---------------------------------------------------------------------
/// Global Context -----------------------------------------------------
///---------------------------------------------------------------------

/*!
    #include "AT/Queue/Kernel.h"
!*/

///---------------------------------------------------------------------
/// Interface ----------------------------------------------------------
///---------------------------------------------------------------------

concrete_template <
	concrete_instance class Item,
	concrete_instance class Queue_Base
	/*!
	    implements
		abstract_instance Queue_Kernel <Item>
	!*/
    >
class Queue_Kernel_C :
    checks
	concrete_instance Queue_Base
{
public:
    
    procedure_body Dequeue (
            produces Item& x
	)
    {
	assert (self.Length () > 0,
		"self /= empty_string");
	self.Queue_Base::Dequeue (x);
    }  

    function_body Item& operator [] (
	    preserves Accessor_Position& current
	)	
    {
	assert (self.Length () > 0,
		"self /= empty_string");
	return self.Queue_Base::operator [] (current);
    }

};

//----------------------------------------------------------------------

#endif // CT_QUEUE_KERNEL_C

Last modified: Thu Jan 11 17:05:57 EST 2007