libQtCassandra 0.3.2
|
Hold a Cassandra column definition. More...
#include <QCassandraColumnDefinition.h>
Public Types | |
enum | index_type_t { INDEX_TYPE_UNKNOWN = -2, INDEX_TYPE_UNDEFINED = -1, INDEX_TYPE_KEYS = 0 } |
Define the type of index. More... | |
Public Member Functions | |
virtual | ~QCassandraColumnDefinition () |
Clean up the QCassandraColumnDefinition object. | |
QString | columnName () const |
Retrieve the name of the column. | |
QString | indexName () const |
Retrieve the current name of this column index. | |
index_type_t | indexType () const |
Retrieve the type of index. | |
void | setIndexName (const QString &name) |
Set the name of the index table. | |
void | setIndexType (index_type_t index_type) |
Set the type of index used on this column. | |
void | setValidationClass (const QString &name) |
Set the validation class of this column. | |
void | unsetIndexName () |
Unset the index name. | |
void | unsetIndexType () |
Remove the index type definition. | |
QString | validationClass () const |
Retrieve the validation class. | |
Private Member Functions | |
QCassandraColumnDefinition (QCassandraTable *table, const QString &name) | |
Initialize a QCassandraColumnDefinition object. | |
void | parseColumnDefinition (const void *data) |
This is an internal function used to parse a ColumnDef structure. | |
void | prepareColumnDefinition (void *data) const |
Prepare a column definition. | |
Private Attributes | |
std::auto_ptr < QCassandraColumnDefinitionPrivate > | f_private |
Pointer to the private data of the column definition. | |
QCassandraTable * | f_table |
Pointer back to the table that created this column definition. | |
Friends | |
class | QCassandraColumnDefinitionPrivate |
class | QCassandraTable |
This class is used to read and create column definitions to use with the Cassandra database system.
Definition at line 53 of file QCassandraColumnDefinition.h.
This enumeration defines the type of index used by Cassandra.
At this time only KEYS is defined as an index type. The other two values are used when the type cannot be determined or is defined by not known (i.e. it's not KEYS.)
Definition at line 56 of file QCassandraColumnDefinition.h.
QtCassandra::QCassandraColumnDefinition::~QCassandraColumnDefinition | ( | ) | [virtual] |
This function ensures that all resources allocated by the QCassandraColumnDefinition are released.
Definition at line 134 of file QCassandraColumnDefinition.cpp.
QtCassandra::QCassandraColumnDefinition::QCassandraColumnDefinition | ( | QCassandraTable * | table, |
const QString & | column_name | ||
) | [private] |
This function initializes a QCassandraColumnDefinition object.
All the parameters are set to the defaults as defined in the Cassandra definition of the ColumnDef message. You can use the different functions of this class to change the default values.
[in] | table | The table this column is part of. |
[in] | column_name | The name of the column. |
Definition at line 121 of file QCassandraColumnDefinition.cpp.
References f_private.
QString QtCassandra::QCassandraColumnDefinition::columnName | ( | ) | const |
This function returns the name of the column as specified in the constructor.
The name cannot be changed.
Definition at line 147 of file QCassandraColumnDefinition.cpp.
References f_private.
QString QtCassandra::QCassandraColumnDefinition::indexName | ( | ) | const |
This function returns the name of this column index.
When the name is not set the function returns an empty string.
Definition at line 267 of file QCassandraColumnDefinition.cpp.
References f_private.
QCassandraColumnDefinition::index_type_t QtCassandra::QCassandraColumnDefinition::indexType | ( | ) | const |
This function returns the current type of index or INDEX_TYPE_UNDEFINED if the index is not currently defined.
If the index type is defined but not known by the QtCassandra library, then INDEX_TYPE_UNKNOWN is returned.
Definition at line 224 of file QCassandraColumnDefinition.cpp.
References f_private, INDEX_TYPE_KEYS, INDEX_TYPE_UNDEFINED, and INDEX_TYPE_UNKNOWN.
void QtCassandra::QCassandraColumnDefinition::parseColumnDefinition | ( | const void * | data | ) | [private] |
This function is called internally to parse a ColumnDef object.
[in] | data | The pointer to the ColumnDef object. |
Definition at line 281 of file QCassandraColumnDefinition.cpp.
References f_private.
void QtCassandra::QCassandraColumnDefinition::prepareColumnDefinition | ( | void * | data | ) | const [private] |
This function copies the private ColumnDef in the specified data
parameter.
[in] | data | The destination buffer for the column definition. |
Definition at line 318 of file QCassandraColumnDefinition.cpp.
References f_private.
void QtCassandra::QCassandraColumnDefinition::setIndexName | ( | const QString & | name | ) |
Define the name that the system gives the index table.
[in] | name | The index table name. |
Definition at line 245 of file QCassandraColumnDefinition.cpp.
References f_private.
void QtCassandra::QCassandraColumnDefinition::setIndexType | ( | index_type_t | index_type | ) |
Cassandra offers the ability to build an index over a column. This parameter defines the type of that index.
The currently valid values are:
runtime_error | If the index_type value does not correspond to one of the valid types as defined in the QCassandraColumnDefinition, then this exception is raised. |
[in] | index_type | The type of index. |
Definition at line 190 of file QCassandraColumnDefinition.cpp.
References f_private, and INDEX_TYPE_KEYS.
void QtCassandra::QCassandraColumnDefinition::setValidationClass | ( | const QString & | name | ) |
Note that the validation class is a mandatory parameter although it can be set to "" to get the default class.
[in] | name | The name of the new validation class to use with this column. |
Definition at line 159 of file QCassandraColumnDefinition.cpp.
References f_private.
void QtCassandra::QCassandraColumnDefinition::unsetIndexName | ( | ) |
This function marks the index name as not set.
Definition at line 254 of file QCassandraColumnDefinition.cpp.
References f_private.
void QtCassandra::QCassandraColumnDefinition::unsetIndexType | ( | ) |
The index type parameter is optional and can be cleared. This does not mean that the index is removed from the column, just that the information is not sent over the network. (TBD)
Definition at line 209 of file QCassandraColumnDefinition.cpp.
References f_private.
QString QtCassandra::QCassandraColumnDefinition::validationClass | ( | ) | const |
This function returns the name of the validation class of this column.
Definition at line 170 of file QCassandraColumnDefinition.cpp.
References f_private.
friend class QCassandraColumnDefinitionPrivate [friend] |
Definition at line 84 of file QCassandraColumnDefinition.h.
friend class QCassandraTable [friend] |
Definition at line 83 of file QCassandraColumnDefinition.h.
A pointer to the private part of this column definition. This means a pointer to a ColumnDef structure.
Definition at line 86 of file QCassandraColumnDefinition.h.
Referenced by columnName(), indexName(), indexType(), parseColumnDefinition(), prepareColumnDefinition(), QCassandraColumnDefinition(), setIndexName(), setIndexType(), setValidationClass(), unsetIndexName(), unsetIndexType(), and validationClass().
A pointer back to the table that created this column definition.
This is a bare pointer since a table has a shared pointer to this column definition (i.e. when the table goes, the column definition is gone.)
Definition at line 90 of file QCassandraColumnDefinition.h.
This document is part of the libQtCassandra Project.
Copyright by Made to Order Software Corp.