source: git/factory/include/factory/templates/ftmpl_array.h @ b1d287

spielwiese
Last change on this file since b1d287 was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 923 bytes
RevLine 
[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
18template <class T>
19class Array {
20private:
21    T * data;
22    int _min;
23    int _max;
24    int _size;
25public:
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]42template <class T>
[181148]43OSTREAM& 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.