summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/FTRT_Event_Service/Event_Service/FT_EventService.h
blob: 17c1063e01914b8848020345891b98b2d2273c73 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file   FT_EventService.h
 *
 *  $Id$
 *
 *  @author Huang-Ming Huang <hh1@cse.wustl.edu>
 */
//=============================================================================
#ifndef FT_EVENTSERVICE_H
#define FT_EVENTSERVICE_H

#include "orbsvcs/CosNamingC.h"
#include "orbsvcs/FtRtecEventChannelAdminC.h"
#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel.h"
#include "orbsvcs/FtRtEvent/EventChannel/FTEC_Become_Primary_Listener.h"
#include "orbsvcs/RtecSchedulerC.h"
#include "TP_Task.h"

namespace POA_RtecScheduler
{
    class Scheduler;
};

class FT_EventService : private TAO_FTEC_Become_Primary_Listener
{
public:
  FT_EventService();
  ~FT_EventService();

  int run(int argc, ACE_TCHAR* argv[]);

private:
  int parse_args (int argc, ACE_TCHAR* argv []);
  RtecScheduler::Scheduler_var 
    setup_scheduler(CosNaming::NamingContext_ptr naming_context
                    ACE_ENV_ARG_DECL);

  int report_factory(CORBA::ORB_ptr orb,
                   FtRtecEventChannelAdmin::EventChannel_ptr ec);
  virtual void become_primary();

  int global_scheduler_;
  // Should we use a global scheduler or a local one?
  POA_RtecScheduler::Scheduler *sched_impl_;
  // The Scheduler implementation.
  TAO_FTEC_Event_Channel::MEMBERSHIP membership_;
  CORBA::ORB_var orb_;
  TP_Task task_;
  int fault_no_;
};

#endif