summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/tutorials/Shapes/Shapes_asm/Shapes_Control_comp/src/Shapes_Control_comp_exec.h
blob: af65894f21eeb03c240561929dd855c3b1df25ff (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// -*- C++ -*-
/**
 * Code generated by the The ACE ORB (TAO) IDL Compiler v2.1.1
 * TAO and the TAO IDL Compiler have been developed by:
 *       Center for Distributed Object Computing
 *       Washington University
 *       St. Louis, MO
 *       USA
 *       http://www.cs.wustl.edu/~schmidt/doc-center.html
 * and
 *       Distributed Object Computing Laboratory
 *       University of California at Irvine
 *       Irvine, CA
 *       USA
 * and
 *       Institute for Software Integrated Systems
 *       Vanderbilt University
 *       Nashville, TN
 *       USA
 *       http://www.isis.vanderbilt.edu/
 *
 * Information about TAO is available at:
 *     http://www.dre.vanderbilt.edu/~schmidt/TAO.html
 **/
#ifndef CIAO_SHAPES_CONTROL_COMP_EXEC_WWONQX_H_
#define CIAO_SHAPES_CONTROL_COMP_EXEC_WWONQX_H_

#include /**/ "ace/pre.h"

#include "Shapes_Control_compEC.h"

#include /**/ "Shapes_Control_comp_exec_export.h"

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

#include "tao/LocalObject.h"

/// Namespace for implementation of Shapes::Control_comp component
namespace CIAO_Shapes_Control_comp_Impl
{
  class Control_comp_exec_i;

  //============================================================
  // pulse_Generator
  //============================================================
  class pulse_Generator : public ACE_Event_Handler
  {
  public:
    pulse_Generator (Control_comp_exec_i &callback);

    virtual ~pulse_Generator ();

    virtual int handle_timeout (const ACE_Time_Value &tv,
                                const void *arg);
  private:
    Control_comp_exec_i &pulse_callback_;
  };

  /// Component Executor Implementation Class: Control_comp_exec_i
  class SHAPES_CONTROL_COMP_EXEC_Export Control_comp_exec_i
    : public virtual Control_comp_Exec,
      public virtual ::CORBA::LocalObject
  {
  public:
    /// Constructor
    Control_comp_exec_i (void);
    /// Destructor
    virtual ~Control_comp_exec_i (void);

    /** @name Supported operations and attributes. */
    //@{

    //@}

    /** @name Component attributes and port operations. */
    //@{

    /// Getter for rate attribute
    /// @return value of rate attribute
    virtual ::CORBA::ULong rate (
      void);

    /// Setter for rate attribute
    /// @param[in] rate - New value for rate attribute
    virtual void rate (
      ::CORBA::ULong rate);

    /// Getter for max_x attribute
    /// @return value of max_x attribute
    virtual ::CORBA::UShort max_x (
      void);

    /// Setter for max_x attribute
    /// @param[in] max_x - New value for max_x attribute
    virtual void max_x (
      ::CORBA::UShort max_x);

    /// Getter for max_y attribute
    /// @return value of max_y attribute
    virtual ::CORBA::UShort max_y (
      void);

    /// Setter for max_y attribute
    /// @param[in] max_y - New value for max_y attribute
    virtual void max_y (
      ::CORBA::UShort max_y);

    /// Getter for max_size attribute
    /// @return value of max_size attribute
    virtual ::CORBA::UShort max_size (
      void);

    /// Setter for max_size attribute
    /// @param[in] max_size - New value for max_size attribute
    virtual void max_size (
      ::CORBA::UShort max_size);

    /// Getter for resize_shape attribute
    /// @return value of resize_shape attribute
    virtual ::CORBA::Boolean resize_shape (
      void);

    /// Setter for resize_shape attribute
    /// @param[in] resize_shape - New value for resize_shape attribute
    virtual void resize_shape (
      ::CORBA::Boolean resize_shape);
    //@}

    /** @name Session component operations */
    //@{

    /// Setter for container context for this component
    /// @param[in] ctx - Container context
    virtual void set_session_context (::Components::SessionContext_ptr ctx);

    /// Component state change method to configuration_complete state
    virtual void configuration_complete (void);

    /// Component state change method to activated state
    virtual void ccm_activate (void);

    /// Component state change method to passivated state
    virtual void ccm_passivate (void);

    /// Component state change method to removed state
    virtual void ccm_remove (void);
    //@}

    /** @name User defined public operations. */
    //@{
    void tick (void);
    //@}

  private:
    /// Context for component instance. Used for all middleware communication
    ::Shapes::CCM_Control_comp_Context_var ciao_context_;

    /** @name Component attributes. */
    //@{

    /// Class member storing value of rate attribute
    ::CORBA::ULong rate_;

    /// Class member storing value of max_x attribute
    ::CORBA::UShort max_x_;

    /// Class member storing value of max_y attribute
    ::CORBA::UShort max_y_;

    /// Class member storing value of max_size attribute
    ::CORBA::UShort max_size_;

    /// Class member storing value of resize_shape attribute
    ::CORBA::Boolean resize_shape_;
    //@}

    /** @name Component facets. */
    //@{
    //@}

    /** @name User defined members. */
    //@{
    bool x_increasing_;
    bool y_increasing_;
    bool size_increasing_;

    ::CORBA::UShort current_size_;
    ::CORBA::UShort current_x_;
    ::CORBA::UShort current_y_;

    pulse_Generator * ticker_;

    //@}

    /** @name User defined private operations. */
    //@{
    void start (void);
    void stop (void);
    //@}

    /// Get the ACE_Reactor
    /// @return non-owning pointer to reactor
    ACE_Reactor* reactor (void);
  };

  /// Factory method and library entry point used by the middleware
  /// @return new component instance
  extern "C"  SHAPES_CONTROL_COMP_EXEC_Export ::Components::EnterpriseComponent_ptr
  create_Shapes_Control_comp_Impl (void);
}

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

#endif /* ifndef */