From e24bc523b0bd086dbfad7165901b2237b5d64316 Mon Sep 17 00:00:00 2001 From: derek Date: Fri, 19 Nov 2010 11:01:58 -0500 Subject: [PATCH] Added API_EXPORT macro to classes in BamTools API --- src/api/BGZF.cpp | 10 +++++----- src/api/BGZF.h | 8 +++++--- src/api/BamAlignment.cpp | 9 +++++---- src/api/BamAlignment.h | 7 ++++--- src/api/BamAux.h | 10 ++++++---- src/api/BamIndex.cpp | 11 ++++++----- src/api/BamIndex.h | 5 +++-- src/api/BamMultiReader.cpp | 9 +++++---- src/api/BamMultiReader.h | 11 ++++++----- src/api/BamReader.cpp | 12 ++++++------ src/api/BamReader.h | 9 +++++---- src/api/BamWriter.cpp | 10 +++++----- src/api/BamWriter.h | 7 ++++--- src/api/CMakeLists.txt | 2 +- 14 files changed, 66 insertions(+), 54 deletions(-) diff --git a/src/api/BGZF.cpp b/src/api/BGZF.cpp index 2b74343..701fa7f 100644 --- a/src/api/BGZF.cpp +++ b/src/api/BGZF.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 16 August 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -11,11 +11,11 @@ // Provides the basic functionality for reading & writing BGZF files // *************************************************************************** -#include -#include "BGZF.h" +#include using namespace BamTools; -using std::string; -using std::min; + +#include +using namespace std; BgzfData::BgzfData(void) : UncompressedBlockSize(DEFAULT_BLOCK_SIZE) diff --git a/src/api/BGZF.h b/src/api/BGZF.h index c1ff2f8..0ee0286 100644 --- a/src/api/BGZF.h +++ b/src/api/BGZF.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 20 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -14,11 +14,13 @@ #ifndef BGZF_H #define BGZF_H +#include +#include "zlib.h" + #include #include #include #include -#include "zlib.h" // Platform-specific large-file support #ifndef BAMTOOLS_LFS @@ -70,7 +72,7 @@ const int BLOCK_FOOTER_LENGTH = 8; const int MAX_BLOCK_SIZE = 65536; const int DEFAULT_BLOCK_SIZE = 65536; -struct BgzfData { +struct API_EXPORT BgzfData { // data members public: diff --git a/src/api/BamAlignment.cpp b/src/api/BamAlignment.cpp index c396338..b0986df 100644 --- a/src/api/BamAlignment.cpp +++ b/src/api/BamAlignment.cpp @@ -3,11 +3,14 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 19 September 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Provides the BamAlignment data structure // *************************************************************************** +#include +using namespace BamTools; + #include #include #include @@ -15,8 +18,6 @@ #include #include #include -#include "BamAlignment.h" -using namespace BamTools; using namespace std; // default ctor @@ -684,4 +685,4 @@ bool BamAlignment::SkipToNextTag(const char storageType, char* &pTagData, unsign // return success return true; -} \ No newline at end of file +} diff --git a/src/api/BamAlignment.h b/src/api/BamAlignment.h index cbf13d5..f313073 100644 --- a/src/api/BamAlignment.h +++ b/src/api/BamAlignment.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 9 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Provides the BamAlignment data structure // *************************************************************************** @@ -11,15 +11,16 @@ #ifndef BAMALIGNMENT_H #define BAMALIGNMENT_H +#include +#include #include #include -#include "BamAux.h" namespace BamTools { // BamAlignment data structure // explicitly labeled as 'struct' to indicate that (most of) its fields are public -struct BamAlignment { +struct API_EXPORT BamAlignment { // constructors & destructor public: diff --git a/src/api/BamAux.h b/src/api/BamAux.h index 7bdc6c2..cd91284 100644 --- a/src/api/BamAux.h +++ b/src/api/BamAux.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 9 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Provides the basic constants, data structures, utilities etc. // used throughout the API for handling BAM files @@ -12,6 +12,8 @@ #ifndef BAMAUX_H #define BAMAUX_H +#include + #include #include #include @@ -69,7 +71,7 @@ const int BT_SIZEOF_INT = 4; // Data structs & typedefs // CIGAR operation data structure -struct CigarOp { +struct API_EXPORT CigarOp { // data members char Type; // Operation type (MIDNSHP) @@ -84,7 +86,7 @@ struct CigarOp { }; // Reference data entry -struct RefData { +struct API_EXPORT RefData { // data members std::string RefName; // Name of reference sequence @@ -101,7 +103,7 @@ struct RefData { typedef std::vector RefVector; // General (sequential) genome region -struct BamRegion { +struct API_EXPORT BamRegion { // data members int LeftRefID; diff --git a/src/api/BamIndex.cpp b/src/api/BamIndex.cpp index e72db5f..ae5a463 100644 --- a/src/api/BamIndex.cpp +++ b/src/api/BamIndex.cpp @@ -3,23 +3,24 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 21 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Provides index functionality - both for the default (standardized) BAM // index format (.bai) as well as a BamTools-specific (nonstandard) index // format (.bti). // *************************************************************************** +#include +#include +#include +using namespace BamTools; + #include #include #include #include #include -#include "BamIndex.h" -#include "BamReader.h" -#include "BGZF.h" using namespace std; -using namespace BamTools; // ------------------------------- // BamIndex implementation diff --git a/src/api/BamIndex.h b/src/api/BamIndex.h index 89e9d2b..d8447fa 100644 --- a/src/api/BamIndex.h +++ b/src/api/BamIndex.h @@ -12,10 +12,11 @@ #ifndef BAM_INDEX_H #define BAM_INDEX_H +#include +#include #include #include #include -#include "BamAux.h" namespace BamTools { @@ -24,7 +25,7 @@ class BgzfData; // -------------------------------------------------- // BamIndex base class -class BamIndex { +class API_EXPORT BamIndex { // specify index-caching behavior // diff --git a/src/api/BamMultiReader.cpp b/src/api/BamMultiReader.cpp index ef5eeb4..3331c09 100644 --- a/src/api/BamMultiReader.cpp +++ b/src/api/BamMultiReader.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 18 September 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -16,6 +16,10 @@ // precludes the need to sort merged files. // *************************************************************************** +#include +#include +using namespace BamTools; + #include #include #include @@ -23,9 +27,6 @@ #include #include #include -#include "BGZF.h" -#include "BamMultiReader.h" -using namespace BamTools; using namespace std; // ----------------------------------------------------- diff --git a/src/api/BamMultiReader.h b/src/api/BamMultiReader.h index fa28bcd..d30a0d3 100644 --- a/src/api/BamMultiReader.h +++ b/src/api/BamMultiReader.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 18 September 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Functionality for simultaneously reading multiple BAM files // *************************************************************************** @@ -11,18 +11,19 @@ #ifndef BAMMULTIREADER_H #define BAMMULTIREADER_H -#include +#include +#include #include -#include #include -#include "BamReader.h" +#include +#include namespace BamTools { // index mapping reference/position pairings to bamreaders and their alignments typedef std::multimap, std::pair > AlignmentIndex; -class BamMultiReader { +class API_EXPORT BamMultiReader { // constructor / destructor public: diff --git a/src/api/BamReader.cpp b/src/api/BamReader.cpp index d7476db..f05b121 100644 --- a/src/api/BamReader.cpp +++ b/src/api/BamReader.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 13 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -11,15 +11,15 @@ // Provides the basic functionality for reading BAM files // *************************************************************************** -// C++ includes +#include +#include +using namespace BamTools; + #include +#include #include #include #include -#include -#include "BGZF.h" -#include "BamReader.h" -using namespace BamTools; using namespace std; struct BamReader::BamReaderPrivate { diff --git a/src/api/BamReader.h b/src/api/BamReader.h index 1160bd5..120a9bb 100644 --- a/src/api/BamReader.h +++ b/src/api/BamReader.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 13 October 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -14,13 +14,14 @@ #ifndef BAMREADER_H #define BAMREADER_H +#include +#include +#include #include -#include "BamAlignment.h" -#include "BamIndex.h" namespace BamTools { -class BamReader { +class API_EXPORT BamReader { // constructor / destructor public: diff --git a/src/api/BamWriter.cpp b/src/api/BamWriter.cpp index f5eeb20..6e5c792 100644 --- a/src/api/BamWriter.cpp +++ b/src/api/BamWriter.cpp @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 16 September 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -11,11 +11,11 @@ // Provides the basic functionality for producing BAM files // *************************************************************************** -#include - -#include "BGZF.h" -#include "BamWriter.h" +#include +#include using namespace BamTools; + +#include using namespace std; struct BamWriter::BamWriterPrivate { diff --git a/src/api/BamWriter.h b/src/api/BamWriter.h index 106e3e9..910f9be 100644 --- a/src/api/BamWriter.h +++ b/src/api/BamWriter.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 18 September 2010 (DB) +// Last modified: 19 November 2010 (DB) // --------------------------------------------------------------------------- // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad // Institute. @@ -14,12 +14,13 @@ #ifndef BAMWRITER_H #define BAMWRITER_H +#include +#include #include -#include "BamAlignment.h" namespace BamTools { -class BamWriter { +class API_EXPORT BamWriter { // constructor/destructor public: diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 8445603..5d9d592 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -6,7 +6,7 @@ # ========================== # list include paths -include_directories ( ${BamTools_SOURCE_DIR}/src/shared ) +include_directories ( ${BamTools_SOURCE_DIR}/src ) # add compiler definitions add_definitions(-DBAMTOOLS_API_LIBRARY) # (for proper exporting of library symbols) -- 2.39.2