Skip to content
Permalink
Browse files

Initial commit

Signed-off-by: saq10002 <saad0105050@gmail.com>
  • Loading branch information...
saq10002
saq10002 committed Oct 26, 2014
1 parent 2763560 commit 78b590d61483c6578d582af2b996a03cb51fe864
Showing with 129,680 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +37 −0 Makefile
  3. +4 −0 README
  4. +101 −0 common.h
  5. +17 −0 ds.DynamicBitset.cpp
  6. +382 −0 ds.DynamicBitset.h
  7. +390 −0 ds.DynamicBitset.test.h
  8. BIN dynamicbitset_test
  9. +20 −0 dynamicbitset_test.cpp
  10. +157 −0 gtest-1.7.0/CHANGES
  11. +252 −0 gtest-1.7.0/CMakeLists.txt
  12. +37 −0 gtest-1.7.0/CONTRIBUTORS
  13. +28 −0 gtest-1.7.0/LICENSE
  14. +1,360 −0 gtest-1.7.0/Makefile
  15. +306 −0 gtest-1.7.0/Makefile.am
  16. +1,360 −0 gtest-1.7.0/Makefile.in
  17. +435 −0 gtest-1.7.0/README
  18. +1,198 −0 gtest-1.7.0/aclocal.m4
  19. +1,530 −0 gtest-1.7.0/build-aux/config.guess
  20. +70 −0 gtest-1.7.0/build-aux/config.h
  21. +69 −0 gtest-1.7.0/build-aux/config.h.in
  22. +1,773 −0 gtest-1.7.0/build-aux/config.sub
  23. +688 −0 gtest-1.7.0/build-aux/depcomp
  24. +527 −0 gtest-1.7.0/build-aux/install-sh
  25. +9,661 −0 gtest-1.7.0/build-aux/ltmain.sh
  26. +331 −0 gtest-1.7.0/build-aux/missing
  27. +1 −0 gtest-1.7.0/build-aux/stamp-h1
  28. +227 −0 gtest-1.7.0/cmake/internal_utils.cmake
  29. +138 −0 gtest-1.7.0/codegear/gtest.cbproj
  30. +54 −0 gtest-1.7.0/codegear/gtest.groupproj
  31. +38 −0 gtest-1.7.0/codegear/gtest_all.cc
  32. +40 −0 gtest-1.7.0/codegear/gtest_link.cc
  33. +82 −0 gtest-1.7.0/codegear/gtest_main.cbproj
  34. +88 −0 gtest-1.7.0/codegear/gtest_unittest.cbproj
  35. +970 −0 gtest-1.7.0/config.log
  36. +2,296 −0 gtest-1.7.0/config.status
  37. +18,222 −0 gtest-1.7.0/configure
  38. +68 −0 gtest-1.7.0/configure.ac
  39. +294 −0 gtest-1.7.0/include/gtest/gtest-death-test.h
  40. +250 −0 gtest-1.7.0/include/gtest/gtest-message.h
  41. +1,421 −0 gtest-1.7.0/include/gtest/gtest-param-test.h
  42. +487 −0 gtest-1.7.0/include/gtest/gtest-param-test.h.pump
  43. +855 −0 gtest-1.7.0/include/gtest/gtest-printers.h
  44. +232 −0 gtest-1.7.0/include/gtest/gtest-spi.h
  45. +179 −0 gtest-1.7.0/include/gtest/gtest-test-part.h
  46. +259 −0 gtest-1.7.0/include/gtest/gtest-typed-test.h
  47. +2,291 −0 gtest-1.7.0/include/gtest/gtest.h
  48. +358 −0 gtest-1.7.0/include/gtest/gtest_pred_impl.h
  49. +58 −0 gtest-1.7.0/include/gtest/gtest_prod.h
  50. +319 −0 gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h
  51. +206 −0 gtest-1.7.0/include/gtest/internal/gtest-filepath.h
  52. +1,158 −0 gtest-1.7.0/include/gtest/internal/gtest-internal.h
  53. +233 −0 gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h
  54. +5,143 −0 gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h
  55. +301 −0 gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h.pump
  56. +619 −0 gtest-1.7.0/include/gtest/internal/gtest-param-util.h
  57. +1,947 −0 gtest-1.7.0/include/gtest/internal/gtest-port.h
  58. +167 −0 gtest-1.7.0/include/gtest/internal/gtest-string.h
  59. +1,012 −0 gtest-1.7.0/include/gtest/internal/gtest-tuple.h
  60. +339 −0 gtest-1.7.0/include/gtest/internal/gtest-tuple.h.pump
  61. +3,331 −0 gtest-1.7.0/include/gtest/internal/gtest-type-util.h
  62. +297 −0 gtest-1.7.0/include/gtest/internal/gtest-type-util.h.pump
  63. 0 gtest-1.7.0/lib/.dirstamp
  64. BIN gtest-1.7.0/lib/.libs/libgtest.a
  65. +1 −0 gtest-1.7.0/lib/.libs/libgtest.la
  66. +41 −0 gtest-1.7.0/lib/.libs/libgtest.lai
  67. +1 −0 gtest-1.7.0/lib/.libs/libgtest.so
  68. +1 −0 gtest-1.7.0/lib/.libs/libgtest.so.0
  69. BIN gtest-1.7.0/lib/.libs/libgtest.so.0.0.0
  70. BIN gtest-1.7.0/lib/.libs/libgtest_main.a
  71. +1 −0 gtest-1.7.0/lib/.libs/libgtest_main.la
  72. +41 −0 gtest-1.7.0/lib/.libs/libgtest_main.lai
  73. +1 −0 gtest-1.7.0/lib/.libs/libgtest_main.so
  74. +1 −0 gtest-1.7.0/lib/.libs/libgtest_main.so.0
  75. BIN gtest-1.7.0/lib/.libs/libgtest_main.so.0.0.0
  76. +41 −0 gtest-1.7.0/lib/libgtest.la
  77. +42 −0 gtest-1.7.0/lib/libgtest_main.la
  78. BIN gtest-1.7.0/libgtest.a
  79. +10,246 −0 gtest-1.7.0/libtool
  80. +363 −0 gtest-1.7.0/m4/acx_pthread.m4
  81. +74 −0 gtest-1.7.0/m4/gtest.m4
  82. +8,001 −0 gtest-1.7.0/m4/libtool.m4
  83. +384 −0 gtest-1.7.0/m4/ltoptions.m4
  84. +123 −0 gtest-1.7.0/m4/ltsugar.m4
  85. +23 −0 gtest-1.7.0/m4/ltversion.m4
  86. +82 −0 gtest-1.7.0/make/Makefile
  87. +45 −0 gtest-1.7.0/msvc/gtest-md.sln
  88. +126 −0 gtest-1.7.0/msvc/gtest-md.vcproj
  89. +45 −0 gtest-1.7.0/msvc/gtest.sln
  90. +126 −0 gtest-1.7.0/msvc/gtest.vcproj
  91. +129 −0 gtest-1.7.0/msvc/gtest_main-md.vcproj
  92. +129 −0 gtest-1.7.0/msvc/gtest_main.vcproj
  93. +164 −0 gtest-1.7.0/msvc/gtest_prod_test-md.vcproj
  94. +164 −0 gtest-1.7.0/msvc/gtest_prod_test.vcproj
  95. +147 −0 gtest-1.7.0/msvc/gtest_unittest-md.vcproj
  96. +147 −0 gtest-1.7.0/msvc/gtest_unittest.vcproj
  97. +82 −0 gtest-1.7.0/nbproject/configurations.xml
  98. +1 −0 gtest-1.7.0/nbproject/private/CodeAssistancePathMapper.properties
  99. +49 −0 gtest-1.7.0/nbproject/private/Default-build.log
  100. +419 −0 gtest-1.7.0/nbproject/private/Default-exec.log
  101. +5 −0 gtest-1.7.0/nbproject/private/Default.properties
  102. +208 −0 gtest-1.7.0/nbproject/private/configurations.xml
  103. +40 −0 gtest-1.7.0/nbproject/private/launcher.properties
  104. +10 −0 gtest-1.7.0/nbproject/private/private.xml
  105. +26 −0 gtest-1.7.0/nbproject/project.xml
  106. 0 gtest-1.7.0/samples/.deps/.dirstamp
  107. +3 −0 gtest-1.7.0/samples/.deps/sample1.Plo
  108. +1 −0 gtest-1.7.0/samples/.deps/sample10_unittest.Po
  109. +1 −0 gtest-1.7.0/samples/.deps/sample1_unittest.Po
  110. +29 −0 gtest-1.7.0/samples/.deps/sample2.Plo
  111. +47 −0 gtest-1.7.0/samples/.deps/sample4.Plo
  112. 0 gtest-1.7.0/samples/.dirstamp
  113. BIN gtest-1.7.0/samples/.libs/libsamples.a
  114. +1 −0 gtest-1.7.0/samples/.libs/libsamples.la
  115. +41 −0 gtest-1.7.0/samples/libsamples.la
  116. +123 −0 gtest-1.7.0/samples/prime_tables.h
  117. +68 −0 gtest-1.7.0/samples/sample1.cc
  118. +43 −0 gtest-1.7.0/samples/sample1.h
  119. +12 −0 gtest-1.7.0/samples/sample1.lo
  120. +144 −0 gtest-1.7.0/samples/sample10_unittest.cc
  121. +153 −0 gtest-1.7.0/samples/sample1_unittest.cc
  122. +56 −0 gtest-1.7.0/samples/sample2.cc
  123. +85 −0 gtest-1.7.0/samples/sample2.h
  124. +12 −0 gtest-1.7.0/samples/sample2.lo
  125. +109 −0 gtest-1.7.0/samples/sample2_unittest.cc
  126. +172 −0 gtest-1.7.0/samples/sample3-inl.h
  127. +151 −0 gtest-1.7.0/samples/sample3_unittest.cc
  128. +46 −0 gtest-1.7.0/samples/sample4.cc
  129. +53 −0 gtest-1.7.0/samples/sample4.h
  130. +12 −0 gtest-1.7.0/samples/sample4.lo
  131. +45 −0 gtest-1.7.0/samples/sample4_unittest.cc
  132. +199 −0 gtest-1.7.0/samples/sample5_unittest.cc
  133. +224 −0 gtest-1.7.0/samples/sample6_unittest.cc
  134. +130 −0 gtest-1.7.0/samples/sample7_unittest.cc
  135. +173 −0 gtest-1.7.0/samples/sample8_unittest.cc
  136. +160 −0 gtest-1.7.0/samples/sample9_unittest.cc
  137. +730 −0 gtest-1.7.0/scripts/gen_gtest_pred_impl.py
  138. +274 −0 gtest-1.7.0/scripts/gtest-config
  139. +274 −0 gtest-1.7.0/scripts/gtest-config.in
  140. +855 −0 gtest-1.7.0/scripts/pump.py
  141. +59 −0 gtest-1.7.0/scripts/test/Makefile
  142. 0 gtest-1.7.0/src/.deps/.dirstamp
  143. +633 −0 gtest-1.7.0/src/.deps/gtest-all.Plo
  144. +470 −0 gtest-1.7.0/src/.deps/gtest_main.Plo
  145. 0 gtest-1.7.0/src/.dirstamp
  146. +48 −0 gtest-1.7.0/src/gtest-all.cc
  147. +12 −0 gtest-1.7.0/src/gtest-all.lo
  148. +1,344 −0 gtest-1.7.0/src/gtest-death-test.cc
  149. +382 −0 gtest-1.7.0/src/gtest-filepath.cc
  150. +1,218 −0 gtest-1.7.0/src/gtest-internal-inl.h
  151. +805 −0 gtest-1.7.0/src/gtest-port.cc
  152. +363 −0 gtest-1.7.0/src/gtest-printers.cc
  153. +110 −0 gtest-1.7.0/src/gtest-test-part.cc
  154. +110 −0 gtest-1.7.0/src/gtest-typed-test.cc
  155. +5,015 −0 gtest-1.7.0/src/gtest.cc
  156. +38 −0 gtest-1.7.0/src/gtest_main.cc
  157. +12 −0 gtest-1.7.0/src/gtest_main.lo
  158. +1 −0 gtest-1.7.0/test/.deps/gtest_all_test.Po
  159. +93 −0 gtest-1.7.0/test/gtest-death-test_ex_test.cc
  160. +1,367 −0 gtest-1.7.0/test/gtest-death-test_test.cc
  161. +680 −0 gtest-1.7.0/test/gtest-filepath_test.cc
  162. +154 −0 gtest-1.7.0/test/gtest-linked_ptr_test.cc
  163. +310 −0 gtest-1.7.0/test/gtest-listener_test.cc
  164. +159 −0 gtest-1.7.0/test/gtest-message_test.cc
  165. +215 −0 gtest-1.7.0/test/gtest-options_test.cc
  166. +65 −0 gtest-1.7.0/test/gtest-param-test2_test.cc
  167. +904 −0 gtest-1.7.0/test/gtest-param-test_test.cc
  168. +57 −0 gtest-1.7.0/test/gtest-param-test_test.h
  169. +1,253 −0 gtest-1.7.0/test/gtest-port_test.cc
  170. +1,566 −0 gtest-1.7.0/test/gtest-printers_test.cc
  171. +208 −0 gtest-1.7.0/test/gtest-test-part_test.cc
  172. +320 −0 gtest-1.7.0/test/gtest-tuple_test.cc
  173. +45 −0 gtest-1.7.0/test/gtest-typed-test2_test.cc
  174. +360 −0 gtest-1.7.0/test/gtest-typed-test_test.cc
  175. +66 −0 gtest-1.7.0/test/gtest-typed-test_test.h
  176. +341 −0 gtest-1.7.0/test/gtest-unittest-api_test.cc
  177. +47 −0 gtest-1.7.0/test/gtest_all_test.cc
  178. +212 −0 gtest-1.7.0/test/gtest_break_on_failure_unittest.py
  179. +88 −0 gtest-1.7.0/test/gtest_break_on_failure_unittest_.cc
  180. +237 −0 gtest-1.7.0/test/gtest_catch_exceptions_test.py
  181. +311 −0 gtest-1.7.0/test/gtest_catch_exceptions_test_.cc
  182. +130 −0 gtest-1.7.0/test/gtest_color_test.py
  183. +71 −0 gtest-1.7.0/test/gtest_color_test_.cc
  184. +103 −0 gtest-1.7.0/test/gtest_env_var_test.py
  185. +126 −0 gtest-1.7.0/test/gtest_env_var_test_.cc
  186. +192 −0 gtest-1.7.0/test/gtest_environment_test.cc
  187. +633 −0 gtest-1.7.0/test/gtest_filter_unittest.py
  188. +140 −0 gtest-1.7.0/test/gtest_filter_unittest_.cc
  189. +172 −0 gtest-1.7.0/test/gtest_help_test.py
  190. +46 −0 gtest-1.7.0/test/gtest_help_test_.cc
  191. +207 −0 gtest-1.7.0/test/gtest_list_tests_unittest.py
  192. +157 −0 gtest-1.7.0/test/gtest_list_tests_unittest_.cc
  193. +45 −0 gtest-1.7.0/test/gtest_main_unittest.cc
  194. +56 −0 gtest-1.7.0/test/gtest_no_test_unittest.cc
  195. +335 −0 gtest-1.7.0/test/gtest_output_test.py
  196. +1,034 −0 gtest-1.7.0/test/gtest_output_test_.cc
  197. +720 −0 gtest-1.7.0/test/gtest_output_test_golden_lin.txt
  198. +2,427 −0 gtest-1.7.0/test/gtest_pred_impl_unittest.cc
  199. +141 −0 gtest-1.7.0/test/gtest_premature_exit_test.cc
  200. +57 −0 gtest-1.7.0/test/gtest_prod_test.cc
  201. +253 −0 gtest-1.7.0/test/gtest_repeat_test.cc
  202. +325 −0 gtest-1.7.0/test/gtest_shuffle_test.py
  203. +103 −0 gtest-1.7.0/test/gtest_shuffle_test_.cc
  204. +57 −0 gtest-1.7.0/test/gtest_sole_header_test.cc
  205. +256 −0 gtest-1.7.0/test/gtest_stress_test.cc
  206. +320 −0 gtest-1.7.0/test/gtest_test_utils.py
  207. +92 −0 gtest-1.7.0/test/gtest_throw_on_failure_ex_test.cc
  208. +171 −0 gtest-1.7.0/test/gtest_throw_on_failure_test.py
  209. +72 −0 gtest-1.7.0/test/gtest_throw_on_failure_test_.cc
  210. +70 −0 gtest-1.7.0/test/gtest_uninitialized_test.py
  211. +43 −0 gtest-1.7.0/test/gtest_uninitialized_test_.cc
  212. +7,415 −0 gtest-1.7.0/test/gtest_unittest.cc
  213. +49 −0 gtest-1.7.0/test/gtest_xml_outfile1_test_.cc
  214. +49 −0 gtest-1.7.0/test/gtest_xml_outfile2_test_.cc
  215. +132 −0 gtest-1.7.0/test/gtest_xml_outfiles_test.py
  216. +307 −0 gtest-1.7.0/test/gtest_xml_output_unittest.py
  217. +181 −0 gtest-1.7.0/test/gtest_xml_output_unittest_.cc
  218. +194 −0 gtest-1.7.0/test/gtest_xml_test_utils.py
  219. +36 −0 gtest-1.7.0/test/production.cc
  220. +55 −0 gtest-1.7.0/test/production.h
  221. +30 −0 gtest-1.7.0/xcode/Config/DebugProject.xcconfig
  222. +17 −0 gtest-1.7.0/xcode/Config/FrameworkTarget.xcconfig
  223. +41 −0 gtest-1.7.0/xcode/Config/General.xcconfig
  224. +32 −0 gtest-1.7.0/xcode/Config/ReleaseProject.xcconfig
  225. +18 −0 gtest-1.7.0/xcode/Config/StaticLibraryTarget.xcconfig
  226. +8 −0 gtest-1.7.0/xcode/Config/TestTarget.xcconfig
  227. +30 −0 gtest-1.7.0/xcode/Resources/Info.plist
  228. +28 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/Info.plist
  229. +457 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj
  230. +62 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/runtests.sh
  231. +63 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/widget.cc
  232. +59 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/widget.h
  233. +68 −0 gtest-1.7.0/xcode/Samples/FrameworkSample/widget_test.cc
  234. +65 −0 gtest-1.7.0/xcode/Scripts/runtests.sh
  235. +100 −0 gtest-1.7.0/xcode/Scripts/versiongenerate.py
  236. +1,135 −0 gtest-1.7.0/xcode/gtest.xcodeproj/project.pbxproj
  237. +63 −0 nbproject/configurations.xml
  238. +26 −0 nbproject/project.xml
  239. +39 −0 test.h
  240. +17 −0 test.this.module.h
