Poco::Data

class AbstractExtraction

File Information

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

Description

AbstractExtraction is the interface class that connects output positions to concrete values retrieved via an AbstractExtractor.

Inheritance

Known Derived Classes: Extraction, BulkExtraction

Member Summary

Member Functions: canExtract, createPreparation, extract, getEmptyStringIsNull, getExtractor, getForceEmptyString, getLimit, isBulk, isNull, isValueNull, numOfColumnsHandled, numOfRowsAllowed, numOfRowsHandled, position, reset, setEmptyStringIsNull, setExtractor, setForceEmptyString, setLimit

Types Aliases

ExtractorPtr

using ExtractorPtr = SharedPtr < AbstractExtractor >;

PreparatorPtr

using PreparatorPtr = SharedPtr < AbstractPreparator >;

Ptr

using Ptr = SharedPtr < AbstractExtraction >;

Constructors

AbstractExtraction

AbstractExtraction(
    Poco::UInt32 limit = Limit::LIMIT_UNLIMITED,
    Poco::UInt32 position = 0,
    bool bulk = false
);

Creates the AbstractExtraction. A limit value equal to EXTRACT_UNLIMITED (0xffffffffu) means that we extract as much data as possible during one execute. Otherwise the limit value is used to partition data extracting to a limited amount of rows.

Destructor

~AbstractExtraction virtual

virtual ~AbstractExtraction();

Destroys the AbstractExtraction.

Member Functions

canExtract virtual inline

virtual bool canExtract() const;

Returns true. Implementations should override it for different behavior.

createPreparation virtual

virtual AbstractPreparation::Ptr createPreparation(
    PreparatorPtr & pPrep,
    std::size_t pos
) = 0;

Creates and returns shared pointer to Preparation object for the extracting object.

extract virtual

virtual std::size_t extract(
    std::size_t pos
) = 0;

Extracts a value from the param, starting at the given column position. Returns the number of rows extracted.

getEmptyStringIsNull inline

bool getEmptyStringIsNull() const;

Returns the empty string handling flag.

getExtractor inline

ExtractorPtr getExtractor() const;

Retrieves the extractor object

getForceEmptyString inline

bool getForceEmptyString() const;

Returns the force empty string flag.

getLimit inline

Poco::UInt32 getLimit() const;

Gets the limit.

isBulk inline

bool isBulk() const;

Returns true if this is bulk extraction.

isNull virtual inline

virtual bool isNull(
    std::size_t row
) const;

In implementations, this function returns true if value at row is null, false otherwise. Normal behavior is to replace nulls with default values. However, extraction implementations may remember the underlying database null values and be able to later provide information about them. Here, this function throws NotImplementedException.

isValueNull inline

template < typename T > bool isValueNull(
    const T & param155,
    bool deflt
);

Utility function to determine the nullness of the value. This generic version always returns default value (i.e. does nothing). The std::string overload does the actual work.

isValueNull

bool isValueNull(
    const std::string & str,
    bool deflt
);

Overload for const reference to std::string.

Returns true when folowing conditions are met:

- string is empty - getEmptyStringIsNull() returns true

isValueNull

bool isValueNull(
    const Poco::UTF16String & str,
    bool deflt
);

Overload for const reference to UTF16String.

Returns true when folowing conditions are met:

- string is empty - getEmptyStringIsNull() returns true

numOfColumnsHandled virtual

virtual std::size_t numOfColumnsHandled() const = 0;

Returns the number of columns that the extraction handles.

The trivial case will be one single column but when complex types are used this value can be larger than one.

numOfRowsAllowed virtual

virtual std::size_t numOfRowsAllowed() const = 0;

Returns the upper limit on number of rows that the extraction will handle.

numOfRowsHandled virtual

virtual std::size_t numOfRowsHandled() const = 0;

Returns the number of rows that the extraction handles.

The trivial case will be one single row but for collection data types (ie vector) it can be larger.

position inline

Poco::UInt32 position() const;

Returns the extraction position.

reset virtual inline

virtual void reset();

Resets the extractor so that it can be re-used. Does nothing in this implementation. Implementations should override it for different behavior.

setEmptyStringIsNull inline

void setEmptyStringIsNull(
    bool emptyStringIsNull
);

Sets the empty string handling flag.

setExtractor inline

void setExtractor(
    ExtractorPtr pExtractor
);

Sets the class used for extracting the data. Does not take ownership of the pointer.

setForceEmptyString inline

void setForceEmptyString(
    bool forceEmptyString
);

Sets the force empty string flag.

setLimit inline

void setLimit(
    Poco::UInt32 limit
);

Sets the limit.

Securely control IoT edge devices from anywhere   Connect a Device