/usr/include/libubuntu-app-launch-3/ubuntu-app-launch/type-tagger.h is in libubuntu-app-launch3-dev 0.12+17.04.20170404.2-0ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #pragma once
namespace ubuntu
{
namespace app_launch
{
/** \brief A small template to make it clearer when special types are being used
The TypeTagger a small piece of C++ so that we can have custom types
for things in the Ubuntu App Launch API that should be handled in
special ways, but really have basic types at their core. In this way
there is explicit code to convert these items into their fundamental type
so that is obvious and can be easily searched for.
*/
template <typename Tag, typename T>
class TypeTagger
{
public:
/** Function to build a TypeTagger object from a fundamental type */
static TypeTagger<Tag, T> from_raw(const T& value)
{
return TypeTagger<Tag, T>(value);
}
/** Getter to get the fundamental type out of the TypeTagger wrapper */
const T& value() const
{
return _value;
}
/** Getter to get the fundamental type out of the TypeTagger wrapper */
operator T() const
{
return _value;
}
bool operator==(const TypeTagger<Tag, T>& b) const
{
return _value == b._value;
}
bool operator==(const T& b) const
{
return _value == b;
}
bool operator!=(const TypeTagger<Tag, T>& b) const
{
return _value != b._value;
}
bool operator!=(const T& b) const
{
return _value != b;
}
~TypeTagger()
{
}
private:
/** Private constructor used by from_raw() */
TypeTagger(const T& value)
: _value(value)
{
}
T _value; /**< The memory allocation for the fundamental type */
};
} // namespace app_launch
} // namespace ubuntu
|