~thomas-voss/biometryd/remove-obsolete-configuration-header

« back to all changes in this revision

Viewing changes to include/biometry/device.h

  • Committer: Thomas Voß
  • Date: 2016-05-02 06:16:01 UTC
  • Revision ID: thomas.voss@canonical.com-20160502061601-vqzwfw4c0rxfna04
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Thomas Voß <thomas.voss@canonical.com>
 
17
 *
 
18
 */
 
19
 
 
20
#ifndef BIOMETRY_DEVICE_H_
 
21
#define BIOMETRY_DEVICE_H_
 
22
 
 
23
#include <biometry/do_not_copy_or_move.h>
 
24
#include <biometry/visibility.h>
 
25
 
 
26
#include <iosfwd>
 
27
#include <memory>
 
28
#include <string>
 
29
 
 
30
namespace biometry
 
31
{
 
32
/// @cond
 
33
class Identifier;
 
34
class TemplateStore;
 
35
class Verifier;
 
36
/// @endcond
 
37
 
 
38
/// @brief Device models a biometric device.
 
39
class BIOMETRY_DLL_PUBLIC Device : public DoNotCopyOrMove
 
40
{
 
41
public:
 
42
    /// @brief Id is the unique name of a device.
 
43
    typedef std::string Id;
 
44
 
 
45
    /// @brief Descriptor bundles details about a device.
 
46
    class Descriptor : public DoNotCopyOrMove
 
47
    {
 
48
    public:
 
49
        // Safe us some typing.
 
50
        typedef std::shared_ptr<Descriptor> Ptr;
 
51
 
 
52
        /// @brief create returns an instance of the device.
 
53
        virtual std::shared_ptr<Device> create() = 0;
 
54
        /// @brief name returns the human-readable name of the device.
 
55
        virtual std::string name() const = 0;
 
56
        /// @brief author returns the name of the author of the device implementation.
 
57
        virtual std::string author() const = 0;
 
58
        /// @brief description returns a one-line summary of the device implementation.
 
59
        virtual std::string description() const = 0;
 
60
 
 
61
    protected:
 
62
        /// @cond
 
63
        Descriptor() = default;
 
64
        /// @endcond
 
65
    };
 
66
 
 
67
    /// @brief enroller returns a device-specific template_store implementation.
 
68
    virtual TemplateStore& template_store() = 0;
 
69
    /// @brief identifier returns a device-specific Identifier implementation.
 
70
    virtual Identifier& identifier() = 0;
 
71
    /// @brief verifier returns a device-specific Verifier implementation.
 
72
    virtual Verifier& verifier() = 0;
 
73
 
 
74
protected:
 
75
    /// @cond
 
76
    Device() = default;
 
77
    /// @endcond
 
78
};
 
79
}
 
80
 
 
81
#endif // BIOMETRY_DEVICE_H_