00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _STAT_LOCATION_H
00026 #define _STAT_LOCATION_H
00027
00028 #include <FP.H>
00029 #include <FV.H>
00030 #include <CacheIndex.H>
00031
00032 namespace Stat
00033 {
00034
00035 class Location
00036 {
00037 private:
00038
00039 Text path;
00040
00041
00042 FP::Tag pk;
00043 Text sourceFunc;
00044 bool has_pk;
00045
00046
00047 FP::Tag cfp;
00048 FV::Epoch namesEpoch;
00049 bool has_cfp;
00050
00051
00052 CacheEntry::Index ci;
00053 bool has_ci;
00054
00055 public:
00056 Location(const Text &p_path)
00057 : path(p_path),
00058 has_pk(false), has_cfp(false), has_ci(false)
00059 { }
00060 Location(const Text &p_path,
00061 const FP::Tag &p_pk, const Text &p_sourceFunc)
00062 : path(p_path),
00063 pk(p_pk), sourceFunc(p_sourceFunc), has_pk(true),
00064 has_cfp(false), has_ci(false)
00065 { }
00066 Location(const Text &p_path,
00067 const FP::Tag &p_pk, const Text &p_sourceFunc,
00068 FV::Epoch p_namesEpoch, const FP::Tag &p_cfp)
00069 : path(p_path),
00070 pk(p_pk), sourceFunc(p_sourceFunc), has_pk(true),
00071 cfp(p_cfp), namesEpoch(p_namesEpoch), has_cfp(true),
00072 has_ci(false)
00073 { }
00074 Location(const Text &p_path,
00075 const FP::Tag &p_pk, const Text &p_sourceFunc,
00076 FV::Epoch p_namesEpoch, const FP::Tag &p_cfp,
00077 CacheEntry::Index p_ci)
00078 : path(p_path),
00079 pk(p_pk), sourceFunc(p_sourceFunc), has_pk(true),
00080 cfp(p_cfp), namesEpoch(p_namesEpoch), has_cfp(true),
00081 ci(p_ci), has_ci(true)
00082 { }
00083 Location(const Location &p_other)
00084 : path(p_other.path),
00085 pk(p_other.pk), sourceFunc(p_other.sourceFunc), has_pk(p_other.has_pk),
00086 cfp(p_other.cfp), namesEpoch(p_other.namesEpoch), has_cfp(p_other.has_cfp),
00087 ci(p_other.ci), has_ci(p_other.has_ci)
00088 { }
00089
00090 Location add_pk(const FP::Tag &p_pk, const Text *p_sourceFunc) const
00091 {
00092 return Location(path, p_pk, *p_sourceFunc);
00093 }
00094
00095 Location add_cfp(FV::Epoch p_namesEpoch, const FP::Tag &p_cfp) const
00096 {
00097 return Location(path, pk, sourceFunc, p_namesEpoch, p_cfp);
00098 }
00099
00100 Location add_ci(CacheEntry::Index p_ci) const
00101 {
00102 return Location(path, pk, sourceFunc, namesEpoch, cfp, p_ci);
00103 }
00104
00105 const Text &get_sourceFunc() const { return sourceFunc; }
00106
00107 void print(std::ostream &out, int indent = 0) const;
00108 };
00109 }
00110
00111 std::ostream &operator<<(std::ostream &, const Stat::Location &);
00112
00113 #endif // _STAT_LOCATION_H