summaryrefslogtreecommitdiff
path: root/TAO/examples/RTCORBA/Activity/Builder.h
blob: 20c001a498924a57c346c44d1e300274eb100d17 (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
/* -*- C++ -*- */
//=============================================================================
/**
 *  @file Builder.h
 *
 *  $Id$
 *
 *  The builder creates Tasks, Jobs, POAs.
 *
 *  @author Pradeep Gore <pradeep@cs.wustl.edu>
 */
//=============================================================================
#ifndef BUILDER_H
#define BUILDER_H

#include "orbsvcs/CosNamingC.h"
#include "tao/RTPortableServer/RTPortableServer.h"

#include "ace/Service_Config.h"
#include "ace/Service_Object.h"
#include "activity_export.h"


ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Arg_Shifter;
ACE_END_VERSIONED_NAMESPACE_DECL

class Activity;
class Periodic_Task;
class Job_i;
class POA_Holder;

typedef POA_Holder** POA_LIST;
typedef Periodic_Task** TASK_LIST;
typedef Job_i** JOB_LIST;

/**
 * @class Builder
 *
 * @brief A service object that creates Tasks, Jobs, POAs.
 *
 */
class activity_Export Builder : public ACE_Service_Object
{
 public:
  /// = Initialization and termination
  Builder ();
  ~Builder ();

  /// = Service_Object virtual method overloads.
  virtual int init (int argc, char *argv[]);
  virtual int fini (void);

  /// = List access
  int poa_list (POA_LIST& poa_list);
  int task_list (TASK_LIST& task_list);
  int job_list (JOB_LIST &job_list);

 protected:

  /// Number of POA's declared
  int poa_count_;

  /// The list of POA's.
  POA_LIST poa_list_;

  /// Number of Tasks's declared
  int task_count_;

  /// The list of Tasks.
  TASK_LIST task_list_;

  /// Number of Jobs's declared
  int job_count_;

  /// The list of Jobs
  JOB_LIST job_list_;
};

ACE_STATIC_SVC_DECLARE_EXPORT (activity, Builder)

ACE_FACTORY_DECLARE (activity, Builder)

#endif /* BUILDER_H */