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

Whitespace-separated-value block; A block of objects of type T that can be conveniently initialized by a whitespace-separated list. More...

#include <wsv_block.h>

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

Public Member Functions

 wsv_block ()
 Default constructor. More...
 
 wsv_block (const wsv_block &xother)
 Copy constructor. More...
 
 ~wsv_block ()
 Destructor. More...
 
 wsv_block (const char *xlist)
 Creates an instance initialized from whitespace-separated list xlist. More...
 
 wsv_block (const std::string &xlist)
 Creates an instance initialized from whitespace-separated list xlist. More...
 
wsv_blockoperator= (const wsv_block &xother)
 Sets the contents of this to the contents of whitespace-separated list xlist. More...
 
wsv_blockoperator= (const std::string &xlist)
 Sets the contents of this to the contents of whitespace-separated list xlist. More...
 
wsv_blockoperator= (const char *xlist)
 Sets the contents of this to the contents of whitespace-separated list xlist. More...
 
bool invariant () const
 The class invariant. More...
 
void push_back (const wsv_block &xother)
 Appends xother to the back of this. More...
 
template<>
SHEAF_DLL_SPEC wsv_block< bool > & operator= (const std::string &xlist)
 
- Public Member Functions inherited from sheaf::block< T >
 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

- Public Types inherited from sheaf::block< T >
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...
 
- 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::wsv_block< T >

Whitespace-separated-value block; A block of objects of type T that can be conveniently initialized by a whitespace-separated list.

Definition at line 62 of file tuple.h.

Constructor & Destructor Documentation

◆ wsv_block() [1/4]

template<typename T >
sheaf::wsv_block< T >::wsv_block ( )

Default constructor.

Postcondition

Definition at line 52 of file wsv_block.impl.h.

Referenced by sheaf::wsv_block< int >::wsv_block().

◆ wsv_block() [2/4]

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

Copy constructor.

Precondition
  • precondition_of(block_xother)
Postcondition
  • postcondition_of(block(xother))

Definition at line 74 of file wsv_block.impl.h.

◆ ~wsv_block()

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

Destructor.

Definition at line 97 of file wsv_block.impl.h.

◆ wsv_block() [3/4]

template<typename T >
sheaf::wsv_block< T >::wsv_block ( const char *  xlist)

Creates an instance initialized from whitespace-separated list xlist.

Postcondition
  • strlen(xlist) > 0 ? this->ct() > 0 : true

Definition at line 103 of file wsv_block.impl.h.

◆ wsv_block() [4/4]

template<typename T >
sheaf::wsv_block< T >::wsv_block ( const std::string &  xlist)

Creates an instance initialized from whitespace-separated list xlist.

Postcondition
  • !xlist.empty() ? this->ct() > 0 : true

Definition at line 123 of file wsv_block.impl.h.

Member Function Documentation

◆ invariant()

template<typename T >
bool sheaf::wsv_block< T >::invariant ( ) const

The class invariant.

Definition at line 213 of file wsv_block.impl.h.

◆ operator=() [1/3]

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

Sets the contents of this to the contents of whitespace-separated list xlist.

Definition at line 144 of file wsv_block.impl.h.

◆ operator=() [2/3]

template<typename T >
wsv_block< T > & sheaf::wsv_block< T >::operator= ( const std::string &  xlist)

Sets the contents of this to the contents of whitespace-separated list xlist.

Postcondition
  • !xlist.empty() ? this->ct() > 0 : true

Definition at line 164 of file wsv_block.impl.h.

◆ operator=() [3/3]

template<typename T >
wsv_block< T > & sheaf::wsv_block< T >::operator= ( const char *  xlist)

Sets the contents of this to the contents of whitespace-separated list xlist.

Postcondition
  • strlen(xlist) > 0 ? this->ct() > 0 : true

Definition at line 192 of file wsv_block.impl.h.

◆ push_back()

template<typename T >
void sheaf::wsv_block< T >::push_back ( const wsv_block< T > &  xother)

Appends xother to the back of this.

Postcondition
  • this->ct() == old_ct + xother.ct()
  • for(int i = ( 0 ); i < ( xother.ct() ); ++ i ) ((*this)[i + old_ct] == xother[i])

Definition at line 231 of file wsv_block.impl.h.


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