]> git.donarmstrong.com Git - bamtools.git/commitdiff
Added explicit copy ctors to SamHeader data structures
authorderek <derekwbarnett@gmail.com>
Wed, 12 Jan 2011 03:35:09 +0000 (22:35 -0500)
committerderek <derekwbarnett@gmail.com>
Wed, 12 Jan 2011 03:35:09 +0000 (22:35 -0500)
src/api/SamHeader.cpp
src/api/SamHeader.h
src/api/SamReadGroup.cpp
src/api/SamReadGroup.h
src/api/SamReadGroupDictionary.cpp
src/api/SamReadGroupDictionary.h
src/api/SamSequence.cpp
src/api/SamSequence.h
src/api/SamSequenceDictionary.cpp
src/api/SamSequenceDictionary.h

index 405033fa740dff49dea0b14d92c2e150c6c61cbc..74381f0967df4e4181a0919835b512cd0f09d723 100644 (file)
@@ -16,6 +16,7 @@ using namespace BamTools;
 using namespace BamTools::Internal;
 using namespace std;
 
+// ctor
 SamHeader::SamHeader(const string& headerText)
     : Version("")
     , SortOrder("")
@@ -28,6 +29,19 @@ SamHeader::SamHeader(const string& headerText)
     parser.Parse(headerText);
 }
 
+// copy ctor
+SamHeader::SamHeader(const SamHeader& other)
+    : Version(other.Version)
+    , SortOrder(other.SortOrder)
+    , GroupOrder(other.GroupOrder)
+    , Sequences(other.Sequences)
+    , ReadGroups(other.ReadGroups)
+    , ProgramName(other.ProgramName)
+    , ProgramVersion(other.ProgramVersion)
+    , ProgramCommandLine(other.ProgramCommandLine)
+{ }
+
+// dtor
 SamHeader::~SamHeader(void) {
     Clear();
 }
index b51f1750d1beb55c77aeed552a39a19407d607da..add44181b213caae536f19fa408b4b1e3efbec88 100644 (file)
@@ -24,6 +24,7 @@ struct API_EXPORT SamHeader {
     // ctor & dtor
     public:
         explicit SamHeader(const std::string& headerText = "");
+        explicit SamHeader(const SamHeader& other);
         ~SamHeader(void);
 
     // query/modify entire SamHeader at once
index 96c8e4e92eac232927d37a964ae1be752eee1646..8debc58c7a3f70024aec903ec2ab8295681535d5 100644 (file)
@@ -38,6 +38,19 @@ SamReadGroup::SamReadGroup(const string& id)
     , SequencingTechnology("")
 { }
 
+// copy ctor
+SamReadGroup::SamReadGroup(const SamReadGroup& other)
+    : ID(other.ID)
+    , Sample(other.Sample)
+    , Library(other.Library)
+    , Description(other.Description)
+    , PlatformUnit(other.PlatformUnit)
+    , PredictedInsertSize(other.PredictedInsertSize)
+    , SequencingCenter(other.SequencingCenter)
+    , ProductionDate(other.ProductionDate)
+    , SequencingTechnology(other.SequencingTechnology)
+{ }
+
 // dtor
 SamReadGroup::~SamReadGroup(void) {
     Clear();
index fac46123d5f2e47a8472eb0ecca5993d307a945d..14498af5fed9dd4a7f7148788dd26bab56f0e252 100644 (file)
@@ -22,6 +22,7 @@ class API_EXPORT SamReadGroup {
     public:
         SamReadGroup(void);
         SamReadGroup(const std::string& id);
+        explicit SamReadGroup(const SamReadGroup& other);
         ~SamReadGroup(void);
 
     // public methods
index fb03facecdad094b83a2488623b080a795de2a82..2f0534efa9c68f52b0fc749461566d3694e6c9d0 100644 (file)
@@ -18,6 +18,11 @@ using namespace std;
 // ctor
 SamReadGroupDictionary::SamReadGroupDictionary(void) { }
 
+// copy ctor
+SamReadGroupDictionary::SamReadGroupDictionary(const SamReadGroupDictionary& other)
+    : m_data(other.m_data)
+{ }
+
 // dtor
 SamReadGroupDictionary::~SamReadGroupDictionary(void) {
     m_data.clear();
index d21ccf80b4ef0efaa64c9405640b15ec7e02f582..5179b267a2ff57e70e52b7713e088fa735a70408 100644 (file)
@@ -29,6 +29,7 @@ class API_EXPORT SamReadGroupDictionary {
     // ctor & dtor
     public:
         SamReadGroupDictionary(void);
+        explicit SamReadGroupDictionary(const SamReadGroupDictionary& other);
         ~SamReadGroupDictionary(void);
 
     // query/modify read group data
index 055460436e068b34ad2a51a37a44148600038286..e323f7ac4c90335f48b37d7424fa7bbf29fcaa23 100644 (file)
@@ -22,6 +22,16 @@ SamSequence::SamSequence(const string& name)
     , Species("")
 { }
 
+// copy ctor
+SamSequence::SamSequence(const SamSequence& other)
+    : Name(other.Name)
+    , Length(other.Length)
+    , AssemblyID(other.AssemblyID)
+    , Checksum(other.Checksum)
+    , URI(other.URI)
+    , Species(other.Species)
+{ }
+
 // dtor
 SamSequence::~SamSequence(void) {
     Clear();
index db6891df23b230a4a2d831d2377f40e27e2e46aa..97cdb96d04cec567a09015f95c106f0dab80c267 100644 (file)
@@ -21,6 +21,7 @@ class API_EXPORT SamSequence {
     // ctor & dtor
     public:
         SamSequence(const std::string& name = "");
+        explicit SamSequence(const SamSequence& other);
         ~SamSequence(void);
 
     // public methods
index c023a39d21e313970c5d5113215b0db3eb2fca1f..2f9bf2866f6eacfa8d1c102a8cd0b146960ebb1a 100644 (file)
@@ -1,3 +1,13 @@
+// ***************************************************************************
+// SamSequenceDictionary.cpp (c) 2010 Derek Barnett
+// Marth Lab, Department of Biology, Boston College
+// All rights reserved.
+// ---------------------------------------------------------------------------
+// Last modified: 23 December 2010 (DB)
+// ---------------------------------------------------------------------------
+// Provides container operations for collection of sequence entries
+// *************************************************************************
+
 #include <api/SamSequenceDictionary.h>
 using namespace BamTools;
 
@@ -7,6 +17,11 @@ using namespace std;
 // ctor
 SamSequenceDictionary::SamSequenceDictionary(void) { }
 
+// copy ctor
+SamSequenceDictionary::SamSequenceDictionary(const SamSequenceDictionary& other)
+    : m_data(other.m_data)
+{ }
+
 // dtor
 SamSequenceDictionary::~SamSequenceDictionary(void) {
     m_data.clear();
index bcd165201acb1e6b3a9592b007154d1abf9916ac..37ac824ef63de30102b1ca208513cea27be004c3 100644 (file)
@@ -27,6 +27,7 @@ class API_EXPORT SamSequenceDictionary {
     // ctor & dtor
     public:
         SamSequenceDictionary(void);
+        explicit SamSequenceDictionary(const SamSequenceDictionary& other);
         ~SamSequenceDictionary(void);
 
     // query/modify sequence data