/** * @RDE_HEADER@ * Interface-Implementation of ObjectContainer * $Id$ * $HeadURL$ * $Author$ */ #pragma once // Own #include #include #include // Qt #include #include //---------------------------------------------------------------------------- namespace SituationMap { /** * @brief The ObjectContainerCTC class implements the interface SituationMap::ObjectContainer. * It is a map of UniqueMapId to MapObjects. * It uses a external IdGenerator to generate a next UniqueMapId returned * while inserting. * For documentation of inherented methods, see interface class SituationMap::ObjectContainer. */ class SITUATIONMAP_EXPORT ObjectContainerCTC : public ObjectContainer { using BaseClass = ObjectContainer; public: /*! \name Construction, Destruction */ //@{ /** * @brief ObjectContainerCTC. * @param idGenerator to be used * (can be shared among different ObjectContainer instances). */ explicit ObjectContainerCTC(const QSharedPointer &idGenerator); virtual ~ObjectContainerCTC(); //@} /*! \name Insert, Remove, Clear */ //@{ virtual UniqueObjectId insertObject( Object *object ) override; virtual UniqueObjectId insertObject( ObjectContainer::Object *object , const ObjectContainer::UniqueObjectId &uid ) override; virtual bool removeObject( const UniqueObjectId &id ) override; virtual void clear() override; //@} /*! \name Access */ //@{ virtual QList getAllKeys() const override; virtual Object *getObject(const UniqueObjectId &id) const override; // Returns pointer to object virtual QList getAllObjects() const override; virtual QList getAllObjects(const std::type_index &type) const override; // without template QMutableMapIterator> mutableIterator() override { return QMutableMapIterator> (m_map); } //@} /*! \name Check */ //@{ virtual bool containsObject(const UniqueObjectId &id) const override; //@} /*! \name Count */ //@{ /** * @brief Number of objects. * @return Current number of objects. */ virtual qint64 countObjects() const override; //@} QMap > m_map; private: LOGGER_T m_logger; ///< Interface of the Logging-Facility }; } // namespace SituationMap