summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/lib/Application_Command.h
blob: 527e2bc48448ef8348b178192621a014abe5c840 (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
67
68
69
70
71
72
73
74
/* -*- C++ -*- */
/**
 *  @file Application_Command.h
 *
 *  @author Pradeep Gore <pradeep@oomworks.com>
 */

#ifndef TAO_Notify_Tests_APPLICATION_COMMAND_H
#define TAO_Notify_Tests_APPLICATION_COMMAND_H
#include /**/ "ace/pre.h"

#include "notify_test_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/ORB.h"
#include "Command.h"

class TAO_Notify_Tests_Application_Command;

/**
 * @class TAO_Notify_Tests_Application_Command
 *
 * @brief Command to control the Application.
 */
class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Application_Command : public TAO_Notify_Tests_Command
{
public:
  /// Constructor
  TAO_Notify_Tests_Application_Command ();

  /// Destructor
  ~TAO_Notify_Tests_Application_Command ();

  /// Parse args and populate options.
  virtual void init (ACE_Arg_Shifter& arg_shifter);

  /// Execute the command.
  virtual void execute_i ();

  /// Get the command name.
  virtual const char* get_name ();
  static const char* name ();

protected:
  enum COMMAND
  {
    INIT,
    RUN,
    WAIT_FOR_EVENTS,
    SHUTDOWN,
    DUMP_STATE,
    SIGNAL_PEER,
    WAIT_TO_START
  };

  /// Flag used with the DUMP_STATE command that asks for all samples to be put into the
  /// output data file.
  int dump_samples_;

  ///= Handlers
  virtual void handle_init ();
  void handle_run ();
  void handle_wait_for_completion ();
  void handle_shutdown ();
  void handle_dump_stats ();
  void handle_signal_peer ();
  void handle_wait_to_start ();
};

#include /**/ "ace/post.h"
#endif /* TAO_Notify_Tests_APPLICATION_COMMAND_H */