source: CMT/v1r19/source/cmt_project.h @ 3

Last change on this file since 3 was 3, checked in by arnault, 19 years ago

Various improvements - Introduction of CMTPROJECTPATH - see CL251

File size: 3.2 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// See the complete license in cmt_license.txt "http://www.cecill.info".
5//-----------------------------------------------------------
6
7#ifndef __cmt_project_h__
8#define __cmt_project_h__
9
10#include "cmt_parser.h"
11#include "cmt_system.h"
12#include "cmt_awk.h"
13
14class Project;
15
16class ProjectFactory : public IProjectFactory
17{
18public:
19  static IProjectFactory& instance ();
20
21public:
22  void reset ();
23  void create_project (const cmt_string& path,
24                       const cmt_string& path_source);
25
26private:
27  Project* m_first;
28  Project* m_previous;
29  int m_id;
30};
31
32class IProjectAction
33{
34public:
35  virtual bool run (const Project& project) = 0;
36};
37
38class Project
39{
40public:
41
42  typedef cmt_vector<Project> ProjectVector;
43
44  static void create (const cmt_string& name);
45
46  static Project* find_by_name (const cmt_string& name);
47  static Project* find_by_cmtpath (const cmt_string& cmtpath);
48  static Project* get_current ();
49  static Project* add (const cmt_string& name);
50
51  static ProjectVector& projects ();
52  static void clear_all ();
53  static void show_all ();
54  static void show_paths ();
55  static const cmt_string& get_project_file_name ();
56
57  static void fill_selection (int depth, CmtSystem::cmt_string_vector& path_selections);
58
59  static void broadcast (IProjectAction& action);
60  static void reverse_broadcast (IProjectAction& action);
61  static void scan_paths (PathScanner& scanner, PathScanner::actor& actor);
62  static void scan_paths_for_package (PathScanner& scanner, const cmt_string& name);
63
64  static cmt_string find_in_cmt_paths (const cmt_string& path);
65
66  static void set_cmtpaths (cmt_string& buffer);
67
68public:
69
70  Project ();
71
72  const cmt_string& get_name () const;
73  const cmt_string& get_cmtpath () const;
74  const cmt_string& get_cmtpath_pwd () const;
75  const cmt_string& get_cmtpath_source () const;
76  void set_name (const cmt_string& new_name);
77  void set_cmtpath (const cmt_string& path);
78  void set_cmtpath_pwd (const cmt_string& path);
79  void set_cmtpath_source (const cmt_string& source);
80  void set_predecessor (Project* predecessor);
81  void set_reference (Project* reference);
82  void clear ();
83  void configure ();
84
85  void use_action (const cmt_string& name, const cmt_string& release);
86
87  Project& operator = (const Project& other);
88  bool operator == (const cmt_string& name) const;
89  bool operator != (const cmt_string& name) const;
90
91  void show () const;
92  void show_strategies () const;
93  int get_build_strategy () const;
94  int get_setup_strategy () const;
95  void set_build_strategy (int mask, int strategy);
96  void set_setup_strategy (int mask, int strategy);
97
98private:
99  cmt_string m_name;
100
101  Project* m_reference;
102  Project* m_predecessor;
103
104  cmt_string m_cmtpath;
105  cmt_string m_cmtpath_pwd;
106  cmt_string m_cmtpath_source;
107
108  int m_build_strategy_mask;
109  int m_build_strategy;
110  int m_setup_strategy_mask;
111  int m_setup_strategy;
112
113  bool m_configured;
114
115  Tag* m_prototypes_tag;
116  Tag* m_no_prototypes_tag;
117  Tag* m_with_installarea_tag;
118  Tag* m_without_installarea_tag;
119
120  Tag* m_setup_config_tag;
121  Tag* m_setup_no_config_tag;
122  Tag* m_setup_root_tag;
123  Tag* m_setup_no_root_tag;
124  Tag* m_setup_cleanup_tag;
125  Tag* m_setup_no_cleanup_tag;
126
127};
128
129
130#endif
Note: See TracBrowser for help on using the repository browser.