Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
geo::details::GeoContainerData< T > Class Template Reference

#include <GeometryDataContainers.h>

Public Types

using index_type = size_type
 Type used internally (so far) for indexing. More...
 
STL container types.
using value_type = typename Container_t::value_type
 
using reference = typename Container_t::reference
 
using const_reference = typename Container_t::const_reference
 
using pointer = typename Container_t::pointer
 
using const_pointer = typename Container_t::const_pointer
 
using iterator = typename Container_t::iterator
 
using const_iterator = typename Container_t::const_iterator
 
using reverse_iterator = typename Container_t::reverse_iterator
 
using const_reverse_iterator = typename Container_t::const_reverse_iterator
 
using difference_type = typename Container_t::difference_type
 
using size_type = typename Container_t::size_type
 

Public Member Functions

 GeoContainerData ()=default
 Default constructor with empty container. Good for nothing. More...
 
 GeoContainerData (size_type size)
 Prepares the container with default-constructed data. More...
 
 GeoContainerData (size_type size, value_type const &defValue)
 
Container status query
size_type size () const
 Returns the number of elements in the container. More...
 
size_type capacity () const
 Returns the number of elements the container has memory for. More...
 
bool empty () const
 Returns whether the container has no elements (false by assumptions). More...
 
Data modification

In general, each single element can be accessed and changed. In addition, this section includes methods acting on multiple elements at once.

void fill (value_type value)
 Sets all elements to the specified value (copied). More...
 
void reset ()
 Sets all the elements to a default-constructed value_type. More...
 
template<typename Op >
Op apply (Op &&op)
 Applies an operation on all elements. More...
 
template<typename Op >
Op apply (Op &&op) const
 Applies an operation on all elements. More...
 
Container modification
void resize (size_type size)
 Prepares the container with default-constructed data. More...
 
void resize (size_type size, value_type const &defValue)
 Prepares the container with copies of the specified default value. More...
 
void clear ()
 Makes the container empty, with no usable storage space. More...
 
Element access
reference operator[] (index_type index)
 Returns the element for the specified index. More...
 
const_reference operator[] (index_type index) const
 Returns the element for the specified index (read-only). More...
 
Iterators
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 

Static Public Member Functions

template<typename Value , typename Upper >
static bool bounded (Value v, Upper upper)
 Returns whether the specified value is between 0 and the upper limit. More...
 

Private Types

using Container_t = std::vector< T >
 

Private Attributes

Container_t fData
 Data storage area. More...
 

Detailed Description

template<typename T>
class geo::details::GeoContainerData< T >

Definition at line 48 of file GeometryDataContainers.h.

Member Typedef Documentation

template<typename T>
using geo::details::GeoContainerData< T >::const_iterator = typename Container_t::const_iterator

Definition at line 1036 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::const_pointer = typename Container_t::const_pointer

Definition at line 1034 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::const_reference = typename Container_t::const_reference

Definition at line 1032 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::const_reverse_iterator = typename Container_t::const_reverse_iterator

Definition at line 1038 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::Container_t = std::vector<T>
private

Definition at line 1022 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::difference_type = typename Container_t::difference_type

Definition at line 1039 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::index_type = size_type

Type used internally (so far) for indexing.

Definition at line 1046 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::iterator = typename Container_t::iterator

Definition at line 1035 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::pointer = typename Container_t::pointer

Definition at line 1033 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::reference = typename Container_t::reference

Definition at line 1031 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::reverse_iterator = typename Container_t::reverse_iterator

Definition at line 1037 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::size_type = typename Container_t::size_type

Definition at line 1040 of file GeometryDataContainers.h.

template<typename T>
using geo::details::GeoContainerData< T >::value_type = typename Container_t::value_type

Definition at line 1030 of file GeometryDataContainers.h.

Constructor & Destructor Documentation

template<typename T>
geo::details::GeoContainerData< T >::GeoContainerData ( )
default

Default constructor with empty container. Good for nothing.

template<typename T>
geo::details::GeoContainerData< T >::GeoContainerData ( size_type  size)
inline

Prepares the container with default-constructed data.

Definition at line 1054 of file GeometryDataContainers.h.

