Syndication

specificitem.h
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SYNDICATION_SPECIFICITEM_H
9#define SYNDICATION_SPECIFICITEM_H
10
11#include <QSharedPointer>
12
13#include "syndication_export.h"
14
15namespace Syndication
16{
17class SpecificItemVisitor;
18class SpecificItem;
19
20//@cond PRIVATE
21typedef QSharedPointer<SpecificItem> SpecificItemPtr;
22//@endcond
23
24/**
25 * Interface for all format-specific item-like classes, such as
26 * RSS2/RDF items, and Atom entries. To process items based on their
27 * format, use a SpecificItemVisitor.
28 *
29 * @author Frank Osterfeld
30 */
31class SYNDICATION_EXPORT SpecificItem
32{
33public:
34 /**
35 * virtual dtor
36 */
37 virtual ~SpecificItem();
38
39 /**
40 * This must be implemented for the double dispatch
41 * technique (Visitor pattern).
42 *
43 * The usual implementation is
44 * @code
45 * return visitor->visit(this);
46 * @endcode
47 *
48 * See also SpecificItemVisitor.
49 *
50 * @param visitor the visitor "visiting" this object
51 */
52 virtual bool accept(SpecificItemVisitor *visitor) = 0;
53};
54
55} // namespace Syndication
56
57#endif // SYNDICATION_SPECIFICITEM_H
Visitor interface, following the Visitor design pattern.
Interface for all format-specific item-like classes, such as RSS2/RDF items, and Atom entries.
virtual bool accept(SpecificItemVisitor *visitor)=0
This must be implemented for the double dispatch technique (Visitor pattern).
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.