Syndication

sequence.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_RDF_SEQUENCE_H
9#define SYNDICATION_RDF_SEQUENCE_H
10
11#include "../syndication_export.h"
12#include "resource.h"
13
14template<class T>
15class QList;
16
17namespace Syndication
18{
19namespace RDF
20{
21//@cond PRIVATE
22class Sequence;
23typedef QSharedPointer<Sequence> SequencePtr;
24//@endcond
25
26/**
27 * Sequence container, a sequence contains an ordered list
28 * of RDF nodes. (opposed to the usually unordered graph
29 * structure)
30 */
31class Sequence : public Resource
32{
33public:
34 /**
35 * creates a null sequence
36 */
37 Sequence();
38
39 /**
40 * creates a sequence with the given URI. Do not use this directly,
41 * use Model::createSequence() instead.
42 */
43 explicit Sequence(const QString &uri);
44
45 /**
46 * copies a sequence
47 *
48 * @param other sequence
49 */
50 Sequence(const Sequence &other);
51
52 /**
53 * destructor
54 */
55 ~Sequence() override;
56
57 /**
58 * assigns another sequence
59 *
60 * @param other the sequence to assign
61 */
62 virtual Sequence &operator=(const Sequence &other);
63
64 /**
65 * Used by visitors for double dispatch. See NodeVisitor
66 * for more information.
67 * @param visitor the visitor calling the method
68 * @param ptr a shared pointer object for this node
69 */
70 void accept(NodeVisitor *visitor, NodePtr ptr) override;
71
72 /**
73 * creates a copy of the sequence
74 */
75 Sequence *clone() const override;
76
77 /**
78 * appends a node at the end of the sequence
79 *
80 * @param node the RDF node to append to the sequence
81 */
82 virtual void append(NodePtr node);
83
84 /**
85 * the list of the list items in the sequence, in the
86 * specified order
87 */
88 virtual QList<NodePtr> items() const;
89
90 /**
91 * returns @p true
92 */
93 bool isSequence() const override;
94
95private:
96 class SequencePrivate;
98};
99
100} // namespace RDF
101} // namespace Syndication
102
103#endif // SYNDICATION_RDF_SEQUENCE_H
Visitor interface, following the Visitor design pattern.
Definition nodevisitor.h:42
Resources are the entities in the RDF graph.
Definition resource.h:37
virtual QString uri() const
returns the URI of the resource
Definition resource.cpp:207
Sequence container, a sequence contains an ordered list of RDF nodes.
Definition sequence.h:32
virtual QList< NodePtr > items() const
the list of the list items in the sequence, in the specified order
Definition sequence.cpp:73
Sequence * clone() const override
creates a copy of the sequence
Definition sequence.cpp:54
virtual void append(NodePtr node)
appends a node at the end of the sequence
Definition sequence.cpp:66
Sequence()
creates a null sequence
Definition sequence.cpp:25
virtual Sequence & operator=(const Sequence &other)
assigns another sequence
Definition sequence.cpp:59
void accept(NodeVisitor *visitor, NodePtr ptr) override
Used by visitors for double dispatch.
Definition sequence.cpp:46
~Sequence() override
destructor
Definition sequence.cpp:43
bool isSequence() const override
returns true
Definition sequence.cpp:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 12:01:07 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.