/usr/include/polybori/BooleConstant.h is in libpolybori-dev 0.5~rc1-2.1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | // -*- c++ -*-
//*****************************************************************************
/** @file BooleConstant.h
*
* @author Alexander Dreyer
* @date 2008-03-05
*
* This file defines an intermediate class for handling bool and int values,
* which were not converted to Boolean polynomials or monomials yet.
*
* @par Copyright:
* (c) 2008 by The PolyBoRi Team
*
* @internal
* @version \$Id: BooleConstant.h,v 1.5 2008/07/08 21:41:58 alexanderdreyer Exp $
*
* @par History:
* @verbatim
* $Log: BooleConstant.h,v $
* Revision 1.5 2008/07/08 21:41:58 alexanderdreyer
* Merge: from developer's repository
*
* Revision 1.1 2008/03/05 16:23:37 dreyer
* CHANGE: BooleMonomial::variableBegin()|End(); monom/monom = 0 throws
*
* @endverbatim
**/
//*****************************************************************************
// include basic definitions
#include "pbori_defs.h"
#ifndef BooleConstant_h_
#define BooleConstant_h_
BEGIN_NAMESPACE_PBORI
/** @class BooleConstant
* @brief This class wraps a bool value, which was not converted to a boolean
* polynomial or monomial yet.
*
* @note This is mostly equivalent to the built-in type @c bool. Only conversion
* from ineger values to @c BooleConstant is nontrivial, as it involves the
* modulo 2 operation.
**/
class BooleConstant {
public:
/// Default constructor
BooleConstant(): m_value(false) {}
/// constructor for bool values
BooleConstant(bool value): m_value(value) {}
/// Cosntructor for integer values (nontrivial conversion)
BooleConstant(int value): m_value(value % 2) {}
/// Convert to bool value
operator bool() const { return m_value; }
/// Negation operation
BooleConstant operator!() const { return !m_value; }
protected:
/// Boolean value is stored as simple bool
const bool m_value;
};
/// Stream output operator
inline CTypes::ostream_type&
operator<<(CTypes::ostream_type& os, const BooleConstant& rhs) {
return (os << (int) rhs);
}
END_NAMESPACE_PBORI
#endif // BooleConstant_h_
|