PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
References.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #include "PlusConfigure.h"
8 
9 #include "References.h"
10 
11 //-----------------------------------------------------------------------------
12 
14 {
15 }
16 
17 //-----------------------------------------------------------------------------
18 
20 {
21 }
22 
23 //-----------------------------------------------------------------------------
24 
26 {
27  this->m_ReferenceList.clear();
28 }
29 
30 //-----------------------------------------------------------------------------
31 
32 void References::InsertReference(const Reference& newReference)
33 {
34  Reference copy = newReference;
35  this->m_ReferenceList.push_back(copy);
36 }
37 
38 //-----------------------------------------------------------------------------
39 
41 {
42  std::vector<Reference>::iterator it = this->m_ReferenceList.begin();
43  it += index;
44  this->m_ReferenceList.erase(it);
45 }
46 
47 //-----------------------------------------------------------------------------
48 
50 {
51  return this->m_ReferenceList.at(index);
52 }
53 
54 //-----------------------------------------------------------------------------
55 
57 {
58  return this->m_ReferenceList.size();
59 }
60 
61 //-----------------------------------------------------------------------------
62 
63 std::vector<Reference>::const_iterator References::ReferencesBegin() const
64 {
65  return this->m_ReferenceList.begin();
66 }
67 
68 //-----------------------------------------------------------------------------
69 
70 std::vector<Reference>::const_iterator References::ReferencesEnd() const
71 {
72  return this->m_ReferenceList.end();
73 }
74 
75 //-----------------------------------------------------------------------------
76 
78 {
79  if (this != &rhs)
80  {
81  this->m_ReferenceList.clear();
82  this->m_ReferenceList.resize(rhs.m_ReferenceList.size());
83  std::copy(rhs.ReferencesBegin(), rhs.ReferencesEnd(), this->m_ReferenceList.begin());
84  }
85  return *this;
86 }
std::vector< Reference >::const_iterator ReferencesEnd() const
Definition: References.cxx:70
const Reference & GetReference(int index)
Definition: References.cxx:49
References & operator=(const References &rhs)
Definition: References.cxx:77
void Reset()
Definition: References.cxx:25
void InsertReference(const Reference &newReference)
Definition: References.cxx:32
void RemoveReference(int index)
Definition: References.cxx:40
std::vector< Reference > m_ReferenceList
Definition: References.h:31
std::vector< Reference >::const_iterator ReferencesBegin() const
Definition: References.cxx:63
int GetNumberOfReferences()
Definition: References.cxx:56