/* Copyright (C) 2013 * swift project Community / Contributors * * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, * or distributed except according to the terms contained in the LICENSE file. */ //! \file #ifndef BLACKMISC_VALUEOBJECT_H #define BLACKMISC_VALUEOBJECT_H #include "blackmiscexport.h" #include "dbus.h" #include "datastream.h" #include "metaclass.h" #include "json.h" #include "compare.h" #include "variant.h" #include "propertyindexvariantmap.h" #include "iconlist.h" #include "dictionary.h" #include "stringutils.h" #include #include #include #include #include #include #include #include #include #include #include namespace BlackMisc { /*! * Default base class for CValueObject. */ class BLACKMISC_EXPORT CEmpty { public: //! Base class is alias of itself using base_type = CEmpty; protected: //! Protected default constructor CEmpty() = default; //! Protected copy constructor CEmpty(const CEmpty &) = default; //! Protected copy assignment operator CEmpty &operator =(const CEmpty &) = default; //! Non-virtual protected destructor ~CEmpty() = default; }; /*! * Mix of the most commonly used mixin classes. * \see BlackMisc::Mixin * \tparam Derived The class which is inheriting from this one (CRTP). * \tparam Base The class which this one shall inherit from (default is CEmpty, * but this can be changed to create a deeper inheritance hierarchy). */ template class CValueObject : public Base, public Mixin::MetaType, public Mixin::HashByMetaClass, public Mixin::DBusByMetaClass, public Mixin::DataStreamByMetaClass, public Mixin::JsonByMetaClass, public Mixin::EqualsByMetaClass, public Mixin::LessThanByMetaClass, public Mixin::CompareByMetaClass, public Mixin::String, public Mixin::Index, public Mixin::Icon { public: //! Base class using base_type = Base; //! \copydoc BlackMisc::Mixin::String::toQString using Mixin::String::toQString; //! \copydoc BlackMisc::Mixin::String::toFormattedQString //! \deprecated not really used and just using toQString using Mixin::String::toFormattedQString; //! \copydoc BlackMisc::Mixin::String::toStdString using Mixin::String::toStdString; //! \copydoc BlackMisc::Mixin::Index::apply using Mixin::Index::apply; //! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson using Mixin::JsonByMetaClass::toJson; //! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJsonString using Mixin::JsonByMetaClass::toJsonString; //! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson using Mixin::JsonByMetaClass::convertFromJson; //! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex using Mixin::Index::setPropertyByIndex; //! \copydoc BlackMisc::Mixin::Index::propertyByIndex using Mixin::Index::propertyByIndex; //! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex using Mixin::Index::comparePropertyByIndex; //! \copydoc BlackMisc::Mixin::Index::propertyByIndexAsString using Mixin::Index::propertyByIndexAsString; //! \copydoc BlackMisc::Mixin::Index::equalsPropertyByIndex using Mixin::Index::equalsPropertyByIndex; //! \copydoc BlackMisc::Mixin::Icon::toIcon using Mixin::Icon::toIcon; //! \copydoc BlackMisc::Mixin::Icon::toPixmap using Mixin::Icon::toPixmap; //! \copydoc BlackMisc::Mixin::MetaType::isA using Mixin::MetaType::isA; //! \copydoc BlackMisc::Mixin::MetaType::registerMetadata using Mixin::MetaType::registerMetadata; protected: //! Inheriting constructors. using Base::Base; //! Default constructor. CValueObject() = default; //! Copy constructor. CValueObject(const CValueObject &) = default; //! Copy assignment operator. CValueObject &operator =(const CValueObject &) = default; //! Destructor ~CValueObject() = default; public: //! \copydoc BlackMisc::Mixin::MetaType::getMetaTypeId using Mixin::MetaType::getMetaTypeId; //! \copydoc BlackMisc::Mixin::String::stringForStreaming using Mixin::String::stringForStreaming; //! \copydoc BlackMisc::Mixin::DBusByMetaClass::marshallToDbus using Mixin::DBusByMetaClass::marshallToDbus; //! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus using Mixin::DBusByMetaClass::unmarshallFromDbus; //! \copydoc BlackMisc::Mixin::DataStreamByMetaClass::marshalToDataStream using Mixin::DataStreamByMetaClass::marshalToDataStream; //! \copydoc BlackMisc::Mixin::DataStreamByMetaClass::unmarshalFromDataStream using Mixin::DataStreamByMetaClass::unmarshalFromDataStream; }; } // namespace #endif // guard