# Poco::Data

# template < class C >

# class Column

Library: Data
Package: DataCore
Header: Poco/Data/Column.h

## Description

Column class is column data container. Data (a pointer to underlying STL container) is assigned to the class at construction time. Construction with null pointer is not allowed. This class owns the data assigned to it and deletes the storage on destruction.

## Member Summary

Member Functions: begin, data, end, length, name, operator =, operator [], position, precision, reset, rowCount, swap, type, value

## Types Aliases

### Container

using Container = C;

### ContainerPtr

using ContainerPtr = Poco::SharedPtr < C >;

### Iterator

using Iterator = typename C::const_iterator;

### RIterator

using RIterator = typename C::const_reverse_iterator;

### Size

using Size = typename C::size_type;

### Type

using Type = typename C::value_type;

## Constructors

### Column

Column(
const Column & col
);

Creates the Column.

### Column

Column(
Column && col
) noexcept;

Creates the Column.

### Column

Column(
const MetaColumn & metaColumn,
Container * pData
);

Creates the Column.

## Destructor

### ~Column

~Column();

Destroys the Column.

## Member Functions

### begin

Iterator begin() const;

Returns iterator pointing to the beginning of data storage vector.

### data

Container & data();

Returns reference to contained data.

### end

Iterator end() const;

Returns iterator pointing to the end of data storage vector.

### length

std::size_t length() const;

Returns column maximum length.

### name

const std::string & name() const;

Returns column name.

### operator =

Column & operator = (
const Column & col
);

Assignment operator.

### operator =

Column & operator = (
Column && col
) noexcept;

Assignment operator.

### operator []

const Type & operator[] (
std::size_t row
) const;

Returns the field value in specified row.

### position

std::size_t position() const;

Returns column position.

### precision

std::size_t precision() const;

Returns column precision. Valid for floating point fields only (zero for other data types).

### reset

void reset();

Clears and shrinks the storage.

### rowCount

Size rowCount() const;

Returns number of rows.

### swap

void swap(
Column & other
) noexcept;

Swaps the column with another one.

### type

MetaColumn::ColumnDataType type() const;

Returns column type.

### value

const Type & value(
std::size_t row
) const;

Returns the field value in specified row.