summaryrefslogtreecommitdiff
path: root/CIAO/DAnCE/NodeApplication/Configurator_Factory.h
blob: d80f12c3cee11519bc0c0c13bdacf4fd3942c4b0 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Configurator_Factory.h
 *
 *  $Id$
 *
 *  Configurator Factory contains the factory method for creating concret
 *  NodeApp_Configurator object.
 *
 *  @author Nanbor Wang <nanbor@cs.wustl.edu>
 */
//=============================================================================


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

#include "CIAO_NodeApplication_export.h"

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

#include "tao/ORB_Core.h"
#include "tao/ORB.h"
#include "ace/Task.h"
#include "ace/SString.h"
#include "ace/Auto_Ptr.h"
#include "ace/DLL.h"
#include "NodeApp_Configurator.h"

namespace CIAO
{


  /**
   * @class NodeApplication_Options
   *
   * @brief An class for managing and extracting command line options
   * for NodeApplication.
   *
   * @note We currently support loading one single external module for
   * RT support.  Perhaps how this should really be done is to allow
   * the NodeApplication_Core to load up a list of external modules
   * (in DLLs or otherwise) and call the corresponding init methods in
   * sequence.   This way, we open up the component server so system
   * developers can plug in their own system configuration needs into
   * the whole system.
   */
  class NODEAPPLICATION_Export NodeApplication_Options
  {
  public:
    // default ctor.
    NodeApplication_Options () : use_callback_ (true), rt_support_ (false) {}

    /// extracting commandline arguments
    int parse_args (int &argc, char *argv[]);

    NodeApp_Configurator *create_nodeapp_configurator (void);

    bool use_callback () {return this->use_callback_; }

    bool rt_support () {return this->rt_support_; }

    int write_ior_file ()
    { return (this->ior_output_filename_.length () != 0); }

    const char *ior_output_filename ()
    { return this->ior_output_filename_.c_str (); }

    const char *callback_ior ()
    { return this->callback_ior_.c_str (); }

  private:
    /// The name of the file to write stringified IOR to.
    ACE_CString ior_output_filename_;

    /// Stringified IOR of a CIAO's callback object.
    ACE_CString callback_ior_;

    /// CIAO ComponentServer uses the callback object to pass it's
    /// own object reference back to NodeApplicationManager.
    bool use_callback_;

    /// If we need to support RT-CORBA.  Currently, this is
    /// mandatory, but we can probably allow some sort of
    /// "best-effort" RT support.  I.e., if the platform/environment
    /// doesn't support RT, then we will still deploy the NodeApp but
    /// ignore the RT spec.  Perhaps something in the future.
    bool rt_support_;

    // For managing dynamically loaded configurator library
    ACE_DLL config_dll_;
  };

}


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