~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to testsuite/gtest/gtest_evemu_device.h

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file testsuite/geis2/gtest_evemu_device.h
 
3
 * @brief OO wrapper for a evemu device
 
4
 */
 
5
/*
 
6
 * Copyright 2012 Canonical Ltd.
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or modify it under
 
9
 * the terms of the GNU Lesser General Public License as published by the Free
 
10
 * Software Foundation; either version 3 of the License, or (at your option) any
 
11
 * later version.
 
12
 *
 
13
 * This library is distributed in the hope that it will be useful, but WITHOUT
 
14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
15
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 
16
 * details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
#ifndef TESTSUITE_GEIS2_GTEST_EVEMU_DEVICE_H_
 
22
#define TESTSUITE_GEIS2_GTEST_EVEMU_DEVICE_H_
 
23
 
 
24
extern "C" {
 
25
#include <evemu.h>
 
26
}
 
27
#include <string>
 
28
 
 
29
 
 
30
namespace Testsuite
 
31
{
 
32
 
 
33
class EvemuDevice
 
34
{
 
35
public:
 
36
  /**
 
37
   * Creates a wrapped evemu pseudodevice.
 
38
   * @param[in] propFilename  Names the evemy device properties file.
 
39
   *
 
40
   * @throws std::runtime_error on any failure.
 
41
   */
 
42
  EvemuDevice(const std::string& propFileName);
 
43
  ~EvemuDevice();
 
44
 
 
45
  /**
 
46
   * Gets the name of the device.
 
47
   */
 
48
  std::string
 
49
  name() const;
 
50
 
 
51
  /**
 
52
   * Plays a named evemu events fil on the wrapped device.
 
53
   * @param[in] eventsFilename  Names the events file.
 
54
   *
 
55
   * @throws std::runtime_error on any failure.
 
56
   */
 
57
  void
 
58
  play(const std::string& eventsFileName);
 
59
 
 
60
private:
 
61
  evemu_device* evemu_device_;
 
62
  int           evemu_fd_;
 
63
};
 
64
 
 
65
} // namespace Testsuite
 
66
 
 
67
#endif // TESTSUITE_GEIS2_GTEST_EVEMU_DEVICE_H_