libQtCassandra 0.3.2

QCassandraCell.h

Go to the documentation of this file.
00001 /*
00002  * Header:
00003  *      QCassandraCell.h
00004  *
00005  * Description:
00006  *      Handling of a cell to access data within the Cassandra database.
00007  *
00008  * Documentation:
00009  *      See the corresponding .cpp file.
00010  *
00011  * License:
00012  *      Copyright (c) 2011 Made to Order Software Corp.
00013  * 
00014  *      http://snapwebsites.org/
00015  *      contact@m2osw.com
00016  * 
00017  *      Permission is hereby granted, free of charge, to any person obtaining a
00018  *      copy of this software and associated documentation files (the
00019  *      "Software"), to deal in the Software without restriction, including
00020  *      without limitation the rights to use, copy, modify, merge, publish,
00021  *      distribute, sublicense, and/or sell copies of the Software, and to
00022  *      permit persons to whom the Software is furnished to do so, subject to
00023  *      the following conditions:
00024  *
00025  *      The above copyright notice and this permission notice shall be included
00026  *      in all copies or substantial portions of the Software.
00027  *
00028  *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00029  *      OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00031  *      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00032  *      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00033  *      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00034  *      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  */
00036 #ifndef QCASSANDRA_CELL_H
00037 #define QCASSANDRA_CELL_H
00038 
00039 #include "QCassandraValue.h"
00040 #include <QtCore/QObject>
00041 #include <QtCore/QMap>
00042 #include <QtCore/QSharedPointer>
00043 
00044 
00045 namespace QtCassandra
00046 {
00047 
00048 class QCassandraRow;
00049 
00050 // Cassandra Cell
00051 class QCassandraCell : public QObject
00052 {
00053 public:
00054     virtual ~QCassandraCell();
00055 
00056     QString columnName() const;
00057     const QByteArray& columnKey() const;
00058 
00059     const QCassandraValue& value() const;
00060     void setValue(const QCassandraValue& value);
00061 
00062     QCassandraCell& operator = (const QCassandraValue& value);
00063     operator QCassandraValue () const;
00064 
00065     void clearCache();
00066 
00067 private:
00068     QCassandraCell(QCassandraRow *row, const QByteArray& column_key);
00069     void assignValue(const QCassandraValue& value);
00070     void unparent();
00071 
00072     friend class QCassandraRow;
00073     friend class QCassandraTable;
00074 
00075     QCassandraRow *                     f_row;
00076     QByteArray                          f_key;
00077     mutable controlled_vars::zbool_t    f_cached;
00078     QCassandraValue                     f_value;
00079 };
00080 
00081 // array of rows
00082 typedef QMap<QByteArray, QSharedPointer<QCassandraCell> > QCassandraCells;
00083 
00084 
00085 
00086 } // namespace QtCassandra
00087 #endif
00088 //#ifndef QCASSANDRA_CELL_H
00089 // 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.