summaryrefslogtreecommitdiff
path: root/TAO/examples/RTScheduling/POA_Holder.h
blob: b155203b515f9542eb2e82266e0d84d4dd088515 (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
//$Id$

/* -*- C++ -*- */
//=============================================================================
/**
 *  @file POA_Holder.h
 *
 *  $Id$
 *
 *  A helper to hold options for creating a POA.
 *
 *  @author Pradeep Gore <pradeep@cs.wustl.edu>
 */
//=============================================================================
#ifndef POA_HOLDER_H
#define POA_HOLDER_H

#include "tao/RTCORBA/RTCORBA.h"
#include "tao/PortableServer/PortableServer.h"
#include "ace/SString.h"

#include "ace/Arg_Shifter.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
//class ACE_TArg_Shifter<char>;
ACE_END_VERSIONED_NAMESPACE_DECL

/**
 * @class POA_Holder
 *
 * @brief An options holder for parameters to creating a poa.
 *
 */
class POA_Holder
{
public:
  /// Constructor
  POA_Holder (void);

  /// The arg_shifter options are read in the following manner:
  ///-POA <name> -PriorityModel <CLIENT|SERVER> <priority> -Lanes <count> (-Lane <priority> ,<static_threads> <dynamic_threads>)* -Bands <count> (-Band <low> <high>)*
  int init (ACE_TArg_Shifter<char>& arg_shifter);

  /// Activate the new POA using the parameters initialized before.
  void activate (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_poa
                 ACE_ENV_ARG_DECL);

 protected:
  /// = POA create options.
  ACE_CString POA_name_;
  RTCORBA::PriorityModel priority_model_;
  RTCORBA::Priority server_priority_;
  RTCORBA::ThreadpoolLanes lanes_;
  RTCORBA::PriorityBands bands_;
  int thread_pool_;
  CORBA::ULong tp_static_threads_;
  CORBA::ULong tp_dynamic_threads_;
  RTCORBA::Priority tp_priority_;
};

#endif /* POA_HOLDER_H */