From 1c996b5d95ce7858bb67927ea4b93760b2744480 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 7 Sep 2018 11:27:15 +0000 Subject: [PATCH] added the initial BitSet class without actual code --- qse/include/qse/cmn/Bitset.hpp | 50 +++++++++++++++++++++++++++++++++ qse/include/qse/cmn/Makefile.am | 1 + qse/include/qse/cmn/Makefile.in | 9 +++--- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 qse/include/qse/cmn/Bitset.hpp diff --git a/qse/include/qse/cmn/Bitset.hpp b/qse/include/qse/cmn/Bitset.hpp new file mode 100644 index 00000000..6cf4ac13 --- /dev/null +++ b/qse/include/qse/cmn/Bitset.hpp @@ -0,0 +1,50 @@ +/* + * $Id$ + * + Copyright (c) 2006-2014 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _QSE_CMN_BITSET_HPP_ +#define _QSE_CMN_BITSET_HPP_ + + +///////////////////////////////// +QSE_BEGIN_NAMESPACE(QSE) +///////////////////////////////// + +template +class Bitset +{ +public: + static const int NW = (NB - 1) / (QSE_SIZEOF(qse_size_t) * 8) + 1; + + +protected: + qse_size_t _w[NW]; +}; + +///////////////////////////////// +QSE_END_NAMESPACE(QSE) +///////////////////////////////// + +#endif diff --git a/qse/include/qse/cmn/Makefile.am b/qse/include/qse/cmn/Makefile.am index 3bc717db..2a51f229 100644 --- a/qse/include/qse/cmn/Makefile.am +++ b/qse/include/qse/cmn/Makefile.am @@ -44,6 +44,7 @@ pkginclude_HEADERS += \ Array.hpp \ Association.hpp \ BinaryHeap.hpp \ + Bitset.hpp \ HashList.hpp \ HashTable.hpp \ HeapMmgr.hpp \ diff --git a/qse/include/qse/cmn/Makefile.in b/qse/include/qse/cmn/Makefile.in index 0468ae4a..23dd1177 100644 --- a/qse/include/qse/cmn/Makefile.in +++ b/qse/include/qse/cmn/Makefile.in @@ -91,6 +91,7 @@ host_triplet = @host@ @ENABLE_CXX_TRUE@ Array.hpp \ @ENABLE_CXX_TRUE@ Association.hpp \ @ENABLE_CXX_TRUE@ BinaryHeap.hpp \ +@ENABLE_CXX_TRUE@ Bitset.hpp \ @ENABLE_CXX_TRUE@ HashList.hpp \ @ENABLE_CXX_TRUE@ HashTable.hpp \ @ENABLE_CXX_TRUE@ HeapMmgr.hpp \ @@ -149,10 +150,10 @@ am__pkginclude_HEADERS_DIST = alg.h arr.h chr.h cp949.h cp950.h dll.h \ main.h map.h mb8.h mbwc.h mem.h oht.h opt.h path.h pma.h rbt.h \ rex.h sll.h slmb.h str.h time.h tmr.h tre.h test.h uni.h uri.h \ utf8.h xma.h Array.hpp Association.hpp BinaryHeap.hpp \ - HashList.hpp HashTable.hpp HeapMmgr.hpp LinkedList.hpp \ - Mmged.hpp Mmgr.hpp Mpool.hpp Named.hpp RedBlackTree.hpp \ - RedBlackTable.hpp ScopedPtr.hpp SharedPtr.hpp StrBase.hpp \ - String.hpp StdMmgr.hpp Transmittable.hpp + Bitset.hpp HashList.hpp HashTable.hpp HeapMmgr.hpp \ + LinkedList.hpp Mmged.hpp Mmgr.hpp Mpool.hpp Named.hpp \ + RedBlackTree.hpp RedBlackTable.hpp ScopedPtr.hpp SharedPtr.hpp \ + StrBase.hpp String.hpp StdMmgr.hpp Transmittable.hpp am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \