source: git/factory/templates/ftmpl_array.h @ b1dfaf

spielwiese
Last change on this file since b1dfaf was b1dfaf, checked in by Frank Seelisch <seelisch@…>, 14 years ago
patch from Kai (checked for problems under Windows OS: no problems) git-svn-id: file:///usr/local/Singular/svn/trunk@13210 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 931 bytes
RevLine 
[6ab5981]1/* emacs edit mode for this file is -*- C++ -*- */
[341696]2/* $Id$ */
[684544]3
4#ifndef INCL_ARRAY_H
5#define INCL_ARRAY_H
6
[b1dfaf]7#include <factory/factoryconf.h>
[8c0163]8
[175e355]9#ifndef NOSTREAMIO
[1dc616]10#ifdef HAVE_IOSTREAM
11#include <iostream>
[181148]12#define OSTREAM std::ostream
[1dc616]13#elif defined(HAVE_IOSTREAM_H)
[684544]14#include <iostream.h>
[181148]15#define OSTREAM ostream
[1dc616]16#endif
[175e355]17#endif /* NOSTREAMIO */
[684544]18
19template <class T>
20class Array {
21private:
22    T * data;
23    int _min;
24    int _max;
25    int _size;
26public:
27    Array();
28    Array( const Array<T>& );
29    Array( int size );
30    Array( int min, int max );
31    ~Array();
32    Array<T>& operator= ( const Array<T>& );
33    T& operator[] ( int i ) const;
34    int size() const;
35    int min() const;
36    int max() const;
[175e355]37#ifndef NOSTREAMIO
[181148]38    void print ( OSTREAM& ) const;
[175e355]39#endif /* NOSTREAMIO */
[684544]40};
41
[175e355]42#ifndef NOSTREAMIO
[684544]43template <class T>
[181148]44OSTREAM& operator<< ( OSTREAM & os, const Array<T> & a );
[175e355]45#endif /* NOSTREAMIO */
[684544]46
[6ab5981]47#endif /* ! INCL_ARRAY_H */
Note: See TracBrowser for help on using the repository browser.