libQtCassandra 0.3.2

QCassandraRowPredicate.h

Go to the documentation of this file.
00001 /*
00002  * Header:
00003  *      QCassandraRowPredicate.h
00004  *
00005  * Description:
00006  *      Handling of the cassandra::SlicePredicate to retrieve a set of columns
00007  *      all at once.
00008  *
00009  * Documentation:
00010  *      See the corresponding .cpp file.
00011  *
00012  * License:
00013  *      Copyright (c) 2011 Made to Order Software Corp.
00014  * 
00015  *      http://snapwebsites.org/
00016  *      contact@m2osw.com
00017  *
00018  *      Permission is hereby granted, free of charge, to any person obtaining a
00019  *      copy of this software and associated documentation files (the
00020  *      "Software"), to deal in the Software without restriction, including
00021  *      without limitation the rights to use, copy, modify, merge, publish,
00022  *      distribute, sublicense, and/or sell copies of the Software, and to
00023  *      permit persons to whom the Software is furnished to do so, subject to
00024  *      the following conditions:
00025  *
00026  *      The above copyright notice and this permission notice shall be included
00027  *      in all copies or substantial portions of the Software.
00028  *
00029  *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00030  *      OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00031  *      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00032  *      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00033  *      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00034  *      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00035  *      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00036  */
00037 #ifndef QCASSANDRA_ROW_PREDICATE_H
00038 #define QCASSANDRA_ROW_PREDICATE_H
00039 
00040 #include "QCassandraColumnPredicate.h"
00041 #include <QtCore/QSharedPointer>
00042 
00043 namespace QtCassandra
00044 {
00045 
00046 class QCassandraPrivate;
00047 
00048 // Predicates for the Cassandra get_slice() function
00049 
00050 // common predicate information
00051 class QCassandraRowPredicate : public QObject
00052 {
00053 public:
00054     QCassandraRowPredicate();
00055 
00056     QString startRowName() const;
00057     void setStartRowName(const QString& row_name);
00058     const QByteArray& startRowKey() const;
00059     void setStartRowKey(const QByteArray& row_key);
00060 
00061     QString endRowName() const;
00062     void setEndRowName(const QString& row_name);
00063     const QByteArray& endRowKey() const;
00064     void setEndRowKey(const QByteArray& row_key);
00065 
00066     int32_t count() const;
00067     void setCount(int32_t count = 100);
00068 
00069     bool wrap() const;
00070     void setWrap(bool wrap = true);
00071 
00072     QSharedPointer<QCassandraColumnPredicate> columnPredicate() const;
00073     void setColumnPredicate(QSharedPointer<QCassandraColumnPredicate> column_predicate);
00074 
00075 private:
00076     virtual void toPredicate(void *data) const;
00077 
00078     friend class QCassandraPrivate;
00079 
00080     QByteArray                                  f_start_row;
00081     QByteArray                                  f_end_row;
00082     cassandra_count_t                           f_count;
00083     controlled_vars::zbool_t                    f_wrap; // i.e. KeyRange tokens versus keys
00084     QSharedPointer<QCassandraColumnPredicate>   f_column_predicate;
00085 };
00086 
00087 } // namespace QtCassandra
00088 #endif
00089 //#ifndef QCASSANDRA_ROW_PREDICATE_H
00090 // vim: ts=4 sw=4 et
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

This document is part of the libQtCassandra Project.

Copyright by Made to Order Software Corp.