@@ -0,0 +1,4 @@
*fuse*
nbproject/private
*.o
*~*
@@ -0,0 +1,37 @@
CPP=g++
GTEST_DIR=./gtest-1.7.0
GTEST_LIB=$(GTEST_DIR)/gtest-all.o
INCLUDES=-I $(GTEST_DIR) \
-I . \
-isystem $(GTEST_DIR)/include
LIBS=$(GTEST_LIB)
OPT_LEVEL=-O0
CPPFLAGS=-g -pthread -D_DEBUG=1 -w -std=c++11 $(OPT_LEVEL) $(INCLUDES) $(LIBS)

PROGRAM=dynamicbitset_test

SRC=ds.DynamicBitset.cpp \
dynamicbitset_test.cpp

OBJ=$(SRC:.cpp=.o)


all : $(PROGRAM)

$(PROGRAM) : $(OBJ)
$(CPP) $(CPPFLAGS) -o $@ $(OBJ)

%.o : %.cpp %.h
$(CPP) $(CPPFLAGS) -c $< -o $@

clean:
@echo "Removing objects..."
rm -f $(PROGRAM) *.o *~

install: $(PROGRAM)
cp $(PROGRAM) ../bin

ar:
make clean
tar -czvf ../$(PROGRAM)"(`date`)".tar.gz *

