Commit 66757b37 authored by Philip Trettner's avatar Philip Trettner

renamed some namespaces

parent 5c9abeed
......@@ -158,13 +158,13 @@ void ActionAnalyzer::dumpSummary(std::ostream &oss, bool verbose)
_ desc = l->shortDesc();
oss << " " << desc << std::string(nameLength - desc.size(), ' ') << " ";
oss << aion_fmt::format(cntFmt, a->count()) << "x ";
systime::formatHuman(a->averageNS(), oss);
aion_systime::formatHuman(a->averageNS(), oss);
oss << " (";
systime::formatHuman(a->minNS(), oss);
aion_systime::formatHuman(a->minNS(), oss);
oss << " ~ ";
systime::formatHuman(a->maxNS(), oss);
aion_systime::formatHuman(a->maxNS(), oss);
oss << ", ±";
systime::formatHuman(a->standardDeviationNS(), oss);
aion_systime::formatHuman(a->standardDeviationNS(), oss);
oss << ")\n";
}
}
......
......@@ -41,8 +41,8 @@ private:
int64_t mMax;
public: // properties
GETTER(Tree);
GETTER(Actions);
AION_GETTER(Tree);
AION_GETTER(Actions);
int64_t count() const { return mCount; }
int64_t totalTimeNS() const { return mSumNs; }
......
......@@ -21,12 +21,12 @@ private:
int32_t mIndex;
public:
GETTER(Index);
AION_GETTER(Index);
GETTER(Name);
GETTER(File);
GETTER(Line);
GETTER(Function);
AION_GETTER(Name);
AION_GETTER(File);
AION_GETTER(Line);
AION_GETTER(Function);
std::string shortDesc() const;
......
......@@ -23,8 +23,8 @@ private:
std::vector<ActionLabel*> mLabels;
public:
GETTER(Entries);
GETTER(Labels);
AION_GETTER(Entries);
AION_GETTER(Labels);
public:
ActionPackage(std::vector<ActionEntry> const& entries, std::vector<ActionLabel*> const& labels);
......
......@@ -151,7 +151,7 @@ SharedActionTree ActionTree::construct(const std::vector<ActionEntry> &entries,
static void dumpAction(std::ostream &oss, Action *a, std::string const &prefix)
{
oss << prefix << " - " << systime::formatHuman(a->duration) << " (" << a->label->nameOrFunc() << ")\n";
oss << prefix << " - " << aion_systime::formatHuman(a->duration) << " (" << a->label->nameOrFunc() << ")\n";
_ c = a->firstChild;
_ cp = prefix + " ";
while (c)
......@@ -163,11 +163,11 @@ static void dumpAction(std::ostream &oss, Action *a, std::string const &prefix)
void ActionTree::dump(std::ostream &oss) const
{
_ totalTime = 0 * systime::ns;
_ totalTime = 0 * aion_systime::ns;
for (_ r : mRoots)
totalTime += r->duration;
oss << "Total Time: " << systime::formatHuman(totalTime) << "\n";
oss << "Total Time: " << aion_systime::formatHuman(totalTime) << "\n";
for (_ r : mRoots)
dumpAction(oss, r, "");
oss.flush();
......
......@@ -21,9 +21,9 @@ private:
std::vector<ActionLabel*> mLabels;
public:
GETTER(Actions);
GETTER(Roots);
GETTER(Labels);
AION_GETTER(Actions);
AION_GETTER(Roots);
AION_GETTER(Labels);
size_t getActionCount() const { return mActions.size(); }
ActionTree();
......
......@@ -335,7 +335,7 @@ public:
/// Const reference to the internal data
const std::vector<char> &getData() const { return mData; }
GETTER(Position);
AION_GETTER(Position);
// Supported types:
......
......@@ -19,56 +19,22 @@
* CAUTION: these macros can only be used _after_ the member is declared (due to type deduction)
*/
#define GETTER(name) \
#define AION_GETTER(name) \
auto get##name() const->decltype(m##name) const & { return m##name; } \
friend class AION_MACRO_JOIN(___get_, __COUNTER__)
#define SETTER(name) \
#define AION_SETTER(name) \
void set##name(decltype(m##name) const& value) { m##name = value; } \
friend class AION_MACRO_JOIN(___set_, __COUNTER__)
#define GETTER_IS(name) \
#define AION_GETTER_IS(name) \
auto is##name() const->decltype(m##name) const & { return m##name; } \
friend class AION_MACRO_JOIN(___get_is_, __COUNTER__)
#define PROPERTY(name) \
GETTER(name); \
SETTER(name)
#define AION_PROPERTY(name) \
AION_GETTER(name); \
AION_SETTER(name)
#define PROPERTY_IS(name) \
GETTER_IS(name); \
SETTER(name)
/**
* Qt specific addition
*
* Usage:
*
* Q_OBJECT
* Q_PROPERTY(QString bar READ getBar WRITE setBar NOTIFY onBarChanged)
* private:
* QString mBar;
* public:
* PROPERTY_QML(Bar);
* signals:
* void onBarChanged();
*/
#define SETTER_QML(name) \
void set##name(decltype(m##name) const& value) \
{ \
if (m##name != value) \
{ \
m##name = value; \
emit on##name##Changed(); \
} \
} \
friend class AION_MACRO_JOIN(___set_, __COUNTER__)
#define PROPERTY_QML(name) \
GETTER(name); \
SETTER_QML(name)
#define PROPERTY_QML_IS(name) \
GETTER_IS(name); \
SETTER_QML(name)
#define AION_PROPERTY_IS(name) \
AION_GETTER_IS(name); \
AION_SETTER(name)
......@@ -10,7 +10,7 @@
/// Contains constants for conversion from ns to other times
/// Examples: 10 * systime::ms are 10ms
namespace systime
namespace aion_systime
{
const int64_t h = 60LL * 60LL * 1000LL * 1000LL * 1000LL;
const int64_t min = 60LL * 1000LL * 1000LL * 1000LL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment