summaryrefslogtreecommitdiff
path: root/riff/DutManager.h
blob: 6a8009d9e1528583399e7b940e7a1ef31cb02982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * DUTManager.h
 *
 * Copyright (C) ST-Ericsson SA 2011
 * Authors: Srimanta Panda <srimanta.panda@stericsson.com>,
 *          Ola Borgelin <ola.borgelin@stericsson.com>,
 *          Karin Hedlund <karin.hedlund@stericsson.com>,
 *          Markus Andersson <markus.m.andersson@stericsson.com> for ST-Ericsson.
 * License terms: 3-clause BSD license
 *
 */

/*
 * @addtogroup DUT Manager
 * @{
 */

#pragma once

#include "DUT.h"
#include "CDAL.h"
#include "Logger.h"
#include <vector>

class DutManager
{
public:
    /**
     * @brief Creates new DUT instance, starts execution and adds the DUT in the list of active devices.
     *
     * @param[in] Device_t - Communication device on which the DUT will be created.
     *
     */
    static DUT* createDut(Device_t device);

    /**
     * @brief Get the DUT instance that is associated with the connected devices..
     *
     * @param[in] Device_t - Communication device.
     * @return    DUT*     - pointer to the DUT.
     * @return    0        - if the DUT can't be find in the list.
     */
    static const DUT* getDut(Device_t device);

    /**
     * @brief Destroys the DUT instance that is associated with the communication device.
     *
     * @param[in] Device_t - Communication device.
     */
    static void destroyDut(Device_t device);

private:
    DutManager();
    ~DutManager();

    /*list of connected devices*/
    static std::vector<DUT*> devices_;

    static std::string getDutId(Device_t device);
};

/* @} */