SheafSystem  0.0.0.0
sheaf::block< T > Class Template Reference

An auto_block with a no-initialization initialization policy. More...

#include <block.h>

Inheritance diagram for sheaf::block< T >:
sheaf::auto_block< T, un_block_initialization_policy< T > > sheaf::binary_index_block< T > sheaf::wsv_block< T >

Public Types

typedef auto_block< T, un_block_initialization_policy< T > > base_type
 
typedef base_type::index_type index_type
 
typedef base_type::size_type size_type
 
- Public Types inherited from sheaf::auto_block< T, un_block_initialization_policy< T > >
typedef T value_type
 The type of value stored in the container. More...
 
typedef un_block_initialization_policy< T > initialization_policy
 The value initialization policy. More...
 
typedef T & reference_type
 A type that behaves as a reference to the container's value type. More...
 
typedef const T & const_reference_type
 A type that behaves as a const reference to the container's value type. More...
 
typedef T * pointer_type
 A type that behaves as a pointer to the container's value type. More...
 
typedef const T * const_pointer_type
 A type that behaves as a const pointer to the container's value type. More...
 
typedef sheaf::pod_index_type index_type
 The containers index type. More...
 
typedef signed long int difference_type
 A signed integral type used to represent the difference of two indices or iterators. More...
 
typedef unsigned long int size_type
 An unsigned integral type used to represent sizes and capacities. More...
 

Public Member Functions

 block (index_type xub=0)
 Creates an instance with ub() == xub; storage is uninitialized. More...
 
 block (index_type xub, size_type xct, const T *xitems)
 Creates an instance with ub() == xub; storage is initialized with xct items copied from xitems. More...
 
 block (const block &xother)
 Copy constructor. More...
 
blockoperator= (const block &xother)
 Assignment operator. More...
 
 ~block ()
 Destructor. More...
 
- Public Member Functions inherited from sheaf::auto_block< T, un_block_initialization_policy< T > >
pointer_type base () const
 The underlying storage array. More...
 
size_type ct () const
 The number of items currently in use. More...
 
bool invariant () const
 The class invariant. More...
 
reference_type item (index_type xindex) const
 The item at index xindex. More...
 
reference_type operator[] (index_type xindex) const
 The item at index xindex. More...
 
index_type ub () const
 The upper bound on the storage array. The number of items current allocated in the storage array. More...
 
 auto_block (index_type xub=0)
 Creates an instance with ub() == xub; storage is uninitialized. More...
 
 auto_block (index_type xub, size_type xct, const T *xitems)
 Creates an instance with ub() == xub; storage is initialized with xct items copied from xitems. More...
 
 auto_block (const auto_block &xother)
 Copy constructor. More...
 
auto_blockoperator= (const auto_block &xother)
 Assignment operator. More...
 
virtual ~auto_block ()
 Destructor. More...
 
void force_item (index_type xindex, const_reference_type xitem)
 Puts the item xitem at index xindex, resizing if necessary; any other new storage allocated is uninitialized. More...
 
void reserve (index_type xub)
 Makes ub() at least xub; if new storage is allocated, it is uninitialized. More...
 
void set_ct (size_type xct)
 Sets ct() == xct. More...
 
void set_item (index_type xindex, const_reference_type xitem)
 Puts the item xitem at index xindex, but will not resize. More...
 
void assign (const_reference_type xitem)
 Sets the values of all items to xitem. More...
 
void assign (index_type xbegin, index_type xend, const_reference_type xitem)
 Sets the values of items with xbegin <= index < xend to xitem. More...
 
reference_type back () const
 The last item in the auto_block. More...
 
void push_back (const_reference_type item)
 Insert item at the end of the items in the auto_block. More...
 
void push_back (const auto_block &xother)
 Appends xother to the back of this. More...
 
void pop_back ()
 Remove item at the back. More...
 
void clear ()
 Remove all items. More...
 
void initialize (index_type xindex)
 Invokes the initialization policy on the item at xindex. More...
 
void initialize (index_type xbegin, index_type xend)
 Invokes the initialization policy on the range [xbegin, xend). More...
 

Additional Inherited Members

- Protected Attributes inherited from sheaf::auto_block< T, un_block_initialization_policy< T > >
pointer_type _base
 Start of storage for this. More...
 
index_type _ub
 The index upper bound. More...
 
size_type _ct
 The number of items currently stored. More...
 

Detailed Description

template<typename T>
class sheaf::block< T >

An auto_block with a no-initialization initialization policy.

Definition at line 41 of file section_evaluator.h.

Constructor & Destructor Documentation

◆ block() [1/3]

template<typename T >
sheaf::block< T >::block ( index_type  xub = 0)

Creates an instance with ub() == xub; storage is uninitialized.

Precondition
  • precondition_of(auto_block(xub))
Postcondition
  • postcondition_of(auto_block(xub))

Definition at line 42 of file block.impl.h.

Referenced by sheaf::binary_index_block< T >::binary_index_block(), and sheaf::id_block::is_member_hub_id_space().

◆ block() [2/3]

template<typename T>
sheaf::block< T >::block ( index_type  xub,
size_type  xct,
const T *  xitems 
)

Creates an instance with ub() == xub; storage is initialized with xct items copied from xitems.

Precondition
  • precondition_of(auto_block(xub, xct, xitems))
Postcondition
  • postcondition_of(auto_block(xub, xct, xitems))

Definition at line 62 of file block.impl.h.

◆ block() [3/3]

template<typename T>
sheaf::block< T >::block ( const block< T > &  xother)

Copy constructor.

Precondition
  • precondition_of(auto_block(xother))
Postcondition
  • postcondition_of(auto_block(xother))

Definition at line 80 of file block.impl.h.

◆ ~block()

template<typename T >
sheaf::block< T >::~block ( )

Destructor.

Definition at line 122 of file block.impl.h.

Member Function Documentation

◆ operator=()

template<typename T >
block< T > & sheaf::block< T >::operator= ( const block< T > &  xother)

Assignment operator.

Precondition
  • precondition_of(auto_block::operator=(xother))
Postcondition
  • postcondition_of(auto_block::operator=(xother))

Definition at line 99 of file block.impl.h.

Referenced by sheaf::binary_index_block< T >::operator=(), and sheaf::id_block::operator=().


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