Yurttas/PL/OOL/Cplusplus/F/05/10/01/Q.cpp

 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   Q.cpp
14*/
15
16
17#include "N.h"
18
19using namespace N;
20
21template<class T>
22Q<T>::
23Q() : P<T>(),
24      b(8) {
25}
26
27template<class T>
28Q<T>::
29Q(const Q<T>& o) : b(o.b) {
30  P<T>::a = o.a;
31}
32
33template<class T>
34Q<T>&
35Q<T>::
36operator=(const Q<T>& o) {
37  if(this==&o) return *this;
38
39  P<T>::a = o.a;
40  b = o.b;
41
42  return *this;
43}
44
45template<class T>
46T
47Q<T>::
48get_a(const int i) const {
49  return P<T>::a.at(i);
50}
51
52template<class T>
53T
54Q<T>::
55get_b()const {
56  return b;
57}
58
59template<class T>
60void
61Q<T>::
62output() const {
63  cout << endl;
64  cout << b << endl;
65
66  int n = P<T>::a.size();
67
68  for(int i=0; i<n; ++i)
69    cout << P<T>::a.at(i) << endl;
70}