13 #include <boost/uuid/uuid.hpp> 15 #include <boost/noncopyable.hpp> 27 public std::enable_shared_from_this<Something>, boost::noncopyable
47 Something(
const boost::uuids::uuid &
id) : someId(id) { }
54 void setUuid(
const boost::uuids::uuid &
id) {
65 template <
class DerivedClass>
67 return std::static_pointer_cast<DerivedClass>(shared_from_this());
72 const boost::uuids::uuid &
uuid()
const {
102 return someId <= s.
someId;
108 return someId >= s.
someId;
114 return someId == s.
someId;
120 return someId != s.
someId;
129 #endif // #ifndef SOMETHING_HPP std::shared_ptr< DerivedClass > sharedPtr() const
Returns a shared pointer to this object for a derived class.
boost::uuids::uuid someId
A unique identifier that is valid across all peers.
bool operator!=(const Something &s) const
Something objects are compared using the someId member.
std::weak_ptr< Something > SomethingWptr
bool operator==(const Something &s) const
Something objects are compared using the someId member.
Something(const boost::uuids::uuid &id)
Creates Something with the given UUID.
Something specific; a base class for identifying things.
bool operator>(const Something &s) const
Something objects are compared using the someId member.
bool operator>=(const Something &s) const
Something objects are compared using the someId member.
const boost::uuids::uuid & uuid() const
Returns the object's unique identifier.
std::map< std::string, std::string > LanguageTaggedStringMap
std::string getName() const
Returns the name for the current locale.
bool operator<=(const Something &s) const
Something objects are compared using the someId member.
const general::LanguageTaggedStringMap & names() const
Returns the set of names for all locales and languages.
bool operator<(const Something &s) const
Something objects are compared using the someId member.
Something()=default
Simple constructor.
general::LanguageTaggedStringMap ltnames
A name for this item intended for user presentation.
void setUuid(const boost::uuids::uuid &id)
Sets the UUID that is associated with this object.
std::shared_ptr< Something > SomethingSptr