Kea: user_chk::UserDataSource Class Reference

| Kea 3.2.0-git

user_chk::UserDataSource Class Referenceabstract

Defines an interface for reading user data into a registry. More...

`#include <user_data_source.h>`

Inheritance diagram for user_chk::UserDataSource:
[legend]

## Public Member Functions
| UserDataSource ()
| Constructor.
virtual | ~UserDataSource ()
| Virtual Destructor.
virtual void | close ()=0
| Closes that data source.
virtual bool | isOpen () const =0
| Returns true if the data source is open.
virtual void | open ()=0
| Opens the data source.
virtual UserPtr | readNextUser ()=0
| Fetches the next user from the data source.

## Detailed Description

Defines an interface for reading user data into a registry.

This is an abstract class which defines the interface for reading Users from an IO source such as a file.

Definition at line 26 of file user_data_source.h.

## Constructor & Destructor Documentation

## ◆ UserDataSource()

user_chk::UserDataSource::UserDataSource | ( |  | ) |
| inline

Constructor.

Definition at line 29 of file user_data_source.h.

## ◆ ~UserDataSource()

virtual user_chk::UserDataSource::~UserDataSource | ( |  | ) |
| inlinevirtual

Virtual Destructor.

Definition at line 32 of file user_data_source.h.

## Member Function Documentation

## ◆ close()

virtual void user_chk::UserDataSource::close | ( |  | ) |
| pure virtual

Closes that data source.

Closes the data source.

This method must not throw exceptions.

Implemented in user_chk::UserFile.

## ◆ isOpen()

virtual bool user_chk::UserDataSource::isOpen | ( |  | ) | const
| pure virtual

Returns true if the data source is open.

This method should return true once the data source has been successfully opened and until it has been closed.

It is assumed to be exception safe.

Implemented in user_chk::UserFile.

## ◆ open()

virtual void user_chk::UserDataSource::open | ( |  | ) |
| pure virtual

Opens the data source.

Prepares the data source for reading. Upon successful completion the data source is ready to read from the beginning of its content.

Exceptions

  UserDataSourceError | if the source fails to open.

Implemented in user_chk::UserFile.

## ◆ readNextUser()

virtual UserPtr user_chk::UserDataSource::readNextUser | ( |  | ) |
| pure virtual

Fetches the next user from the data source.

Reads the next User from the data source and returns it. If no more data is available it should return an empty (null) user.

Exceptions

  UserDataSourceError | if an error occurs.

Implemented in user_chk::UserFile.

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

- user_data_source.h