Class Poco::Data::AbstractSessionImpl
Author: Applied Informatics Software Engineering GmbH and Contributors
Date: 2009-11-24

# Poco::Data

# template < class C >

# class AbstractSessionImpl

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

## Description

A partial implementation of SessionImpl, providing features and properties management.

To implement a certain feature or property, a subclass must provide setter and getter methods and register them with addFeature() or addProperty().

## Inheritance

Direct Base Classes: SessionImpl

All Base Classes: SessionImpl, Poco::RefCountedObject

## Member Summary

Member Functions: addFeature, addProperty, getFeature, getProperty, setFeature, setProperty

Inherited Functions: begin, close, commit, createStatementImpl, duplicate, getFeature, getProperty, isConnected, isTransaction, referenceCount, release, rollback, setFeature, setProperty

## Types

### Poco::Any

typedef Poco::Any (C::* PropertyGetter)(const std::string &);

The getter method for a property.

### bool

typedef bool (C::* FeatureGetter)(const std::string &);

The getter method for a feature.

### void

typedef void (C::* FeatureSetter)(const std::string &, bool);

The setter method for a feature.

### void

typedef void (C::* PropertySetter)(const std::string &, const Poco::Any &);

The setter method for a property.

## Constructors

### AbstractSessionImpl

AbstractSessionImpl();

Creates the AbstractSessionImpl.

## Destructor

### ~AbstractSessionImpl

~AbstractSessionImpl();

Destroys the AbstractSessionImpl.

## Member Functions

### getFeature

bool getFeature(
const std::string & name
);

Looks a feature up in the features map and calls the feature's getter, if there is one.

See also: Poco::Data::SessionImpl::getFeature()

### getProperty

Poco::Any getProperty(
const std::string & name
);

Looks a property up in the properties map and calls the property's getter, if there is one.

See also: Poco::Data::SessionImpl::getProperty()

### setFeature

void setFeature(
const std::string & name,
bool state
);

Looks a feature up in the features map and calls the feature's setter, if there is one.

See also: Poco::Data::SessionImpl::setFeature()

### setProperty

void setProperty(
const std::string & name,
const Poco::Any & value
);

Looks a property up in the properties map and calls the property's setter, if there is one.

See also: Poco::Data::SessionImpl::setProperty()

### addFeature

void addFeature(
const std::string & name,
FeatureSetter setter,
FeatureGetter getter
);

Adds a feature to the map of supported features.

The setter or getter can be null, in case setting or getting a feature is not supported.

### addProperty

void addProperty(
const std::string & name,
PropertySetter setter,
PropertyGetter getter
);

Adds a property to the map of supported properties.

The setter or getter can be null, in case setting or getting a property is not supported.