LDMX Software
Public Member Functions | Public Attributes | List of all members
_private_bit_ref< _AP_W, _AP_S > Struct Template Reference

Bit reference Proxy class, which allows bit selection to be used as rvalue(for reading) and lvalue(for writing) More...

#include <ap_private.h>

Public Member Functions

INLINE _private_bit_ref (const _private_bit_ref< _AP_W, _AP_S > &ref)
 
INLINE _private_bit_ref (ap_private< _AP_W, _AP_S > &bv, int index=0)
 
INLINE operator bool () const
 
INLINE bool to_bool () const
 
template<typename T >
INLINE _private_bit_refoperator= (const T &val)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator== (const _private_bit_ref< _AP_W2, _AP_S2 > &op) const
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator!= (const _private_bit_ref< _AP_W2, _AP_S2 > &op) const
 
INLINE bool get () const
 
INLINE int length () const
 

Public Attributes

ap_private< _AP_W, _AP_S > & d_bv
 
int d_index
 

Detailed Description

template<int _AP_W, bool _AP_S>
struct _private_bit_ref< _AP_W, _AP_S >

Bit reference Proxy class, which allows bit selection to be used as rvalue(for reading) and lvalue(for writing)

Definition at line 6645 of file ap_private.h.

Constructor & Destructor Documentation

◆ _private_bit_ref() [1/2]

template<int _AP_W, bool _AP_S>
INLINE _private_bit_ref< _AP_W, _AP_S >::_private_bit_ref ( const _private_bit_ref< _AP_W, _AP_S > &  ref)
inline

Definition at line 6654 of file ap_private.h.

6655 : d_bv(ref.d_bv), d_index(ref.d_index) {}

◆ _private_bit_ref() [2/2]

template<int _AP_W, bool _AP_S>
INLINE _private_bit_ref< _AP_W, _AP_S >::_private_bit_ref ( ap_private< _AP_W, _AP_S > &  bv,
int  index = 0 
)
inline

Definition at line 6658 of file ap_private.h.

6659 : d_bv(bv), d_index(index) {
6660 _AP_WARNING(d_index < 0, "Index of bit vector (%d) cannot be negative.\n",
6661 d_index);
6662 _AP_WARNING(d_index >= _AP_W,
6663 "Index of bit vector (%d) out of range (%d).\n", d_index,
6664 _AP_W);
6665 }

Member Function Documentation

◆ get()

template<int _AP_W, bool _AP_S>
INLINE bool _private_bit_ref< _AP_W, _AP_S >::get ( ) const
inline

Definition at line 6775 of file ap_private.h.

6775{ return operator bool(); }

◆ length()

template<int _AP_W, bool _AP_S>
INLINE int _private_bit_ref< _AP_W, _AP_S >::length ( ) const
inline

Definition at line 6787 of file ap_private.h.

6787{ return 1; }

◆ operator bool()

template<int _AP_W, bool _AP_S>
INLINE _private_bit_ref< _AP_W, _AP_S >::operator bool ( ) const
inline

Definition at line 6667 of file ap_private.h.

6667{ return d_bv.get_bit(d_index); }

◆ operator!=()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_bit_ref< _AP_W, _AP_S >::operator!= ( const _private_bit_ref< _AP_W2, _AP_S2 > &  op) const
inline

Definition at line 6771 of file ap_private.h.

6771 {
6772 return get() != op.get();
6773 }

◆ operator=()

template<int _AP_W, bool _AP_S>
template<typename T >
INLINE _private_bit_ref & _private_bit_ref< _AP_W, _AP_S >::operator= ( const T &  val)
inline

Definition at line 6672 of file ap_private.h.

6672 {
6673 if (!!val)
6674 d_bv.set(d_index);
6675 else
6676 d_bv.clear(d_index);
6677 return *this;
6678 }

◆ operator==()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_bit_ref< _AP_W, _AP_S >::operator== ( const _private_bit_ref< _AP_W2, _AP_S2 > &  op) const
inline

Definition at line 6766 of file ap_private.h.

6766 {
6767 return get() == op.get();
6768 }

◆ to_bool()

template<int _AP_W, bool _AP_S>
INLINE bool _private_bit_ref< _AP_W, _AP_S >::to_bool ( ) const
inline

Definition at line 6669 of file ap_private.h.

6669{ return operator bool(); }

Member Data Documentation

◆ d_bv

template<int _AP_W, bool _AP_S>
ap_private<_AP_W, _AP_S>& _private_bit_ref< _AP_W, _AP_S >::d_bv

Definition at line 6649 of file ap_private.h.

◆ d_index

template<int _AP_W, bool _AP_S>
int _private_bit_ref< _AP_W, _AP_S >::d_index

Definition at line 6650 of file ap_private.h.


The documentation for this struct was generated from the following file: