Vcsn  2.8
Be Rational
vcsn::detail::wet_bitset Class Reference

Weighted set: labels are non-negative integers, weights are bools. More...

#include <wet.hh>

Collaboration diagram for vcsn::detail::wet_bitset:

Classes

struct  iterator_impl
 Iterator. More...
 

Public Types

using self_t = wet_bitset
 
using key_t = unsigned
 
using value_t = bool
 
using welement_t = welement< key_t, value_t >
 
using value_type = welement_t
 
using iterator = iterator_impl< value_type, set_t >
 Mutable iterator. More...
 
using const_iterator = iterator_impl< const value_type, const set_t >
 Const iterator. More...
 

Public Member Functions

 wet_bitset ()
 
 wet_bitset (size_t size)
 
 wet_bitset (std::initializer_list< value_type > p)
 
 wet_bitset (set_t &&set)
 
const set_tset () const
 
set_tset ()
 FIXME: Avoid this by exposing more interfaces. More...
 
void clear ()
 
bool empty () const
 
size_t size () const
 
auto begin () -> iterator
 
auto end () -> iterator
 
auto cbegin () const -> const_iterator
 
auto cend () const -> const_iterator
 
auto begin () const -> const_iterator
 
auto end () const -> const_iterator
 
void set (const key_t k, value_t v=true)
 
void set (const char k, value_t v=true)
 
void set (const iterator &, const value_t v=true)
 
auto erase (const_iterator pos) -> void
 
void erase (key_t k)
 
void erase (char k)
 
auto find (key_t k) const -> const_iterator
 
auto find (key_t k) -> iterator
 
auto find (char k) const -> const_iterator
 
auto find (char k) -> iterator
 
self_t operator- (const self_t &rhs) const
 Operators for when wet_bitset is used as a bitset. More...
 
self_t operator & (const self_t &rhs) const
 

Static Public Member Functions

static key_t key (char k)
 Special for char: map -1 to 255 (MAX_UCHAR), not MAX_INT. More...
 

Static Public Attributes

static constexpr wet_kind_t kind = wet_kind_t::bitset
 
static constexpr size_t npos = set_t::npos
 

Private Types

using set_t = boost::dynamic_bitset<>
 

Private Attributes

set_t set_
 

Friends

bool operator< (const self_t &lhs, const self_t &rhs)
 Allow wet_bitset to be used in containers. More...
 

Detailed Description

Weighted set: labels are non-negative integers, weights are bools.

Definition at line 549 of file wet.hh.

Member Typedef Documentation

◆ const_iterator

Const iterator.

Definition at line 692 of file wet.hh.

◆ iterator

Mutable iterator.

Definition at line 689 of file wet.hh.

◆ key_t

Definition at line 558 of file wet.hh.

◆ self_t

Definition at line 556 of file wet.hh.

◆ set_t

using vcsn::detail::wet_bitset::set_t = boost::dynamic_bitset<>
private

Definition at line 552 of file wet.hh.

◆ value_t

Definition at line 559 of file wet.hh.

◆ value_type

Definition at line 561 of file wet.hh.

◆ welement_t

Definition at line 560 of file wet.hh.

Constructor & Destructor Documentation

◆ wet_bitset() [1/4]

vcsn::detail::wet_bitset::wet_bitset ( )
inline

Definition at line 570 of file wet.hh.

◆ wet_bitset() [2/4]

vcsn::detail::wet_bitset::wet_bitset ( size_t  size)
inline

Definition at line 572 of file wet.hh.

◆ wet_bitset() [3/4]

vcsn::detail::wet_bitset::wet_bitset ( std::initializer_list< value_type p)
inline

Definition at line 576 of file wet.hh.

References vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ wet_bitset() [4/4]

vcsn::detail::wet_bitset::wet_bitset ( set_t &&  set)
inline

Definition at line 582 of file wet.hh.

Member Function Documentation

◆ begin() [1/2]

auto vcsn::detail::wet_bitset::begin ( ) -> iterator
inline

Definition at line 694 of file wet.hh.

◆ begin() [2/2]

auto vcsn::detail::wet_bitset::begin ( ) const -> const_iterator
inline

Definition at line 700 of file wet.hh.

◆ cbegin()

auto vcsn::detail::wet_bitset::cbegin ( ) const -> const_iterator
inline

Definition at line 697 of file wet.hh.

◆ cend()

auto vcsn::detail::wet_bitset::cend ( ) const -> const_iterator
inline

Definition at line 698 of file wet.hh.

◆ clear()

void vcsn::detail::wet_bitset::clear ( )
inline

Definition at line 597 of file wet.hh.

◆ empty()

bool vcsn::detail::wet_bitset::empty ( ) const
inline

Definition at line 602 of file wet.hh.

◆ end() [1/2]

auto vcsn::detail::wet_bitset::end ( ) -> iterator
inline

Definition at line 695 of file wet.hh.

◆ end() [2/2]

auto vcsn::detail::wet_bitset::end ( ) const -> const_iterator
inline

Definition at line 701 of file wet.hh.

◆ erase() [1/3]

auto vcsn::detail::wet_bitset::erase ( const_iterator  pos) -> void
inline

Definition at line 726 of file wet.hh.

◆ erase() [2/3]

void vcsn::detail::wet_bitset::erase ( key_t  k)
inline

Definition at line 732 of file wet.hh.

◆ erase() [3/3]

void vcsn::detail::wet_bitset::erase ( char  k)
inline

Definition at line 737 of file wet.hh.

◆ find() [1/4]

auto vcsn::detail::wet_bitset::find ( key_t  k) const -> const_iterator
inline

Definition at line 742 of file wet.hh.

◆ find() [2/4]

auto vcsn::detail::wet_bitset::find ( key_t  k) -> iterator
inline

Definition at line 751 of file wet.hh.

◆ find() [3/4]

auto vcsn::detail::wet_bitset::find ( char  k) const -> const_iterator
inline

Definition at line 760 of file wet.hh.

◆ find() [4/4]

auto vcsn::detail::wet_bitset::find ( char  k) -> iterator
inline

Definition at line 766 of file wet.hh.

◆ key()

static key_t vcsn::detail::wet_bitset::key ( char  k)
inlinestatic

Special for char: map -1 to 255 (MAX_UCHAR), not MAX_INT.

Definition at line 704 of file wet.hh.

◆ operator &()

self_t vcsn::detail::wet_bitset::operator& ( const self_t rhs) const
inline

Definition at line 778 of file wet.hh.

References set_.

◆ operator-()

self_t vcsn::detail::wet_bitset::operator- ( const self_t rhs) const
inline

Operators for when wet_bitset is used as a bitset.

Definition at line 773 of file wet.hh.

References set_.

◆ set() [1/5]

const set_t& vcsn::detail::wet_bitset::set ( ) const
inline

Definition at line 586 of file wet.hh.

◆ set() [2/5]

set_t& vcsn::detail::wet_bitset::set ( )
inline

FIXME: Avoid this by exposing more interfaces.

Definition at line 592 of file wet.hh.

◆ set() [3/5]

void vcsn::detail::wet_bitset::set ( const key_t  k,
value_t  v = true 
)
inline

Definition at line 709 of file wet.hh.

References vcsn::detail::void.

◆ set() [4/5]

void vcsn::detail::wet_bitset::set ( const char  k,
value_t  v = true 
)
inline

Definition at line 715 of file wet.hh.

References vcsn::detail::v.

◆ set() [5/5]

void vcsn::detail::wet_bitset::set ( const iterator ,
const value_t  v = true 
)
inline

Definition at line 721 of file wet.hh.

References vcsn::detail::void.

◆ size()

size_t vcsn::detail::wet_bitset::size ( ) const
inline

Definition at line 607 of file wet.hh.

Friends And Related Function Documentation

◆ operator<

bool operator< ( const self_t lhs,
const self_t rhs 
)
friend

Allow wet_bitset to be used in containers.

Definition at line 784 of file wet.hh.

Member Data Documentation

◆ kind

constexpr wet_kind_t vcsn::detail::wet_bitset::kind = wet_kind_t::bitset
static

Definition at line 557 of file wet.hh.

◆ npos

constexpr size_t vcsn::detail::wet_bitset::npos = set_t::npos
static

Definition at line 612 of file wet.hh.

◆ set_

set_t vcsn::detail::wet_bitset::set_
private

Definition at line 553 of file wet.hh.

Referenced by operator &(), and operator-().


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