Yurttas/PL/OOL/Cplusplus/F/03/01/02/00/E.h

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 1998
 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, 1998.
11   author : Salih Yurttas.
12
13   E.h
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21class E {
22public:
23  E(const int a=2,                // default constructor with default values
24    const int b=1);
25
26  E(const E&);                    // copy constructor
27
28  E& operator=(const E&);         // assignment operator overloaded
29
30  ~E();                           // destructor
31
32  int get_s() const;              // accessor for s
33
34  int* get_d() const;             // accessor for d
35
36  void set_d(const int);          // mutator for d by an int
37
38  void set_d(const int,
39             const int);          // mutator for d by distinct ints
40
41  void set_d(const int*);         // mutator for d by aggregate of ints
42
43  friend ostream& operator<<(ostream&,
44                             const E&); // E type output
45
46protected:
47  int s;
48  int* d;
49};