source:
git/factory/include/factory/templates/ftmpl_array.h
@
362fc67
Last change on this file since 362fc67 was 362fc67, checked in by , 11 years ago | |
---|---|
|
|
File size: 923 bytes |
Rev | Line | |
---|---|---|
[6ab5981] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
[684544] | 2 | |
3 | #ifndef INCL_ARRAY_H | |
4 | #define INCL_ARRAY_H | |
5 | ||
[e4fe2b] | 6 | // #include <factory/factoryconf.h> |
[8c0163] | 7 | |
[175e355] | 8 | #ifndef NOSTREAMIO |
[1dc616] | 9 | #ifdef HAVE_IOSTREAM |
10 | #include <iostream> | |
[181148] | 11 | #define OSTREAM std::ostream |
[1dc616] | 12 | #elif defined(HAVE_IOSTREAM_H) |
[684544] | 13 | #include <iostream.h> |
[181148] | 14 | #define OSTREAM ostream |
[1dc616] | 15 | #endif |
[175e355] | 16 | #endif /* NOSTREAMIO */ |
[684544] | 17 | |
18 | template <class T> | |
19 | class Array { | |
20 | private: | |
21 | T * data; | |
22 | int _min; | |
23 | int _max; | |
24 | int _size; | |
25 | public: | |
26 | Array(); | |
27 | Array( const Array<T>& ); | |
28 | Array( int size ); | |
29 | Array( int min, int max ); | |
30 | ~Array(); | |
31 | Array<T>& operator= ( const Array<T>& ); | |
32 | T& operator[] ( int i ) const; | |
33 | int size() const; | |
34 | int min() const; | |
35 | int max() const; | |
[175e355] | 36 | #ifndef NOSTREAMIO |
[181148] | 37 | void print ( OSTREAM& ) const; |
[175e355] | 38 | #endif /* NOSTREAMIO */ |
[684544] | 39 | }; |
40 | ||
[175e355] | 41 | #ifndef NOSTREAMIO |
[684544] | 42 | template <class T> |
[181148] | 43 | OSTREAM& operator<< ( OSTREAM & os, const Array<T> & a ); |
[175e355] | 44 | #endif /* NOSTREAMIO */ |
[684544] | 45 | |
[6ab5981] | 46 | #endif /* ! INCL_ARRAY_H */ |
Note: See TracBrowser
for help on using the repository browser.