Yurttas/PL/OOL/Cplusplus/F/05/01/03/00/I V.cpp

From ZCubes Wiki
Revision as of 22:42, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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   I_V.cpp
14*/
15
16
17#include "I_V.h"
18
19I_V::
20I_V() {
21}
22
23I_V::
24I_V(const I_V& o) : d(o.d) {
25}
26
27I_V&
28I_V::
29operator=(const I_V& o) {
30  if(this==&o) return *this;
31
32  d = o.d;
33
34  return *this;
35}
36
37int
38I_V::
39get_size() const {
40  return d.size();
41}
42
43int
44I_V::
45get_d(const int index) const {
46  return d.at(index);
47}
48
49vector<int>
50I_V::
51get_d() const {
52  return d;
53}
54
55void
56I_V::
57set_d(const int size) {
58  vector<int> t(size);
59  d = t;
60}
61
62void
63I_V::
64set_d(const int index,
65      const int value) {
66  d.at(index) = value;
67}
68
69ostream& operator<<(ostream& os,
70                    const I_V& o) {
71  int n = o.d.size();
72  for(int i=0; i<n; i++)
73    os << o.d.at(i) << endl;
74
75  return os;
76}