1054 : fData(size) {}
size_type size() const
Returns the number of elements in the container.
Container_t fData
Data storage area.
template<typename T>
geo::details::GeoContainerData< T >::GeoContainerData ( size_type  size,
value_type const &  defValue 
)
inline

Definition at line 1057 of file GeometryDataContainers.h.

1058  : fData(size, defValue) {}
size_type size() const
Returns the number of elements in the container.
Container_t fData
Data storage area.

Member Function Documentation

template<typename T>
template<typename Op >
Op geo::details::GeoContainerData< T >::apply ( Op &&  op)
inline

Applies an operation on all elements.

Template Parameters
Optype of operation
Parameters
opOperation
Returns
the operation object after operations took place

The operation op is a unary functor, i.e. an object that supports the call to op(value_type&).

The return values of op calls are discarded.

Definition at line 1109 of file GeometryDataContainers.h.

1110  { for (auto& data: fData) op(data); return op; }
Container_t fData
Data storage area.
template<typename T>
template<typename Op >
Op geo::details::GeoContainerData< T >::apply ( Op &&  op) const
inline

Applies an operation on all elements.

Template Parameters
Optype of operation
Parameters
opOperation
Returns
the operation object after operations took place

The operation op is a unary functor, i.e. an object that supports the call to op(value_type const&).

The return values of op calls are discarded.

Definition at line 1124 of file GeometryDataContainers.h.

1125  { for (auto const& data: fData) op(data); return op; }
Container_t fData
Data storage area.
template<typename T>
iterator geo::details::GeoContainerData< T >::begin ( )
inline

Definition at line 1191 of file GeometryDataContainers.h.

1191 { return fData.begin(); }
Container_t fData
Data storage area.
template<typename T>
const_iterator geo::details::GeoContainerData< T >::begin ( ) const
inline

Definition at line 1193 of file GeometryDataContainers.h.

1193 { return fData.begin(); }
Container_t fData
Data storage area.
template<typename T>
template<typename Value , typename Upper >
static bool geo::details::GeoContainerData< T >::bounded ( Value  v,
Upper  upper 
)
inlinestatic

Returns whether the specified value is between 0 and the upper limit.

Definition at line 1211 of file GeometryDataContainers.h.

1212  { return (v >= 0) && (static_cast<size_type>(v) < upper); }
typename Container_t::size_type size_type
template<typename T>
size_type geo::details::GeoContainerData< T >::capacity ( ) const
inline

Returns the number of elements the container has memory for.

Definition at line 1071 of file GeometryDataContainers.h.

1071 { return fData.capacity(); }
Container_t fData
Data storage area.
template<typename T>
const_iterator geo::details::GeoContainerData< T >::cbegin ( ) const
inline

Definition at line 1195 of file GeometryDataContainers.h.

1195 { return fData.cbegin(); }
Container_t fData
Data storage area.
template<typename T>
const_iterator geo::details::GeoContainerData< T >::cend ( ) const
inline

Definition at line 1196 of file GeometryDataContainers.h.

1196 { return fData.cend(); }
Container_t fData
Data storage area.
template<typename T>
void geo::details::GeoContainerData< T >::clear ( )
inline

Makes the container empty, with no usable storage space.

See also
resize()

The container needs to be resized before it is useful again.

Definition at line 1166 of file GeometryDataContainers.h.

1166 { fData.clear(); }
Container_t fData
Data storage area.
template<typename T>
const_reverse_iterator geo::details::GeoContainerData< T >::crbegin ( ) const
inline

Definition at line 1202 of file GeometryDataContainers.h.

1202 { return fData.crbegin(); }
Container_t fData
Data storage area.
template<typename T>
const_reverse_iterator geo::details::GeoContainerData< T >::crend ( ) const
inline

Definition at line 1203 of file GeometryDataContainers.h.

1203 { return fData.crend(); }
Container_t fData
Data storage area.
template<typename T>
bool geo::details::GeoContainerData< T >::empty ( ) const
inline

Returns whether the container has no elements (false by assumptions).

Definition at line 1074 of file GeometryDataContainers.h.

