X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FSamReadGroup.h;h=538617d972d0e66928867b0506b2ae8dcd91a624;hb=8c80d760637f8df39262683cd2570f0589423d36;hp=c53274af8aa667cf6607a924a745bdeaba502b7e;hpb=577b6032aa3d85616047c8aba6061dd8dad20cfc;p=bamtools.git diff --git a/src/api/SamReadGroup.h b/src/api/SamReadGroup.h index c53274a..538617d 100644 --- a/src/api/SamReadGroup.h +++ b/src/api/SamReadGroup.h @@ -3,10 +3,10 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 23 December 2010 (DB) +// Last modified: 4 March 2011 (DB) // --------------------------------------------------------------------------- -// Provides functionality for querying/manipulating read group data -// ************************************************************************** +// Provides direct read/write access to the SAM read group data fields. +// *************************************************************************** #ifndef SAM_READGROUP_H #define SAM_READGROUP_H @@ -16,50 +16,44 @@ namespace BamTools { -class API_EXPORT SamReadGroup { +struct API_EXPORT SamReadGroup { // ctor & dtor - public: - SamReadGroup(void); - SamReadGroup(const std::string& id); - SamReadGroup(const SamReadGroup& other); - ~SamReadGroup(void); - - // public methods - public: - - // clear all contents - void Clear(void); - - // convenience methods to check if SamReadGroup contains these values: - bool HasID(void) const; - bool HasSample(void) const; - bool HasLibrary(void) const; - bool HasDescription(void) const; - bool HasPlatformUnit(void) const; - bool HasPredictedInsertSize(void) const; - bool HasSequencingCenter(void) const; - bool HasProductionDate(void) const; - bool HasSequencingTechnology(void) const; + SamReadGroup(void); + SamReadGroup(const std::string& id); + SamReadGroup(const SamReadGroup& other); + ~SamReadGroup(void); + + // query/modify entire read group + void Clear(void); // clears all data fields + + // convenience query methods + bool HasID(void) const; // returns true if read group has a group ID + bool HasSample(void) const; // returns true if read group has a sample name + bool HasLibrary(void) const; // returns true if read group has a library name + bool HasDescription(void) const; // returns true if read group has a description + bool HasPlatformUnit(void) const; // returns true if read group has a platform unit ID + bool HasPredictedInsertSize(void) const; // returns true if read group has a predicted insert size + bool HasSequencingCenter(void) const; // returns true if read group has a sequencing center ID + bool HasProductionDate(void) const; // returns true if read group has a production date + bool HasSequencingTechnology(void) const; // returns true if read group has a sequencing technology ID // data members - public: - std::string ID; // ID: - std::string Sample; // SM: - std::string Library; // LB: - std::string Description; // DS: - std::string PlatformUnit; // PU: - std::string PredictedInsertSize; // PI: - std::string SequencingCenter; // CN: - std::string ProductionDate; // DT: - std::string SequencingTechnology; // PL: + std::string ID; // ID: + std::string Sample; // SM: + std::string Library; // LB: + std::string Description; // DS: + std::string PlatformUnit; // PU: + std::string PredictedInsertSize; // PI: + std::string SequencingCenter; // CN: + std::string ProductionDate; // DT: + std::string SequencingTechnology; // PL: }; -// --------------------------------------------------- -// comparison operators - -// for equality: compare IDs -inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) { +/*! \fn bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) + \brief tests equality by comparing read group IDs +*/ +API_EXPORT inline bool operator==(const SamReadGroup& lhs, const SamReadGroup& rhs) { return lhs.ID == rhs.ID; }