1f2ced752SOliver Tappe// The template and inlines for the -*- C++ -*- slice class.
2f2ced752SOliver Tappe
3f2ced752SOliver Tappe// Copyright (C) 1997-1999 Cygnus Solutions
4f2ced752SOliver Tappe//
5f2ced752SOliver Tappe// This file is part of the GNU ISO C++ Library.  This library is free
6f2ced752SOliver Tappe// software; you can redistribute it and/or modify it under the
7f2ced752SOliver Tappe// terms of the GNU General Public License as published by the
8f2ced752SOliver Tappe// Free Software Foundation; either version 2, or (at your option)
9f2ced752SOliver Tappe// any later version.
10f2ced752SOliver Tappe
11f2ced752SOliver Tappe// This library is distributed in the hope that it will be useful,
12f2ced752SOliver Tappe// but WITHOUT ANY WARRANTY; without even the implied warranty of
14f2ced752SOliver Tappe// GNU General Public License for more details.
15f2ced752SOliver Tappe
16f2ced752SOliver Tappe// You should have received a copy of the GNU General Public License along
17f2ced752SOliver Tappe// with this library; see the file COPYING.  If not, write to the Free
18f2ced752SOliver Tappe// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19f2ced752SOliver Tappe// USA.
20f2ced752SOliver Tappe
21f2ced752SOliver Tappe// As a special exception, you may use this file as part of a free software
22f2ced752SOliver Tappe// library without restriction.  Specifically, if other files instantiate
23f2ced752SOliver Tappe// templates or use macros or inline functions from this file, or you compile
24f2ced752SOliver Tappe// this file and link it with other files to produce an executable, this
25f2ced752SOliver Tappe// file does not by itself cause the resulting executable to be covered by
26f2ced752SOliver Tappe// the GNU General Public License.  This exception does not however
27f2ced752SOliver Tappe// invalidate any other reasons why the executable file might be covered by
28f2ced752SOliver Tappe// the GNU General Public License.
29f2ced752SOliver Tappe
30f2ced752SOliver Tappe// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
31f2ced752SOliver Tappe
32f2ced752SOliver Tappe#ifndef __SLICE__
33f2ced752SOliver Tappe#define __SLICE__
34f2ced752SOliver Tappe
35f2ced752SOliver Tappeextern "C++" {
36f2ced752SOliver Tappe
37f2ced752SOliver Tappeclass slice
38f2ced752SOliver Tappe{
39f2ced752SOliver Tappepublic:
40f2ced752SOliver Tappe    slice ();
41f2ced752SOliver Tappe    slice (size_t, size_t, size_t);
42f2ced752SOliver Tappe
43f2ced752SOliver Tappe    size_t start () const;
44f2ced752SOliver Tappe    size_t size () const;
45f2ced752SOliver Tappe    size_t stride () const;
46f2ced752SOliver Tappe
47f2ced752SOliver Tappeprivate:
48f2ced752SOliver Tappe    size_t _M_off;                      // offset
49f2ced752SOliver Tappe    size_t _M_sz;			// size
50f2ced752SOliver Tappe    size_t _M_st;			// stride unit
51f2ced752SOliver Tappe};
52f2ced752SOliver Tappe
53f2ced752SOliver Tappeinline slice::slice () {}
54f2ced752SOliver Tappe
55f2ced752SOliver Tappeinline slice::slice (size_t __o, size_t __d, size_t __s)
56f2ced752SOliver Tappe        : _M_off (__o), _M_sz (__d), _M_st (__s) {}
57f2ced752SOliver Tappe
58f2ced752SOliver Tappeinline size_t
59f2ced752SOliver Tappeslice::start () const
60f2ced752SOliver Tappe  { return _M_off; }
61f2ced752SOliver Tappe
62f2ced752SOliver Tappeinline size_t
63f2ced752SOliver Tappeslice::size () const
64f2ced752SOliver Tappe  { return _M_sz; }
65f2ced752SOliver Tappe
66f2ced752SOliver Tappeinline size_t
67f2ced752SOliver Tappeslice::stride () const
68f2ced752SOliver Tappe  { return _M_st; }
69f2ced752SOliver Tappe
70f2ced752SOliver Tappe} // extern "C++"
71f2ced752SOliver Tappe
72f2ced752SOliver Tappe#endif // __SLICE__
73f2ced752SOliver Tappe
74f2ced752SOliver Tappe// Local Variables:
75f2ced752SOliver Tappe// mode:c++
76f2ced752SOliver Tappe// End: