Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / IFR_Service / be_global.h
blob74a71bc3b20c81e940ee9eef682ac20bc51f5a99
1 /* -*- c++ -*- */
3 //=============================================================================
4 /**
5 * @file be_global.h
7 * Header file for class containing compiler back end global data.
9 * @author Jeff Parsons <parsons@cs.wustl.edu>
11 //=============================================================================
14 #ifndef TAO_IFR_BE_GLOBAL_H
15 #define TAO_IFR_BE_GLOBAL_H
17 #include "TAO_IFR_BE_Export.h"
18 #include "tao/IFR_Client/IFR_BasicC.h"
19 #include "tao/ORB.h"
20 #include "ace/Containers.h"
21 #include "ace/SString.h"
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 # pragma once
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 class AST_Generator;
29 // Defines a class containing all back end global data.
31 class TAO_IFR_BE_Export BE_GlobalData
33 public:
34 // = TITLE
35 // BE_GlobalData
37 // = DESCRIPTION
38 // Storage of global data specific to the compiler back end
40 /// Constructor.
41 BE_GlobalData (void);
43 /// Destructor.
44 virtual ~BE_GlobalData (void);
46 // Data accessors.
48 bool removing (void) const;
49 void removing (bool value);
51 CORBA::ORB_ptr orb (void) const;
52 void orb (CORBA::ORB_ptr orb);
54 CORBA::Repository_ptr repository (void) const;
55 void repository (CORBA::Repository_ptr repo);
57 ACE_Unbounded_Stack<CORBA::Container_ptr> &ifr_scopes (void);
59 /// Cleanup function.
60 void destroy (void);
62 const char *filename (void) const;
63 void filename (char *fname);
65 bool enable_locking (void) const;
66 void enable_locking (bool value);
68 bool do_included_files (void) const;
69 void do_included_files (bool val);
71 bool allow_duplicate_typedefs () const;
72 void allow_duplicate_typedefs (bool val);
74 ACE_CString orb_args (void) const;
75 void orb_args (const ACE_CString& args);
77 /// Command line passed to ACE_Process::spawn. Different
78 /// implementations in IDL and IFR backends.
79 ACE_CString spawn_options (void);
81 /// Parse an argument that might affect the backend.
82 void parse_args (long &i, char **av);
84 private:
85 /// Are we removing IR objects from the repository?
86 bool removing_;
88 /// Reference to our ORB.
89 CORBA::ORB_var orb_;
91 /// Reference to the interface repository.
92 CORBA::Repository_var repository_;
94 /// Must be something unlikely to clash.
95 CORBA::String_var holding_scope_name_;
97 /// IR object scope stack.
98 ACE_Unbounded_Stack<CORBA::Container_ptr> ifr_scopes_;
100 /// Name of the IDL file we are processing.
101 char *filename_;
103 /// Option to lock at the IDL file level.
104 bool enable_locking_;
106 /// Option to process included IDL files.
107 bool do_included_files_;
109 /// Option to enable duplicate typedefs in parsed IDL.
110 bool allow_duplicate_typedefs_;
112 /// Holder for -ORB args saved and passed to DRV_fork.
113 ACE_CString orb_args_;
116 #endif /* TAO_IFR_BE_GLOBAL_H */