Yurttas/PL/OOL/Cplusplus/F/02/06/06/A.h

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 2004
 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   : January 1, 2004.
11   author : Salih Yurttas.
12
13   A.h
14*/
15
16
17#ifndef A_H
18#define A_H
19
20#include <iostream>
21#include <vector>
22#include <stdexcept>
23
24using namespace std;
25
26class A {
27public:
28  A();
29
30  A(const A&);
31
32  A& operator=(const A&);
33
34  int get_first_data_a() const;
35  int get_last_data_a() const;
36  int get_any_data_a(const int) const;
37
38  int get_first_data_b() const;
39  int get_last_data_b() const;
40  int get_any_data_b(const int) const;
41
42  void set_first_data_a(const int);
43  void set_last_data_a(const int);
44
45  void set_all_data_a(const int);
46  void set_all_data_a(const vector<int>&);
47
48  void set_any_data_a(const int,
49                      const int);
50
51  void set_first_data_b(const int);
52  void set_last_data_b(const int);
53
54  void set_all_data_b(const int);
55  void set_all_data_b(const vector<int>&);
56
57  void set_any_data_b(const int,
58                      const int);
59
60  A& operator+=(const A&);
61
62  friend A operator+(const A&,
63                     const A&);
64
65  friend ostream& operator<<(ostream&,
66                             const A&);
67
68private:
69  vector<int> data_a;
70  vector<int> data_b;
71};
72#endif