library of assembled shared sources

http://lass.cocamware.com

bit_manip.h File Reference

#include "util_common.h"
#include "../num/basic_types.h"
#include "bit_manip.inl"
#include "../num/basic_types.h"

Include dependency graph for bit_manip.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Namespaces

namespace  lass
 Library for Assembled Shared Sources.
namespace  lass::util
 general utility, debug facilities, .

Functions

template<typename T >
void lass::util::setBit (T &a_bits, unsigned a_bit)
 Set a bit high.
template<typename T >
void lass::util::clearBit (T &a_bits, unsigned a_bit)
 set a bit low.
template<typename T >
void lass::util::flipBit (T &a_bits, unsigned a_bit)
 flip state of a bit (low->high, high->low).
template<typename T >
void lass::util::setBitIf (T &a_bits, unsigned a_bit, bool a_condition)
 set a bit high if (and only if) a condition is fullfilled.
template<typename T >
void lass::util::clearBitIf (T &a_bits, unsigned a_bit, bool a_condition)
 set a bit low if (and only if) a condition is fullfilled is true.
template<typename T >
void lass::util::flipBitIf (T &a_bits, unsigned a_bit, bool a_condition)
 flip a bit if (and only if) a condition is fullfilled (low->high, high->low).
template<typename T >
void lass::util::setBitTo (T &a_bits, unsigned a_bit, bool a_state)
 set a bit to a given state.
template<typename T >
bool lass::util::checkBit (T a_bits, unsigned a_bit)
 return true if a bit is set high.
template<typename T >
void lass::util::setMasked (T &a_bits, const T &a_mask)
 Set masked bits high.
template<typename T >
void lass::util::clearMasked (T &a_bits, const T &a_mask)
 Set masked bits low.
template<typename T >
void lass::util::flipMasked (T &a_bits, const T &a_mask)
 flip masked bits.
template<typename T >
void lass::util::setMaskedIf (T &a_bits, const T &a_mask, bool a_condition)
 Set masked bits high if (and only if) a condition is fullfilled.
template<typename T >
void lass::util::clearMaskedIf (T &a_bits, const T &a_mask, bool a_condition)
 Set masked bits low if (and only if) a condition is fullfilled.
template<typename T >
void lass::util::flipMaskedIf (T &a_bits, const T &a_mask, bool a_condition)
 Flip the masked bits if (and only if) a condition is fullfilled.
template<typename T >
void lass::util::setMaskedTo (T &a_bits, const T &a_mask, bool a_state)
 Set the masked bits to a given state if (and only if) a condition is fullfilled.
template<typename T >
bool lass::util::checkMaskedAll (T a_bits, const T &a_mask)
 Check the masked bits and return true if they are ALL set.
template<typename T >
bool lass::util::checkMaskedSome (T a_bits, const T &a_mask)
 Check the masked bits and return true if at least one is set.
template<typename T >
const size_t lass::util::countBits (T bits)
 returns number of set bits in bits


Detailed Description

Author:
Bram de Greve (bramz@users.sourceforge.net)

Tom De Muer (tomdemuer@users.sourceforge.net)

*** BEGIN LICENSE INFORMATION ***

The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://lass.sourceforge.net/cpal-license. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Original Code is LASS - Library of Assembled Shared Sources.

The Initial Developer of the Original Code is Bram de Greve and Tom De Muer. The Original Developer is the Initial Developer.

All portions of the code written by the Initial Developer are: Copyright (C) 2004-2007 the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the GPL), in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the GPL.

*** END LICENSE INFORMATION ***

Definition in file bit_manip.h.


Generated on Mon Nov 10 14:22:03 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo