ngs_server 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +2 -0
  4. data/bin/ngs_server +58 -0
  5. data/data/holder.txt +0 -0
  6. data/ext/bamtools/CMakeLists.txt +49 -0
  7. data/ext/bamtools/LICENSE +22 -0
  8. data/ext/bamtools/README +60 -0
  9. data/ext/bamtools/Tutorial_Toolkit_BamTools-1.0.pdf +0 -0
  10. data/ext/bamtools/docs/Doxyfile +1601 -0
  11. data/ext/bamtools/extconf.rb +9 -0
  12. data/ext/bamtools/src/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  13. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/DependInfo.cmake +13 -0
  14. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/build.make +65 -0
  15. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/cmake_clean.cmake +8 -0
  16. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.internal +3 -0
  17. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/depend.make +3 -0
  18. data/ext/bamtools/src/CMakeFiles/SharedHeaders.dir/progress.make +2 -0
  19. data/ext/bamtools/src/CMakeFiles/progress.marks +1 -0
  20. data/ext/bamtools/src/CMakeLists.txt +18 -0
  21. data/ext/bamtools/src/ExportHeader.cmake +31 -0
  22. data/ext/bamtools/src/Makefile +182 -0
  23. data/ext/bamtools/src/api/BamAlignment.cpp +2432 -0
  24. data/ext/bamtools/src/api/BamAlignment.h +206 -0
  25. data/ext/bamtools/src/api/BamAux.h +456 -0
  26. data/ext/bamtools/src/api/BamConstants.h +127 -0
  27. data/ext/bamtools/src/api/BamIndex.h +79 -0
  28. data/ext/bamtools/src/api/BamMultiReader.cpp +395 -0
  29. data/ext/bamtools/src/api/BamMultiReader.h +126 -0
  30. data/ext/bamtools/src/api/BamReader.cpp +369 -0
  31. data/ext/bamtools/src/api/BamReader.h +117 -0
  32. data/ext/bamtools/src/api/BamWriter.cpp +142 -0
  33. data/ext/bamtools/src/api/BamWriter.h +63 -0
  34. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/DependInfo.cmake +14 -0
  35. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/build.make +80 -0
  36. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/cmake_clean.cmake +8 -0
  37. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.internal +3 -0
  38. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/depend.make +3 -0
  39. data/ext/bamtools/src/api/CMakeFiles/APIHeaders.dir/progress.make +2 -0
  40. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamAlignment.cpp.o +0 -0
  41. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamMultiReader.cpp.o +0 -0
  42. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamReader.cpp.o +0 -0
  43. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/BamWriter.cpp.o +0 -0
  44. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/CXX.includecache +596 -0
  45. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/DependInfo.cmake +41 -0
  46. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamHeader.cpp.o +0 -0
  47. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgram.cpp.o +0 -0
  48. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamProgramChain.cpp.o +0 -0
  49. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroup.cpp.o +0 -0
  50. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamReadGroupDictionary.cpp.o +0 -0
  51. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequence.cpp.o +0 -0
  52. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/SamSequenceDictionary.cpp.o +0 -0
  53. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/build.make +675 -0
  54. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean.cmake +32 -0
  55. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/cmake_clean_target.cmake +3 -0
  56. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.internal +295 -0
  57. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/depend.make +295 -0
  58. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/flags.make +8 -0
  59. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamHeader_p.cpp.o +0 -0
  60. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamIndexFactory_p.cpp.o +0 -0
  61. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamMultiReader_p.cpp.o +0 -0
  62. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
  63. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamReader_p.cpp.o +0 -0
  64. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamStandardIndex_p.cpp.o +0 -0
  65. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamToolsIndex_p.cpp.o +0 -0
  66. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BamWriter_p.cpp.o +0 -0
  67. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/BgzfStream_p.cpp.o +0 -0
  68. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatParser_p.cpp.o +0 -0
  69. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
  70. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
  71. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/link.txt +2 -0
  72. data/ext/bamtools/src/api/CMakeFiles/BamTools-static.dir/progress.make +24 -0
  73. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o +0 -0
  74. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamMultiReader.cpp.o +0 -0
  75. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamReader.cpp.o +0 -0
  76. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/BamWriter.cpp.o +0 -0
  77. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/CXX.includecache +596 -0
  78. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/DependInfo.cmake +47 -0
  79. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamHeader.cpp.o +0 -0
  80. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgram.cpp.o +0 -0
  81. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamProgramChain.cpp.o +0 -0
  82. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroup.cpp.o +0 -0
  83. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamReadGroupDictionary.cpp.o +0 -0
  84. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequence.cpp.o +0 -0
  85. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/SamSequenceDictionary.cpp.o +0 -0
  86. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/build.make +677 -0
  87. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/cmake_clean.cmake +33 -0
  88. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.internal +295 -0
  89. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/depend.make +295 -0
  90. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/flags.make +8 -0
  91. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamHeader_p.cpp.o +0 -0
  92. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamIndexFactory_p.cpp.o +0 -0
  93. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamMultiReader_p.cpp.o +0 -0
  94. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamRandomAccessController_p.cpp.o +0 -0
  95. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamReader_p.cpp.o +0 -0
  96. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamStandardIndex_p.cpp.o +0 -0
  97. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamToolsIndex_p.cpp.o +0 -0
  98. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BamWriter_p.cpp.o +0 -0
  99. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/BgzfStream_p.cpp.o +0 -0
  100. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatParser_p.cpp.o +0 -0
  101. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamFormatPrinter_p.cpp.o +0 -0
  102. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/internal/SamHeaderValidator_p.cpp.o +0 -0
  103. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/link.txt +1 -0
  104. data/ext/bamtools/src/api/CMakeFiles/BamTools.dir/progress.make +24 -0
  105. data/ext/bamtools/src/api/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  106. data/ext/bamtools/src/api/CMakeFiles/progress.marks +1 -0
  107. data/ext/bamtools/src/api/CMakeLists.txt +78 -0
  108. data/ext/bamtools/src/api/Makefile +902 -0
  109. data/ext/bamtools/src/api/SamConstants.h +95 -0
  110. data/ext/bamtools/src/api/SamHeader.cpp +184 -0
  111. data/ext/bamtools/src/api/SamHeader.h +68 -0
  112. data/ext/bamtools/src/api/SamProgram.cpp +139 -0
  113. data/ext/bamtools/src/api/SamProgram.h +61 -0
  114. data/ext/bamtools/src/api/SamProgramChain.cpp +351 -0
  115. data/ext/bamtools/src/api/SamProgramChain.h +85 -0
  116. data/ext/bamtools/src/api/SamReadGroup.cpp +221 -0
  117. data/ext/bamtools/src/api/SamReadGroup.h +68 -0
  118. data/ext/bamtools/src/api/SamReadGroupDictionary.cpp +289 -0
  119. data/ext/bamtools/src/api/SamReadGroupDictionary.h +86 -0
  120. data/ext/bamtools/src/api/SamSequence.cpp +161 -0
  121. data/ext/bamtools/src/api/SamSequence.h +60 -0
  122. data/ext/bamtools/src/api/SamSequenceDictionary.cpp +292 -0
  123. data/ext/bamtools/src/api/SamSequenceDictionary.h +88 -0
  124. data/ext/bamtools/src/api/api_global.h +21 -0
  125. data/ext/bamtools/src/api/cmake_install.cmake +122 -0
  126. data/ext/bamtools/src/api/internal/BamHeader_p.cpp +132 -0
  127. data/ext/bamtools/src/api/internal/BamHeader_p.h +71 -0
  128. data/ext/bamtools/src/api/internal/BamIndexFactory_p.cpp +112 -0
  129. data/ext/bamtools/src/api/internal/BamIndexFactory_p.h +49 -0
  130. data/ext/bamtools/src/api/internal/BamMultiMerger_p.h +297 -0
  131. data/ext/bamtools/src/api/internal/BamMultiReader_p.cpp +805 -0
  132. data/ext/bamtools/src/api/internal/BamMultiReader_p.h +103 -0
  133. data/ext/bamtools/src/api/internal/BamRandomAccessController_p.cpp +272 -0
  134. data/ext/bamtools/src/api/internal/BamRandomAccessController_p.h +93 -0
  135. data/ext/bamtools/src/api/internal/BamReader_p.cpp +380 -0
  136. data/ext/bamtools/src/api/internal/BamReader_p.h +112 -0
  137. data/ext/bamtools/src/api/internal/BamStandardIndex_p.cpp +986 -0
  138. data/ext/bamtools/src/api/internal/BamStandardIndex_p.h +236 -0
  139. data/ext/bamtools/src/api/internal/BamToolsIndex_p.cpp +641 -0
  140. data/ext/bamtools/src/api/internal/BamToolsIndex_p.h +187 -0
  141. data/ext/bamtools/src/api/internal/BamWriter_p.cpp +424 -0
  142. data/ext/bamtools/src/api/internal/BamWriter_p.h +66 -0
  143. data/ext/bamtools/src/api/internal/BgzfStream_p.cpp +438 -0
  144. data/ext/bamtools/src/api/internal/BgzfStream_p.h +108 -0
  145. data/ext/bamtools/src/api/internal/SamFormatParser_p.cpp +230 -0
  146. data/ext/bamtools/src/api/internal/SamFormatParser_p.h +61 -0
  147. data/ext/bamtools/src/api/internal/SamFormatPrinter_p.cpp +210 -0
  148. data/ext/bamtools/src/api/internal/SamFormatPrinter_p.h +60 -0
  149. data/ext/bamtools/src/api/internal/SamHeaderValidator_p.cpp +510 -0
  150. data/ext/bamtools/src/api/internal/SamHeaderValidator_p.h +101 -0
  151. data/ext/bamtools/src/api/internal/SamHeaderVersion_p.h +134 -0
  152. data/ext/bamtools/src/cmake_install.cmake +42 -0
  153. data/ext/bamtools/src/shared/bamtools_global.h +78 -0
  154. data/ext/bamtools/src/third_party/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  155. data/ext/bamtools/src/third_party/CMakeFiles/progress.marks +1 -0
  156. data/ext/bamtools/src/third_party/CMakeLists.txt +10 -0
  157. data/ext/bamtools/src/third_party/Makefile +167 -0
  158. data/ext/bamtools/src/third_party/cmake_install.cmake +35 -0
  159. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/CMakeDirectoryInformation.cmake +22 -0
  160. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/CXX.includecache +144 -0
  161. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/DependInfo.cmake +27 -0
  162. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/build.make +157 -0
  163. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/cmake_clean.cmake +13 -0
  164. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.internal +31 -0
  165. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/depend.make +31 -0
  166. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/flags.make +8 -0
  167. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_reader.cpp.o +0 -0
  168. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_value.cpp.o +0 -0
  169. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/json_writer.cpp.o +0 -0
  170. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/link.txt +1 -0
  171. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/jsoncpp.dir/progress.make +4 -0
  172. data/ext/bamtools/src/third_party/jsoncpp/CMakeFiles/progress.marks +1 -0
  173. data/ext/bamtools/src/third_party/jsoncpp/CMakeLists.txt +23 -0
  174. data/ext/bamtools/src/third_party/jsoncpp/LICENSE +55 -0
  175. data/ext/bamtools/src/third_party/jsoncpp/Makefile +263 -0
  176. data/ext/bamtools/src/third_party/jsoncpp/cmake_install.cmake +29 -0
  177. data/ext/bamtools/src/third_party/jsoncpp/json.h +15 -0
  178. data/ext/bamtools/src/third_party/jsoncpp/json_batchallocator.h +130 -0
  179. data/ext/bamtools/src/third_party/jsoncpp/json_config.h +42 -0
  180. data/ext/bamtools/src/third_party/jsoncpp/json_features.h +47 -0
  181. data/ext/bamtools/src/third_party/jsoncpp/json_forwards.h +42 -0
  182. data/ext/bamtools/src/third_party/jsoncpp/json_internalarray.inl +453 -0
  183. data/ext/bamtools/src/third_party/jsoncpp/json_internalmap.inl +612 -0
  184. data/ext/bamtools/src/third_party/jsoncpp/json_reader.cpp +870 -0
  185. data/ext/bamtools/src/third_party/jsoncpp/json_reader.h +201 -0
  186. data/ext/bamtools/src/third_party/jsoncpp/json_tool.h +93 -0
  187. data/ext/bamtools/src/third_party/jsoncpp/json_value.cpp +1701 -0
  188. data/ext/bamtools/src/third_party/jsoncpp/json_value.h +1059 -0
  189. data/ext/bamtools/src/third_party/jsoncpp/json_valueiterator.inl +297 -0
  190. data/ext/bamtools/src/third_party/jsoncpp/json_writer.cpp +819 -0
  191. data/ext/bamtools/src/third_party/jsoncpp/json_writer.h +179 -0
  192. data/ext/bamtools/src/toolkit/CMakeFiles/CMakeDirectoryInformation.cmake +25 -0
  193. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/CXX.includecache +698 -0
  194. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/DependInfo.cmake +34 -0
  195. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools.cpp.o +0 -0
  196. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_convert.cpp.o +0 -0
  197. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_count.cpp.o +0 -0
  198. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_coverage.cpp.o +0 -0
  199. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_filter.cpp.o +0 -0
  200. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_header.cpp.o +0 -0
  201. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_index.cpp.o +0 -0
  202. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_merge.cpp.o +0 -0
  203. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_random.cpp.o +0 -0
  204. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_resolve.cpp.o +0 -0
  205. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_revert.cpp.o +0 -0
  206. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_sort.cpp.o +0 -0
  207. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_split.cpp.o +0 -0
  208. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/bamtools_stats.cpp.o +0 -0
  209. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/build.make +447 -0
  210. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/cmake_clean.cmake +24 -0
  211. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.internal +319 -0
  212. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/depend.make +319 -0
  213. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/flags.make +8 -0
  214. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/link.txt +1 -0
  215. data/ext/bamtools/src/toolkit/CMakeFiles/bamtools_cmd.dir/progress.make +15 -0
  216. data/ext/bamtools/src/toolkit/CMakeFiles/progress.marks +1 -0
  217. data/ext/bamtools/src/toolkit/CMakeLists.txt +44 -0
  218. data/ext/bamtools/src/toolkit/Makefile +560 -0
  219. data/ext/bamtools/src/toolkit/bamtools.cpp +163 -0
  220. data/ext/bamtools/src/toolkit/bamtools_convert.cpp +888 -0
  221. data/ext/bamtools/src/toolkit/bamtools_convert.h +37 -0
  222. data/ext/bamtools/src/toolkit/bamtools_count.cpp +187 -0
  223. data/ext/bamtools/src/toolkit/bamtools_count.h +37 -0
  224. data/ext/bamtools/src/toolkit/bamtools_coverage.cpp +196 -0
  225. data/ext/bamtools/src/toolkit/bamtools_coverage.h +37 -0
  226. data/ext/bamtools/src/toolkit/bamtools_filter.cpp +911 -0
  227. data/ext/bamtools/src/toolkit/bamtools_filter.h +37 -0
  228. data/ext/bamtools/src/toolkit/bamtools_header.cpp +122 -0
  229. data/ext/bamtools/src/toolkit/bamtools_header.h +38 -0
  230. data/ext/bamtools/src/toolkit/bamtools_index.cpp +126 -0
  231. data/ext/bamtools/src/toolkit/bamtools_index.h +37 -0
  232. data/ext/bamtools/src/toolkit/bamtools_merge.cpp +221 -0
  233. data/ext/bamtools/src/toolkit/bamtools_merge.h +37 -0
  234. data/ext/bamtools/src/toolkit/bamtools_random.cpp +255 -0
  235. data/ext/bamtools/src/toolkit/bamtools_random.h +37 -0
  236. data/ext/bamtools/src/toolkit/bamtools_resolve.cpp +1396 -0
  237. data/ext/bamtools/src/toolkit/bamtools_resolve.h +42 -0
  238. data/ext/bamtools/src/toolkit/bamtools_revert.cpp +194 -0
  239. data/ext/bamtools/src/toolkit/bamtools_revert.h +37 -0
  240. data/ext/bamtools/src/toolkit/bamtools_sort.cpp +410 -0
  241. data/ext/bamtools/src/toolkit/bamtools_sort.h +37 -0
  242. data/ext/bamtools/src/toolkit/bamtools_split.cpp +551 -0
  243. data/ext/bamtools/src/toolkit/bamtools_split.h +38 -0
  244. data/ext/bamtools/src/toolkit/bamtools_stats.cpp +286 -0
  245. data/ext/bamtools/src/toolkit/bamtools_stats.h +37 -0
  246. data/ext/bamtools/src/toolkit/bamtools_tool.h +35 -0
  247. data/ext/bamtools/src/toolkit/bamtools_version.h +20 -0
  248. data/ext/bamtools/src/toolkit/bamtools_version.h.in +20 -0
  249. data/ext/bamtools/src/toolkit/cmake_install.cmake +52 -0
  250. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/CXX.includecache +250 -0
  251. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/DependInfo.cmake +29 -0
  252. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_fasta.cpp.o +0 -0
  253. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_options.cpp.o +0 -0
  254. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_pileup_engine.cpp.o +0 -0
  255. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/bamtools_utilities.cpp.o +0 -0
  256. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/build.make +184 -0
  257. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/cmake_clean.cmake +14 -0
  258. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.internal +40 -0
  259. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/depend.make +40 -0
  260. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/flags.make +8 -0
  261. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/link.txt +1 -0
  262. data/ext/bamtools/src/utils/CMakeFiles/BamTools-utils.dir/progress.make +5 -0
  263. data/ext/bamtools/src/utils/CMakeFiles/CMakeDirectoryInformation.cmake +23 -0
  264. data/ext/bamtools/src/utils/CMakeFiles/progress.marks +1 -0
  265. data/ext/bamtools/src/utils/CMakeLists.txt +30 -0
  266. data/ext/bamtools/src/utils/Makefile +290 -0
  267. data/ext/bamtools/src/utils/bamtools_fasta.cpp +632 -0
  268. data/ext/bamtools/src/utils/bamtools_fasta.h +47 -0
  269. data/ext/bamtools/src/utils/bamtools_filter_engine.h +552 -0
  270. data/ext/bamtools/src/utils/bamtools_filter_properties.h +195 -0
  271. data/ext/bamtools/src/utils/bamtools_filter_ruleparser.h +319 -0
  272. data/ext/bamtools/src/utils/bamtools_options.cpp +287 -0
  273. data/ext/bamtools/src/utils/bamtools_options.h +213 -0
  274. data/ext/bamtools/src/utils/bamtools_pileup_engine.cpp +327 -0
  275. data/ext/bamtools/src/utils/bamtools_pileup_engine.h +94 -0
  276. data/ext/bamtools/src/utils/bamtools_utilities.cpp +333 -0
  277. data/ext/bamtools/src/utils/bamtools_utilities.h +67 -0
  278. data/ext/bamtools/src/utils/bamtools_variant.h +128 -0
  279. data/ext/bamtools/src/utils/cmake_install.cmake +29 -0
  280. data/ext/bamtools/src/utils/utils_global.h +21 -0
  281. data/lib/ngs_server/version.rb +3 -0
  282. data/lib/ngs_server.rb +3 -0
  283. data/ngs_server.gemspec +23 -0
  284. metadata +339 -0
