summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent_Test.h
blob: 907ceb162af379c18ed68a77236ce0093a87edb1 (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
64
65
66
// -*- C++ -*-
//=============================================================================
/**
 *  @file   FtRtEvent_Test.h
 *
 *  $Id$
 *
 *  @author Huang-Ming Huang <hh1@cse.wustl.edu>
 */
//=============================================================================

#ifndef FTRTEVENT_TEST_H
#define FTRTEVENT_TEST_H

#include "orbsvcs/RtecEventChannelAdminC.h"
#include "ace/SString.h"

namespace TAO_FTRTEC {
  class FTEC_Gateway;
}

struct Options
{
  ACE_Time_Value timer_interval;
  int num_iterations;
  int num_events;
  ACE_CString proxy_consumer_file;
};

class FtRtEvent_Test_Base
{
public:
  FtRtEvent_Test_Base();
  virtual ~FtRtEvent_Test_Base();

  int run(int argc, ACE_TCHAR** argv);
protected:
  CORBA::ORB_var orb_;
  RtecEventChannelAdmin::EventChannel_var channel_;
  TAO_FTRTEC::FTEC_Gateway* gateway_;
  int use_gateway_;
  Options options_;
private:
  int parse_args(int argc, ACE_TCHAR** argv 
                 ACE_ENV_ARG_DECL);
  RtecEventChannelAdmin::EventChannel_ptr
    get_event_channel(ACE_ENV_SINGLE_ARG_DECL);

  virtual int init(ACE_ENV_SINGLE_ARG_DECL)=0;
};

template <class T>
class FtRtEvent_Test : public FtRtEvent_Test_Base
{
  virtual int init();
  T client_;
};

template <class T>
int FtRtEvent_Test<T>::init(ACE_ENV_SINGLE_ARG_DECL)
{
  return client_.init(orb_.in(), channel_.in(), options_ 
                      ACE_ENV_ARG_PARAMETER);
}

#endif