4 README
@@ -0,0 +1,4 @@
Dynamic Bitset
==============

This is a C++ implementation of a simple bit-array where you can get/set/flip individual bits.
101 common.h
@@ -0,0 +1,101 @@
#pragma once


#ifdef _WIN32
//////////////// On Windows, CRT memory leak detection /////////////

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>


#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif // _DEBUG

// enable dumping memory leaks on Windows
#define DETECT_MEM_LEAKS() \
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF)

#else // Non-Windows systems

// no support for memory leak detection on Non-Windows systems
#define DETECT_MEM_LEAKS()

#endif // _WIN32


#include <cassert>

/*--------- Availability of Google C++ Test Framework ----------*/

// whether using Google C++ Test Framework
#ifndef GTEST
#define GTEST 1
#endif
// you have to include test.h when you want to test
#include "test.h"

namespace yasi{


#define CONCAT_DETAIL(x,y) x ## y
#define CONCAT(x,y) CONCAT_DETAIL(x,y)
#define MAKE_UNIQUE(x) CONCAT(x, __COUNTER__ )
#define MAKE_UNIQUE2(x,y) MAKE_UNIQUE( CONCAT(x,y) )
#define MAKE_UNIQUE3(x,y, z) MAKE_UNIQUE2( CONCAT(x,y), z )

#define FREE_SAFE(x) {if( (x) != 0 ) free(x); (x) = 0; }
#define DELETE_SAFE(x) {if( (x) != 0 ) delete (x); (x) = 0; }
#define FREE_SAFE(x) {if( (x) != 0 ) free(x); (x) = 0; }
#define DELETE_ARR_SAFE(x) {if( (x) != 0 ) delete[] (x); (x) = 0; }
#define ARR_LENGTH(x) ( sizeof( (x) )/sizeof( (x)[0] ) )

#define IS_POW_OF_TWO(x) ( ((x) >= 1) && ( ((x) & ((x)-1)) == 0) )

// override keyword in C++11
#if __STDC_VERSION__ == 201112L
#pragma message(TO_STRING(__STDC_VERSION__))
// C++11 supported
#define override override

#else
#define override

#endif // C++11 support

// informative assert
#define YASI_ASSERT_FAILED_STR "ASSERT FAILED"

#if _DEBUG


#define ASSERT(condition) { \
/* print better message */ \
if(!(condition)){ \
std::cerr << YASI_ASSERT_FAILED_STR << ": " << #condition << " @ " << __FILE__ << " (" << __LINE__ << ")" << std::endl; \
} \
/* now call actual assert macro */ \
assert(condition); \
}
#define ASSERTMSG(condition, msg) { \
/* print better message */ \
if(!(condition)){ \
std::cerr << YASI_ASSERT_FAILED_STR << ": " << #condition << " @ " << __FILE__ << " (" << __LINE__ << ")" << std::endl; \
std::cerr << "Message: " << msg; \
} \
/* now call actual assert macro */ \
assert(condition); \
}
#else // _DEBUG
#define ASSERT(condition)
#define ASSERTMSG(condition, msg)

#endif



} // namespace yasi
@@ -0,0 +1,17 @@
#include "ds.DynamicBitset.h"

namespace yasi{
namespace ds{
// override for printing
std::ostream& operator<< (std::ostream& out, const DynamicBitset* pK) {
out << pK->toString();
return out;
}
std::ostream& operator<< (std::ostream& out, const DynamicBitset& k) {
out << k.toString();
return out;
}

}
}

Oops, something went wrong.

0 comments on commit 78b590d

Please sign in to comment.
You can’t perform that action at this time.