A collection of values.

Functions

CassCollection *

cass_collection_new

( CassCollectionType type, size_t item_count )

Creates a new collection.

Parameters:
Name Type Details
in type CassCollectionType
in item_count size_t

The approximate number of items in the collection.

Returns:
Type Details
CassCollection *

Returns a collection that must be freed.

See Also:
CassCollection *

cass_collection_new_from_data_type

( const CassDataType * data_type, size_t item_count )

Creates a new collection from an existing data type.

Parameters:
Name Type Details
in data_type const CassDataType *
in item_count size_t

The approximate number of items in the collection.

Returns:
Type Details
CassCollection *

Returns a collection that must be freed.

See Also:
void

cass_collection_free

( CassCollection * collection )

Frees a collection instance.

Parameters:
Name Type Details
in collection CassCollection *
CassError

cass_collection_append_int8

( CassCollection * collection, cass_int8_t value )

Appends a “tinyint” to the collection.

Requires Cassandra: 2.2+

Parameters:
Name Type Details
in collection CassCollection *
in value cass_int8_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_int16

( CassCollection * collection, cass_int16_t value )

Appends an “smallint” to the collection.

Requires Cassandra: 2.2+

Parameters:
Name Type Details
in collection CassCollection *
in value cass_int16_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_int32

( CassCollection * collection, cass_int32_t value )

Appends an “int” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value cass_int32_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_uint32

( CassCollection * collection, cass_uint32_t value )

Appends a “date” to the collection.

Requires Cassandra: 2.2+

Parameters:
Name Type Details
in collection CassCollection *
in value cass_uint32_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_int64

( CassCollection * collection, cass_int64_t value )

Appends a “bigint”, “counter”, “timestamp” or “time” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value cass_int64_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_float

( CassCollection * collection, cass_float_t value )

Appends a “float” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value cass_float_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_double

( CassCollection * collection, cass_double_t value )

Appends a “double” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value cass_double_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_bool

( CassCollection * collection, cass_bool_t value )

Appends a “boolean” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value cass_bool_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_string

( CassCollection * collection, const char * value )

Appends an “ascii”, “text” or “varchar” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value const char *

The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_string_n

( CassCollection * collection, const char * value, size_t value_length )

Same as CassCollection::cass_collection_append_string, but with lengths for string parameters.

Parameters:
Name Type Details
in collection CassCollection *
in value const char *
in value_length size_t
Returns:
Type Details
CassError

same as CassCollection::cass_collection_append_string

See Also:
CassError

cass_collection_append_bytes

( CassCollection * collection, const cass_byte_t * value, size_t value_size )

Appends a “blob”, “varint” or “custom” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value const cass_byte_t *

The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

in value_size size_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_custom

( CassCollection * collection, const char * class_name, const cass_byte_t * value, size_t value_size )

Appends a “custom” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in class_name const char *
in value const cass_byte_t *

The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

in value_size size_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_custom_n

( CassCollection * collection, const char * class_name, size_t class_name_length, const cass_byte_t * value, size_t value_size )

Same as CassCollection::cass_collection_append_custom, but with lengths for string parameters.

Parameters:
Name Type Details
in collection CassCollection *
in class_name const char *
in class_name_length size_t
in value const cass_byte_t *
in value_size size_t
Returns:
Type Details
CassError

same as CassCollection::cass_collection_append_custom

See Also:
CassError

cass_collection_append_uuid

( CassCollection * collection, CassUuid value )

Appends a “uuid” or “timeuuid” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value CassUuid
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_inet

( CassCollection * collection, CassInet value )

Appends an “inet” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in value CassInet
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_decimal

( CassCollection * collection, const cass_byte_t * varint, size_t varint_size, cass_int32_t scale )

Appends a “decimal” to the collection.

Parameters:
Name Type Details
in collection CassCollection *
in varint const cass_byte_t *

The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

in varint_size size_t
in scale cass_int32_t
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_collection

( CassCollection * collection, const CassCollection * value )

Appends a “list”, “map” or “set” to the collection.

Requires Cassandra: 2.1+

Parameters:
Name Type Details
in collection CassCollection *
in value const CassCollection *
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_tuple

( CassCollection * collection, const CassTuple * value )

Appends a “tuple” to the collection.

Requires Cassandra: 2.1+

Parameters:
Name Type Details
in collection CassCollection *
in value const CassTuple *
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_collection_append_user_type

( CassCollection * collection, const CassUserType * value )

Appends a “udt” to the collection.

Requires Cassandra: 2.1+

Parameters:
Name Type Details
in collection CassCollection *
in value const CassUserType *
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.