00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_DEP_TAG_HH
00021 #define PALUDIS_GUARD_PALUDIS_DEP_TAG_HH 1
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <paludis/dep_tag-fwd.hh>
00036 #include <paludis/dep_spec-fwd.hh>
00037 #include <paludis/name-fwd.hh>
00038 #include <paludis/package_id-fwd.hh>
00039 #include <paludis/spec_tree-fwd.hh>
00040 #include <paludis/util/instantiation_policy.hh>
00041 #include <paludis/util/simple_visitor.hh>
00042 #include <paludis/util/exception.hh>
00043 #include <paludis/util/named_value.hh>
00044 #include <paludis/util/fs_entry.hh>
00045 #include <paludis/util/operators.hh>
00046 #include <paludis/util/type_list.hh>
00047
00048 #include <string>
00049 #include <tr1/memory>
00050
00051 namespace paludis
00052 {
00053 namespace n
00054 {
00055 struct generation;
00056 struct tag;
00057 }
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 class PALUDIS_VISIBLE DepTagCategory :
00072 private InstantiationPolicy<DepTagCategory, instantiation_method::NonCopyableTag>
00073 {
00074 private:
00075 bool _visible;
00076 const std::string _id;
00077 const std::string _title;
00078 const std::string _pre_text;
00079 const std::string _post_text;
00080
00081 public:
00082
00083
00084
00085 DepTagCategory(
00086 bool visible,
00087 const std::string & id,
00088 const std::string & t,
00089 const std::string & pre,
00090 const std::string & post);
00091
00092
00093
00094
00095
00096
00097 bool visible() const;
00098
00099
00100
00101
00102 std::string id() const;
00103
00104
00105
00106
00107
00108 std::string title() const;
00109
00110
00111
00112
00113 std::string pre_text() const;
00114
00115
00116
00117
00118 std::string post_text() const;
00119 };
00120
00121
00122
00123
00124
00125
00126
00127 class PALUDIS_VISIBLE DepTagCategoryFactory :
00128 public InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>
00129 {
00130 friend class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
00131
00132 private:
00133 DepTagCategoryFactory();
00134
00135 public:
00136 const std::tr1::shared_ptr<DepTagCategory> create(const std::string &) const
00137 PALUDIS_ATTRIBUTE((warn_unused_result));
00138 };
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 class PALUDIS_VISIBLE DepTag :
00151 private InstantiationPolicy<DepTag, instantiation_method::NonCopyableTag>,
00152 public relational_operators::HasRelationalOperators,
00153 public virtual DeclareAbstractAcceptMethods<DepTag, MakeTypeList<
00154 GLSADepTag, GeneralSetDepTag, DependencyDepTag, TargetDepTag>::Type>
00155 {
00156 protected:
00157
00158
00159
00160 DepTag();
00161
00162 public:
00163 virtual ~DepTag();
00164
00165
00166
00167
00168
00169
00170
00171 virtual std::string short_text() const = 0;
00172
00173
00174
00175
00176 virtual std::string category() const = 0;
00177
00178
00179
00180
00181 bool operator< (const DepTag &) const;
00182 bool operator== (const DepTag &) const;
00183
00184
00185 };
00186
00187
00188
00189
00190
00191
00192
00193 class PALUDIS_VISIBLE GLSADepTag :
00194 public DepTag,
00195 public ImplementAcceptMethods<DepTag, GLSADepTag>
00196 {
00197 private:
00198 const std::string _id;
00199 const std::string _glsa_title;
00200 const FSEntry _glsa_file;
00201
00202 public:
00203
00204
00205
00206 GLSADepTag(const std::string & id, const std::string & glsa_title, const FSEntry&);
00207 ~GLSADepTag();
00208
00209
00210
00211
00212
00213
00214 virtual std::string short_text() const;
00215
00216 virtual std::string category() const;
00217
00218
00219
00220
00221 const FSEntry glsa_file() const;
00222
00223
00224
00225
00226
00227 std::string glsa_title() const;
00228
00229
00230 };
00231
00232
00233
00234
00235
00236
00237
00238 class PALUDIS_VISIBLE GeneralSetDepTag :
00239 public DepTag,
00240 public ImplementAcceptMethods<DepTag, GeneralSetDepTag>,
00241 private PrivateImplementationPattern<GeneralSetDepTag>
00242 {
00243 public:
00244
00245
00246
00247 GeneralSetDepTag(const SetName & id, const std::string & source);
00248 ~GeneralSetDepTag();
00249
00250
00251
00252 virtual std::string short_text() const;
00253
00254 virtual std::string category() const;
00255
00256
00257
00258
00259 std::string source() const;
00260 };
00261
00262
00263
00264
00265
00266
00267
00268 class PALUDIS_VISIBLE DependencyDepTag :
00269 public DepTag,
00270 public ImplementAcceptMethods<DepTag, DependencyDepTag>,
00271 private PrivateImplementationPattern<DependencyDepTag>
00272 {
00273 private:
00274 void _make_str() const;
00275
00276 public:
00277
00278
00279
00280 DependencyDepTag(const std::tr1::shared_ptr<const PackageID> &, const PackageDepSpec &);
00281
00282 ~DependencyDepTag();
00283
00284
00285
00286 virtual std::string short_text() const;
00287
00288 virtual std::string category() const;
00289
00290
00291
00292
00293 const std::tr1::shared_ptr<const PackageID> package_id() const;
00294
00295
00296
00297
00298 const std::tr1::shared_ptr<const PackageDepSpec> dependency() const;
00299 };
00300
00301
00302
00303
00304
00305
00306
00307 class PALUDIS_VISIBLE TargetDepTag :
00308 public DepTag,
00309 public ImplementAcceptMethods<DepTag, TargetDepTag>
00310 {
00311 public:
00312
00313
00314
00315 TargetDepTag();
00316 ~TargetDepTag();
00317
00318
00319
00320 virtual std::string short_text() const;
00321 virtual std::string category() const;
00322 };
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334 struct DepTagEntry
00335 {
00336 NamedValue<n::generation, long> generation;
00337 NamedValue<n::tag, std::tr1::shared_ptr<const DepTag> > tag;
00338 };
00339
00340
00341
00342
00343
00344
00345
00346
00347 struct PALUDIS_VISIBLE DepTagEntryComparator
00348 {
00349 bool operator() (const DepTagEntry &, const DepTagEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
00350 };
00351
00352 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
00353 extern template class InstantiationPolicy<DepTagCategoryFactory, instantiation_method::SingletonTag>;
00354 extern template class PrivateImplementationPattern<DependencyDepTag>;
00355 extern template class PrivateImplementationPattern<GeneralSetDepTag>;
00356 #endif
00357
00358 }
00359
00360 #endif