1074 { return fData.empty(); }
Container_t fData
Data storage area.
template<typename T>
iterator geo::details::GeoContainerData< T >::end ( )
inline

Definition at line 1192 of file GeometryDataContainers.h.

1192 { return fData.end(); }
Container_t fData
Data storage area.
template<typename T>
const_iterator geo::details::GeoContainerData< T >::end ( ) const
inline

Definition at line 1194 of file GeometryDataContainers.h.

1194 { return fData.end(); }
Container_t fData
Data storage area.
template<typename T>
void geo::details::GeoContainerData< T >::fill ( value_type  value)
inline

Sets all elements to the specified value (copied).

Definition at line 1091 of file GeometryDataContainers.h.

1092  { std::fill(fData.begin(), fData.end(), value); }
def fill(s)
Definition: translator.py:93
Container_t fData
Data storage area.
template<typename T>
reference geo::details::GeoContainerData< T >::operator[] ( index_type  index)
inline

Returns the element for the specified index.

Definition at line 1178 of file GeometryDataContainers.h.

1178 { return fData[index]; }
Container_t fData
Data storage area.
template<typename T>
const_reference geo::details::GeoContainerData< T >::operator[] ( index_type  index) const
inline

Returns the element for the specified index (read-only).

Definition at line 1181 of file GeometryDataContainers.h.

1181 { return fData[index]; }
Container_t fData
Data storage area.
template<typename T>
reverse_iterator geo::details::GeoContainerData< T >::rbegin ( )
inline

Definition at line 1198 of file GeometryDataContainers.h.

1198 { return fData.rbegin(); }
Container_t fData
Data storage area.
template<typename T>
const_reverse_iterator geo::details::GeoContainerData< T >::rbegin ( ) const
inline

Definition at line 1200 of file GeometryDataContainers.h.

1200 { return fData.rbegin(); }
Container_t fData
Data storage area.
template<typename T>
reverse_iterator geo::details::GeoContainerData< T >::rend ( )
inline

Definition at line 1199 of file GeometryDataContainers.h.

1199 { return fData.rend(); }
Container_t fData
Data storage area.
template<typename T>
const_reverse_iterator geo::details::GeoContainerData< T >::rend ( ) const
inline

Definition at line 1201 of file GeometryDataContainers.h.

1201 { return fData.rend(); }
Container_t fData
Data storage area.
template<typename T>
void geo::details::GeoContainerData< T >::reset ( )
inline

Sets all the elements to a default-constructed value_type.

Definition at line 1095 of file GeometryDataContainers.h.

1095 { fill(value_type{}); }
typename Container_t::value_type value_type
void fill(value_type value)
Sets all elements to the specified value (copied).
template<typename T>
void geo::details::GeoContainerData< T >::resize ( size_type  size)
inline

Prepares the container with default-constructed data.

Parameters
sizenumber of elements in the container
See also
clear(), fill()

The container is sized to host data for all the elements. Each new element in the container is default-constructed. Existing data is not touched.

Definition at line 1145 of file GeometryDataContainers.h.

1145 { fData.resize(size); }
size_type size() const
Returns the number of elements in the container.
Container_t fData
Data storage area.
template<typename T>
void geo::details::GeoContainerData< T >::resize ( size_type  size,
value_type const &  defValue 
)
inline

Prepares the container with copies of the specified default value.

Parameters
sizenumber of elements in the container
defValuethe value copied to fill all entries in the container
See also
clear(), fill()

The container is sized to host data for all the elements. Each new element in the container is constructed as copy of defValue. Existing data is not touched.

Definition at line 1157 of file GeometryDataContainers.h.

1158  { fData.resize(size, defValue); }
size_type size() const
Returns the number of elements in the container.
Container_t fData
Data storage area.
template<typename T>
size_type geo::details::GeoContainerData< T >::size ( void  ) const
inline

Returns the number of elements in the container.

Definition at line 1068 of file GeometryDataContainers.h.

1068 { return fData.size(); }
Container_t fData
Data storage area.

Member Data Documentation

template<typename T>
Container_t geo::details::GeoContainerData< T >::fData
private

Data storage area.

Definition at line 1216 of file GeometryDataContainers.h.


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