Soprano  2.7.2
/builddir/build/BUILD/soprano-2.7.2/soprano/statement.h
Go to the documentation of this file.
00001 /* This file is part of Soprano Project.
00002  *
00003  * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com>
00004  * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef SOPRANO_STATEMENT_H
00023 #define SOPRANO_STATEMENT_H
00024 
00025 #include "node.h"
00026 #include "soprano_export.h"
00027 
00028 namespace Soprano
00029 {
00047     class SOPRANO_EXPORT Statement
00048     {
00049     public:
00051 
00054         Statement();
00055 
00067         Statement( const Node &subject, const Node &predicate, const Node &object, const Node &context = Node() );
00068 
00069         Statement( const Statement &other );
00070 
00071         virtual ~Statement();
00072 
00073         Statement& operator=( const Statement& other );
00075 
00077         bool operator==( const Statement& other ) const;
00078         bool operator!=( const Statement& other ) const;
00079 
00097         bool matches( const Statement& other ) const;
00099 
00101 
00108         bool isValid() const;
00110 
00112 
00115         Node subject() const;
00116 
00120         Node predicate() const;
00121 
00125         Node object() const;
00126 
00130         Node context() const;
00132 
00134 
00139         void setSubject( const Node &subject );
00140 
00146         void setPredicate( const Node &predicate );
00152         void setObject( const Node &object );
00153 
00159         void setContext( const Node &context );
00161 
00162     private:
00163         class Private;
00164         QSharedDataPointer<Private> d;
00165     };
00166 
00170     SOPRANO_EXPORT uint qHash( const Statement& s ); 
00171 }
00172 
00176 SOPRANO_EXPORT QDebug operator<<( QDebug s, const Soprano::Statement& );
00177 
00181 SOPRANO_EXPORT QTextStream& operator<<( QTextStream& s, const Soprano::Statement& );
00182 
00183 #endif // SOPRANO_STATEMENT_H
00184