stage_builder_task.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_STAGE_BUILDER_TASK_HH
00021 #define PALUDIS_GUARD_PALUDIS_STAGE_BUILDER_TASK_HH 1
00022
00023 #include <paludis/util/instantiation_policy.hh>
00024 #include <paludis/util/private_implementation_pattern.hh>
00025 #include <paludis/util/exception.hh>
00026 #include <paludis/util/wrapped_forward_iterator-fwd.hh>
00027 #include <tr1/memory>
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 namespace paludis
00040 {
00041
00042
00043
00044
00045
00046
00047
00048 class PALUDIS_VISIBLE StageBuildError :
00049 public Exception
00050 {
00051 public:
00052
00053
00054
00055
00056
00057 StageBuildError(const std::string & message) throw ();
00058 };
00059
00060 #include <paludis/stage_options-sr.hh>
00061
00062
00063
00064
00065
00066
00067
00068
00069 class PALUDIS_VISIBLE StageBase
00070 {
00071 public:
00072 virtual ~StageBase();
00073
00074
00075 virtual int build(const StageOptions &) const = 0;
00076
00077
00078 virtual std::string description() const = 0;
00079
00080
00081 virtual bool is_rebuild() const = 0;
00082
00083
00084 virtual std::string short_name() const = 0;
00085 };
00086
00087
00088
00089
00090
00091
00092
00093 class PALUDIS_VISIBLE StageBuilderTask :
00094 PrivateImplementationPattern<StageBuilderTask>,
00095 InstantiationPolicy<StageBuilderTask, instantiation_method::NonCopyableTag>
00096 {
00097 protected:
00098
00099
00100
00101 StageBuilderTask(const StageOptions &);
00102
00103
00104
00105 public:
00106
00107
00108
00109 virtual ~StageBuilderTask();
00110
00111
00112
00113
00114
00115
00116 void queue_stage(const std::tr1::shared_ptr<const StageBase> &);
00117
00118
00119
00120
00121
00122
00123 struct StageConstIteratorTag;
00124 typedef WrappedForwardIterator<StageConstIteratorTag, const std::tr1::shared_ptr<const StageBase> > StageConstIterator;
00125 StageConstIterator begin_stages() const;
00126 StageConstIterator end_stages() const;
00127
00128
00129
00130
00131
00132
00133 virtual void on_build_all_pre() = 0;
00134 virtual void on_build_pre(const std::tr1::shared_ptr<const StageBase> &) = 0;
00135 virtual void on_build_post(const std::tr1::shared_ptr<const StageBase> &) = 0;
00136 virtual void on_build_fail(const std::tr1::shared_ptr<const StageBase> &, const StageBuildError &) = 0;
00137 virtual void on_build_skipped(const std::tr1::shared_ptr<const StageBase> &) = 0;
00138 virtual void on_build_succeed(const std::tr1::shared_ptr<const StageBase> &) = 0;
00139 virtual void on_build_all_post() = 0;
00140
00141
00142
00143
00144
00145
00146
00147 void execute();
00148 };
00149 }
00150
00151 #endif