summaryrefslogtreecommitdiff
path: root/test/functional/Test1/TestAppIntro.h
blob: de6aa0b5a8ae16da0c12b584674961abdef51b3a (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
#ifndef TEST_APP_INTRO_H
#define TEST_APP_INTRO_H

#include "TestAppIntroPrivate.h"
#include "../../../tools/generator_utils.h"

#include <iostream>
#include <cstdio>

using namespace std;

class TestAppIntro :
  public DBusCpp::Test::Com::Intro_proxy,
  public DBus::IntrospectableProxy,
  public DBus::ObjectProxy
{
public:
  TestAppIntro (DBus::Connection& connection, pthread_cond_t &condition, bool &testResult) :
    DBus::ObjectProxy (connection, "/DBusCpp/Test/Com/Intro", "DBusCpp.Test.Com.Intro"),
    mCondition (condition),
    mTestResult (testResult)
  {}

  void test1Result ()
  {
    cout << "Test1Result" << endl;
    mTestResult = true;
    pthread_cond_signal (&mCondition);
  }

  void testByteResult (const uint8_t& Byte)
  {
    printf ("TestByteResult: %d\n", Byte);
    mTestResult = true;
    pthread_cond_signal (&mCondition);
  }

private:
  pthread_cond_t &mCondition;
  bool &mTestResult;
};

#endif // TEST_COM_INTRO_H