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

spielwiese
Last change on this file was 3edea1, checked in by Hans Schoenemann <hannes@…>, 3 years ago
cygwin port: shared lib libfactory
  • Property mode set to 100644
File size: 901 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
[175e355]6#ifndef NOSTREAMIO
[1dc616]7#ifdef HAVE_IOSTREAM
8#include <iostream>
[181148]9#define OSTREAM std::ostream
[1dc616]10#elif defined(HAVE_IOSTREAM_H)
[684544]11#include <iostream.h>
[181148]12#define OSTREAM ostream
[1dc616]13#endif
[175e355]14#endif /* NOSTREAMIO */
[684544]15
16template <class T>
[3edea1]17class FACTORY_PUBLIC Array {
[684544]18private:
19    T * data;
20    int _min;
21    int _max;
22    int _size;
23public:
24    Array();
25    Array( const Array<T>& );
26    Array( int size );
27    Array( int min, int max );
28    ~Array();
29    Array<T>& operator= ( const Array<T>& );
30    T& operator[] ( int i ) const;
31    int size() const;
32    int min() const;
33    int max() const;
[175e355]34#ifndef NOSTREAMIO
[181148]35    void print ( OSTREAM& ) const;
[175e355]36#endif /* NOSTREAMIO */
[684544]37};
38
[175e355]39#ifndef NOSTREAMIO
[684544]40template <class T>
[181148]41OSTREAM& operator<< ( OSTREAM & os, const Array<T> & a );
[175e355]42#endif /* NOSTREAMIO */
[684544]43
[6ab5981]44#endif /* ! INCL_ARRAY_H */
Note: See TracBrowser for help on using the repository browser.