Yurttas/PL/OOL/Cplusplus/F/05/10/11/P.h

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 2005
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : September 1, 2005.
11   author : Salih Yurttas.
12
13   P.h
14*/
15
16
17#ifndef P_H
18#define P_H
19
20#include <vector>
21
22using namespace std;
23
24template<class T>
25class P {
26public:
27  P();
28
29  P(const P<T>&);
30
31  virtual P<T>& operator=(const P<T>&);
32
33  virtual vector<T> get_a() const;
34
35  virtual void set_a(const int,  // index
36                     const T);   // value
37
38  virtual void set_a(const vector<T>&);
39
40  virtual void output() const;
41
42protected:
43  vector<T> a;
44};
45#endif