@@ -0,0 +1,612 @@
1
+ // Copyright 2007-2010 Baptiste Lepilleur
2
+ // Distributed under MIT license, or public domain if desired and
3
+ // recognized in your jurisdiction.
4
+ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5
+
6
+ // included by json_value.cpp
7
+ // everything is within Json namespace
8
+
9
+ // //////////////////////////////////////////////////////////////////
10
+ // //////////////////////////////////////////////////////////////////
11
+ // //////////////////////////////////////////////////////////////////
12
+ // class ValueInternalMap
13
+ // //////////////////////////////////////////////////////////////////
14
+ // //////////////////////////////////////////////////////////////////
15
+ // //////////////////////////////////////////////////////////////////
16
+
17
+ /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) );
18
+ * This optimization is used by the fast allocator.
19
+ */
20
+ ValueInternalLink::ValueInternalLink()
21
+ : previous_( 0 )
22
+ , next_( 0 )
23
+ {
24
+ }
25
+
26
+ ValueInternalLink::~ValueInternalLink()
27
+ {
28
+ for ( int index =0; index < itemPerLink; ++index )
29
+ {
30
+ if ( !items_[index].isItemAvailable() )
31
+ {
32
+ if ( !items_[index].isMemberNameStatic() )
33
+ free( keys_[index] );
34
+ }
35
+ else
36
+ break;
37
+ }
38
+ }
39
+
40
+
41
+
42
+ ValueMapAllocator::~ValueMapAllocator()
43
+ {
44
+ }
45
+
46
+ #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
47
+ class DefaultValueMapAllocator : public ValueMapAllocator
48
+ {
49
+ public: // overridden from ValueMapAllocator
50
+ virtual ValueInternalMap *newMap()
51
+ {
52
+ return new ValueInternalMap();
53
+ }
54
+
55
+ virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
56
+ {
57
+ return new ValueInternalMap( other );
58
+ }
59
+
60
+ virtual void destructMap( ValueInternalMap *map )
61
+ {
62
+ delete map;
63
+ }
64
+
65
+ virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
66
+ {
67
+ return new ValueInternalLink[size];
68
+ }
69
+
70
+ virtual void releaseMapBuckets( ValueInternalLink *links )
71
+ {
72
+ delete [] links;
73
+ }
74
+
75
+ virtual ValueInternalLink *allocateMapLink()
76
+ {
77
+ return new ValueInternalLink();
78
+ }
79
+
80
+ virtual void releaseMapLink( ValueInternalLink *link )
81
+ {
82
+ delete link;
83
+ }
84
+ };
85
+ #else
86
+ /// @todo make this thread-safe (lock when accessign batch allocator)
87
+ class DefaultValueMapAllocator : public ValueMapAllocator
88
+ {
89
+ public: // overridden from ValueMapAllocator
90
+ virtual ValueInternalMap *newMap()
91
+ {
92
+ ValueInternalMap *map = mapsAllocator_.allocate();
93
+ new (map) ValueInternalMap(); // placement new
94
+ return map;
95
+ }
96
+
97
+ virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
98
+ {
99
+ ValueInternalMap *map = mapsAllocator_.allocate();
100
+ new (map) ValueInternalMap( other ); // placement new
101
+ return map;
102
+ }
103
+
104
+ virtual void destructMap( ValueInternalMap *map )
105
+ {
106
+ if ( map )
107
+ {
108
+ map->~ValueInternalMap();
109
+ mapsAllocator_.release( map );
110
+ }
111
+ }
112
+
113
+ virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
114
+ {
115
+ return new ValueInternalLink[size];
116
+ }
117
+
118
+ virtual void releaseMapBuckets( ValueInternalLink *links )
119
+ {
120
+ delete [] links;
121
+ }
122
+
123
+ virtual ValueInternalLink *allocateMapLink()
124
+ {
125
+ ValueInternalLink *link = linksAllocator_.allocate();
126
+ memset( link, 0, sizeof(ValueInternalLink) );
127
+ return link;
128
+ }
129
+
130
+ virtual void releaseMapLink( ValueInternalLink *link )
131
+ {
132
+ link->~ValueInternalLink();
133
+ linksAllocator_.release( link );
134
+ }
135
+ private:
136
+ BatchAllocator<ValueInternalMap,1> mapsAllocator_;
137
+ BatchAllocator<ValueInternalLink,1> linksAllocator_;
138
+ };
139
+ #endif
140
+
141
+ static ValueMapAllocator *&mapAllocator()
142
+ {
143
+ static DefaultValueMapAllocator defaultAllocator;
144
+ static ValueMapAllocator *mapAllocator = &defaultAllocator;
145
+ return mapAllocator;
146
+ }
147
+
148
+ static struct DummyMapAllocatorInitializer {
149
+ DummyMapAllocatorInitializer()
150
+ {
151
+ mapAllocator(); // ensure mapAllocator() statics are initialized before main().
152
+ }
153
+ } dummyMapAllocatorInitializer;
154
+
155
+
156
+
157
+ // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.
158
+
159
+ /*
160
+ use linked list hash map.
161
+ buckets array is a container.
162
+ linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)
163
+ value have extra state: valid, available, deleted
164
+ */
165
+
166
+
167
+ ValueInternalMap::ValueInternalMap()
168
+ : buckets_( 0 )
169
+ , tailLink_( 0 )
170
+ , bucketsSize_( 0 )
171
+ , itemCount_( 0 )
172
+ {
173
+ }
174
+
175
+
176
+ ValueInternalMap::ValueInternalMap( const ValueInternalMap &other )
177
+ : buckets_( 0 )
178
+ , tailLink_( 0 )
179
+ , bucketsSize_( 0 )
180
+ , itemCount_( 0 )
181
+ {
182
+ reserve( other.itemCount_ );
183
+ IteratorState it;
184
+ IteratorState itEnd;
185
+ other.makeBeginIterator( it );
186
+ other.makeEndIterator( itEnd );
187
+ for ( ; !equals(it,itEnd); increment(it) )
188
+ {
189
+ bool isStatic;
190
+ const char *memberName = key( it, isStatic );
191
+ const Value &aValue = value( it );
192
+ resolveReference(memberName, isStatic) = aValue;
193
+ }
194
+ }
195
+
196
+
197
+ ValueInternalMap &
198
+ ValueInternalMap::operator =( const ValueInternalMap &other )
199
+ {
200
+ ValueInternalMap dummy( other );
201
+ swap( dummy );
202
+ return *this;
203
+ }
204
+
205
+
206
+ ValueInternalMap::~ValueInternalMap()
207
+ {
208
+ if ( buckets_ )
209
+ {
210
+ for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex )
211
+ {
212
+ ValueInternalLink *link = buckets_[bucketIndex].next_;
213
+ while ( link )
214
+ {
215
+ ValueInternalLink *linkToRelease = link;
216
+ link = link->next_;
217
+ mapAllocator()->releaseMapLink( linkToRelease );
218
+ }
219
+ }
220
+ mapAllocator()->releaseMapBuckets( buckets_ );
221
+ }
222
+ }
223
+
224
+
225
+ void
226
+ ValueInternalMap::swap( ValueInternalMap &other )
227
+ {
228
+ ValueInternalLink *tempBuckets = buckets_;
229
+ buckets_ = other.buckets_;
230
+ other.buckets_ = tempBuckets;
231
+ ValueInternalLink *tempTailLink = tailLink_;
232
+ tailLink_ = other.tailLink_;
233
+ other.tailLink_ = tempTailLink;
234
+ BucketIndex tempBucketsSize = bucketsSize_;
235
+ bucketsSize_ = other.bucketsSize_;
236
+ other.bucketsSize_ = tempBucketsSize;
237
+ BucketIndex tempItemCount = itemCount_;
238
+ itemCount_ = other.itemCount_;
239
+ other.itemCount_ = tempItemCount;
240
+ }
241
+
242
+
243
+ void
244
+ ValueInternalMap::clear()
245
+ {
246
+ ValueInternalMap dummy;
247
+ swap( dummy );
248
+ }
249
+
250
+
251
+ ValueInternalMap::BucketIndex
252
+ ValueInternalMap::size() const
253
+ {
254
+ return itemCount_;
255
+ }
256
+
257
+ bool
258
+ ValueInternalMap::reserveDelta( BucketIndex growth )
259
+ {
260
+ return reserve( itemCount_ + growth );
261
+ }
262
+
263
+ bool
264
+ ValueInternalMap::reserve( BucketIndex newItemCount )
265
+ {
266
+ if ( !buckets_ && newItemCount > 0 )
267
+ {
268
+ buckets_ = mapAllocator()->allocateMapBuckets( 1 );
269
+ bucketsSize_ = 1;
270
+ tailLink_ = &buckets_[0];
271
+ }
272
+ // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;
273
+ return true;
274
+ }
275
+
276
+
277
+ const Value *
278
+ ValueInternalMap::find( const char *key ) const
279
+ {
280
+ if ( !bucketsSize_ )
281
+ return 0;
282
+ HashKey hashedKey = hash( key );
283
+ BucketIndex bucketIndex = hashedKey % bucketsSize_;
284
+ for ( const ValueInternalLink *current = &buckets_[bucketIndex];
285
+ current != 0;
286
+ current = current->next_ )
287
+ {
288
+ for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index )
289
+ {
290
+ if ( current->items_[index].isItemAvailable() )
291
+ return 0;
292
+ if ( strcmp( key, current->keys_[index] ) == 0 )
293
+ return &current->items_[index];
294
+ }
295
+ }
296
+ return 0;
297
+ }
298
+
299
+
300
+ Value *
301
+ ValueInternalMap::find( const char *key )
302
+ {
303
+ const ValueInternalMap *constThis = this;
304
+ return const_cast<Value *>( constThis->find( key ) );
305
+ }
306
+
307
+
308
+ Value &
309
+ ValueInternalMap::resolveReference( const char *key,
310
+ bool isStatic )
311
+ {
312
+ HashKey hashedKey = hash( key );
313
+ if ( bucketsSize_ )
314
+ {
315
+ BucketIndex bucketIndex = hashedKey % bucketsSize_;
316
+ ValueInternalLink **previous = 0;
317
+ BucketIndex index;
318
+ for ( ValueInternalLink *current = &buckets_[bucketIndex];
319
+ current != 0;
320
+ previous = &current->next_, current = current->next_ )
321
+ {
322
+ for ( index=0; index < ValueInternalLink::itemPerLink; ++index )
323
+ {
324
+ if ( current->items_[index].isItemAvailable() )
325
+ return setNewItem( key, isStatic, current, index );
326
+ if ( strcmp( key, current->keys_[index] ) == 0 )
327
+ return current->items_[index];
328
+ }
329
+ }
330
+ }
331
+
332
+ reserveDelta( 1 );
333
+ return unsafeAdd( key, isStatic, hashedKey );
334
+ }
335
+
336
+
337
+ void
338
+ ValueInternalMap::remove( const char *key )
339
+ {
340
+ HashKey hashedKey = hash( key );
341
+ if ( !bucketsSize_ )
342
+ return;
343
+ BucketIndex bucketIndex = hashedKey % bucketsSize_;
344
+ for ( ValueInternalLink *link = &buckets_[bucketIndex];
345
+ link != 0;
346
+ link = link->next_ )
347
+ {
348
+ BucketIndex index;
349
+ for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
350
+ {
351
+ if ( link->items_[index].isItemAvailable() )
352
+ return;
353
+ if ( strcmp( key, link->keys_[index] ) == 0 )
354
+ {
355
+ doActualRemove( link, index, bucketIndex );
356
+ return;
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ void
363
+ ValueInternalMap::doActualRemove( ValueInternalLink *link,
364
+ BucketIndex index,
365
+ BucketIndex bucketIndex )
366
+ {
367
+ // find last item of the bucket and swap it with the 'removed' one.
368
+ // set removed items flags to 'available'.
369
+ // if last page only contains 'available' items, then desallocate it (it's empty)
370
+ ValueInternalLink *&lastLink = getLastLinkInBucket( index );
371
+ BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1
372
+ for ( ;
373
+ lastItemIndex < ValueInternalLink::itemPerLink;
374
+ ++lastItemIndex ) // may be optimized with dicotomic search
375
+ {
376
+ if ( lastLink->items_[lastItemIndex].isItemAvailable() )
377
+ break;
378
+ }
379
+
380
+ BucketIndex lastUsedIndex = lastItemIndex - 1;
381
+ Value *valueToDelete = &link->items_[index];
382
+ Value *valueToPreserve = &lastLink->items_[lastUsedIndex];
383
+ if ( valueToDelete != valueToPreserve )
384
+ valueToDelete->swap( *valueToPreserve );
385
+ if ( lastUsedIndex == 0 ) // page is now empty
386
+ { // remove it from bucket linked list and delete it.
387
+ ValueInternalLink *linkPreviousToLast = lastLink->previous_;
388
+ if ( linkPreviousToLast != 0 ) // can not deleted bucket link.
389
+ {
390
+ mapAllocator()->releaseMapLink( lastLink );
391
+ linkPreviousToLast->next_ = 0;
392
+ lastLink = linkPreviousToLast;
393
+ }
394
+ }
395
+ else
396
+ {
397
+ Value dummy;
398
+ valueToPreserve->swap( dummy ); // restore deleted to default Value.
399
+ valueToPreserve->setItemUsed( false );
400
+ }
401
+ --itemCount_;
402
+ }
403
+
404
+
405
+ ValueInternalLink *&
406
+ ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex )
407
+ {
408
+ if ( bucketIndex == bucketsSize_ - 1 )
409
+ return tailLink_;
410
+ ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_;
411
+ if ( !previous )
412
+ previous = &buckets_[bucketIndex];
413
+ return previous;
414
+ }
415
+
416
+
417
+ Value &
418
+ ValueInternalMap::setNewItem( const char *key,
419
+ bool isStatic,
420
+ ValueInternalLink *link,
421
+ BucketIndex index )
422
+ {
423
+ char *duplicatedKey = makeMemberName( key );
424
+ ++itemCount_;
425
+ link->keys_[index] = duplicatedKey;
426
+ link->items_[index].setItemUsed();
427
+ link->items_[index].setMemberNameIsStatic( isStatic );
428
+ return link->items_[index]; // items already default constructed.
429
+ }
430
+
431
+
432
+ Value &
433
+ ValueInternalMap::unsafeAdd( const char *key,
434
+ bool isStatic,
435
+ HashKey hashedKey )
436
+ {
437
+ JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." );
438
+ BucketIndex bucketIndex = hashedKey % bucketsSize_;
439
+ ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex );
440
+ ValueInternalLink *link = previousLink;
441
+ BucketIndex index;
442
+ for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
443
+ {
444
+ if ( link->items_[index].isItemAvailable() )
445
+ break;
446
+ }
447
+ if ( index == ValueInternalLink::itemPerLink ) // need to add a new page
448
+ {
449
+ ValueInternalLink *newLink = mapAllocator()->allocateMapLink();
450
+ index = 0;
451
+ link->next_ = newLink;
452
+ previousLink = newLink;
453
+ link = newLink;
454
+ }
455
+ return setNewItem( key, isStatic, link, index );
456
+ }
457
+
458
+
459
+ ValueInternalMap::HashKey
460
+ ValueInternalMap::hash( const char *key ) const
461
+ {
462
+ HashKey hash = 0;
463
+ while ( *key )
464
+ hash += *key++ * 37;
465
+ return hash;
466
+ }
467
+
468
+
469
+ int
470
+ ValueInternalMap::compare( const ValueInternalMap &other ) const
471
+ {
472
+ int sizeDiff( itemCount_ - other.itemCount_ );
473
+ if ( sizeDiff != 0 )
474
+ return sizeDiff;
475
+ // Strict order guaranty is required. Compare all keys FIRST, then compare values.
476
+ IteratorState it;
477
+ IteratorState itEnd;
478
+ makeBeginIterator( it );
479
+ makeEndIterator( itEnd );
480
+ for ( ; !equals(it,itEnd); increment(it) )
481
+ {
482
+ if ( !other.find( key( it ) ) )
483
+ return 1;
484
+ }
485
+
486
+ // All keys are equals, let's compare values
487
+ makeBeginIterator( it );
488
+ for ( ; !equals(it,itEnd); increment(it) )
489
+ {
490
+ const Value *otherValue = other.find( key( it ) );
491
+ int valueDiff = value(it).compare( *otherValue );
492
+ if ( valueDiff != 0 )
493
+ return valueDiff;
494
+ }
495
+ return 0;
496
+ }
497
+
498
+
499
+ void
500
+ ValueInternalMap::makeBeginIterator( IteratorState &it ) const
501
+ {
502
+ it.map_ = const_cast<ValueInternalMap *>( this );
503
+ it.bucketIndex_ = 0;
504
+ it.itemIndex_ = 0;
505
+ it.link_ = buckets_;
506
+ }
507
+
508
+
509
+ void
510
+ ValueInternalMap::makeEndIterator( IteratorState &it ) const
511
+ {
512
+ it.map_ = const_cast<ValueInternalMap *>( this );
513
+ it.bucketIndex_ = bucketsSize_;
514
+ it.itemIndex_ = 0;
515
+ it.link_ = 0;
516
+ }
517
+
518
+
519
+ bool
520
+ ValueInternalMap::equals( const IteratorState &x, const IteratorState &other )
521
+ {
522
+ return x.map_ == other.map_
523
+ && x.bucketIndex_ == other.bucketIndex_
524
+ && x.link_ == other.link_
525
+ && x.itemIndex_ == other.itemIndex_;
526
+ }
527
+
528
+
529
+ void
530
+ ValueInternalMap::incrementBucket( IteratorState &iterator )
531
+ {
532
+ ++iterator.bucketIndex_;
533
+ JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_,
534
+ "ValueInternalMap::increment(): attempting to iterate beyond end." );
535
+ if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ )
536
+ iterator.link_ = 0;
537
+ else
538
+ iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);
539
+ iterator.itemIndex_ = 0;
540
+ }
541
+
542
+
543
+ void
544
+ ValueInternalMap::increment( IteratorState &iterator )
545
+ {
546
+ JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." );
547
+ ++iterator.itemIndex_;
548
+ if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink )
549
+ {
550
+ JSON_ASSERT_MESSAGE( iterator.link_ != 0,
551
+ "ValueInternalMap::increment(): attempting to iterate beyond end." );
552
+ iterator.link_ = iterator.link_->next_;
553
+ if ( iterator.link_ == 0 )
554
+ incrementBucket( iterator );
555
+ }
556
+ else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() )
557
+ {
558
+ incrementBucket( iterator );
559
+ }
560
+ }
561
+
562
+
563
+ void
564
+ ValueInternalMap::decrement( IteratorState &iterator )
565
+ {
566
+ if ( iterator.itemIndex_ == 0 )
567
+ {
568
+ JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." );
569
+ if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] )
570
+ {
571
+ JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." );
572
+ --(iterator.bucketIndex_);
573
+ }
574
+ iterator.link_ = iterator.link_->previous_;
575
+ iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;
576
+ }
577
+ }
578
+
579
+
580
+ const char *
581
+ ValueInternalMap::key( const IteratorState &iterator )
582
+ {
583
+ JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
584
+ return iterator.link_->keys_[iterator.itemIndex_];
585
+ }
586
+
587
+ const char *
588
+ ValueInternalMap::key( const IteratorState &iterator, bool &isStatic )
589
+ {
590
+ JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
591
+ isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();
592
+ return iterator.link_->keys_[iterator.itemIndex_];
593
+ }
594
+
595
+
596
+ Value &
597
+ ValueInternalMap::value( const IteratorState &iterator )
598
+ {
599
+ JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
600
+ return iterator.link_->items_[iterator.itemIndex_];
601
+ }
602
+
603
+
604
+ int
605
+ ValueInternalMap::distance( const IteratorState &x, const IteratorState &y )
606
+ {
607
+ int offset = 0;
608
+ IteratorState it = x;
609
+ while ( !equals( it, y ) )
610
+ increment( it );
611
+ return offset;
612
+ }