StreamBase C++ API  10.6.1.0
sb::Tuple Class Reference

Tuples are value types that can be copied and modified separately thus. More...

#include <Tuple.hpp>

Public Types

enum  Flags { NONE = 0, TRUNCATE = 1 }
 Flags that can be passed to setString(). More...
 

Public Member Functions

 Tuple (const Tuple &t)
 Copy constructor. More...
 
 Tuple (const Schema &s)
 Construct a tuple of the specified schema. More...
 
 ~Tuple ()
 Destructor. More...
 
const Tupleoperator= (const Tuple &rhs)
 
bool operator== (const Tuple &rhs) const
 
void verify () const
 verify that the tuple is valid Throws StreamBaseException on invalid tuple More...
 
void clear ()
 null all fields in the tuple More...
 
const SchemagetSchema () const
 
void setSchema (const Schema &)
 set the schema More...
 
size_t getNumFields () const
 
size_t getSize () const
 
FieldValuegetFieldValue (const Field &f)
 Takes a field with a path and returns the field at the target of that path. More...
 
const FieldValuegetFieldValue (const Schema::Field &f) const
 Takes a field with a path and returns the field at the target of that path. More...
 
FieldValuegetFieldValue (size_t field_num)
 Takes the index of a field in this tuple's schema, returns the corresponding field value. More...
 
const FieldValuegetFieldValue (size_t field_num) const
 Takes the index of a field in this tuple's schema, returns the corresponding field value. More...
 
FieldValuegetFieldValue (const std::string &field_name)
 Takes the name of a field in this tuple's schema, returns the corresponding field value. More...
 
const FieldValuegetFieldValue (const std::string &field_name) const
 Takes the name of a field in this tuple's schema, returns the corresponding field value. More...
 
void setFieldValue (const Field &f, const FieldValue &fv)
 Takes a field with a path and sets the value of the field at the target of that path to that of the provided FieldValue. More...
 
void setFieldValue (size_t field_num, const FieldValue &fv)
 Takes the index of a field in this tuple's schema and sets the corresponding field value. More...
 
void setFieldValue (const std::string &field_name, const FieldValue &fv)
 Takes the name of a field in this tuple's schema and sets the corresponding field value. More...
 
bool hasHeader () const
 
unsigned int getId () const
 
void setId (unsigned int tid)
 set the id More...
 
std::string as_string () const
 Return a human-readable string value representing this tuple in its entirety (including all header values, if applicable). More...
 
std::string as_string_external (char delimiter= ',', const std::string &null_string=getNullString()) const
 Return a human-readable string value representing this tuple. More...
 
std::string toDelimitedString (const std::string &delimiter, const std::string &null_string=getNullString(), bool include_names=false, bool quote_all_strings=false) const
 Return a string value representing this tuple, separated by the given delimiter. More...
 
template<typename T >
get (const Field &f) const
 Return the value of the given field of type T. More...
 
template<typename T >
get (size_t i) const
 Return the value of the given field of type T. More...
 
template<typename T >
get (const std::string &field_name) const
 Return the value of the given field of type T. More...
 
template<typename T >
void set (const Field &field, T value)
 Set a field to a specific value. More...
 
template<typename T >
void set (int fieldNum, T value)
 Set a field to a specific value. More...
 
template<typename T >
void set (const std::string &field_name, T value)
 Set a field to a specific value. More...
 
bool isNull (const Field &f) const
 Test the null setting for field f. More...
 
bool isNull (size_t i) const
 Test the null setting for field f. More...
 
bool isNull (const std::string &n) const
 Test the null setting for field f. More...
 
void setNull (const Field &f)
 Set the null setting for field f. More...
 
void setNull (size_t i)
 Set the null setting for field f. More...
 
void setNull (const std::string &n)
 Set the null setting for field f. More...
 
bool getBool (const Field &f) const
 Return the value of a Boolean field. More...
 
bool getBool (size_t i) const
 Return the value of a Boolean field. More...
 
bool getBool (const std::string &n) const
 Return the value of a Boolean field. More...
 
void setBool (const Field &f, bool v)
 Set the value of a Boolean field. More...
 
void setBool (size_t i, bool v)
 Set the value of a Boolean field. More...
 
void setBool (const std::string &n, bool v)
 Set the value of a Boolean field. More...
 
int getInt (const Field &f) const
 Return the value of an int field. More...
 
int getInt (size_t i) const
 Return the value of an int field. More...
 
int getInt (const std::string &n) const
 Return the value of an int field. More...
 
void setInt (const Field &f, int v)
 Set the value of an integer field. More...
 
void setInt (size_t i, int v)
 Set the value of an integer field. More...
 
void setInt (const std::string &n, int v)
 Set the value of an integer field. More...
 
long long getLong (const Field &f) const
 Return the value of a long field. More...
 
long long getLong (size_t i) const
 Return the value of a long field. More...
 
long long getLong (const std::string &n) const
 Return the value of a long field. More...
 
void setLong (const Field &f, long long v)
 Set the value of a long field. More...
 
void setLong (size_t i, long long v)
 Set the value of a long field. More...
 
void setLong (const std::string &n, long long v)
 Set the value of a long field. More...
 
double getDouble (const Field &f) const
 Return the value of a double field. More...
 
double getDouble (size_t i) const
 Return the value of a double field. More...
 
double getDouble (const std::string &n) const
 Return the value of a double field. More...
 
void setDouble (const Field &f, double v)
 Set the value of a double field. More...
 
void setDouble (size_t i, double v)
 Set the value of a double field. More...
 
void setDouble (const std::string &n, double v)
 Set the value of a double field. More...
 
Timestamp getTimestamp (const Field &f) const
 Return the value of a Timestamp field. More...
 
Timestamp getTimestamp (size_t i) const
 Return the value of a Timestamp field. More...
 
Timestamp getTimestamp (const std::string &n) const
 Return the value of a Timestamp field. More...
 
void setTimestamp (const Field &f, const Timestamp &v)
 Set the value of a Timestamp field. More...
 
void setTimestamp (size_t i, const Timestamp &v)
 Set the value of a Timestamp field. More...
 
void setTimestamp (const std::string &n, const Timestamp &v)
 Set the value of a Timestamp field. More...
 
const std::string & getBlobBuffer (const Field &f) const
 Return the value of a BLOB field. More...
 
const std::string & getBlobBuffer (size_t i) const
 Return the value of a BLOB field. More...
 
const std::string & getBlobBuffer (const std::string &n) const
 Return the value of a BLOB field. More...
 
void setBlobBuffer (const Field &f, const std::string &v)
 Set the value of a BLOB field. More...
 
void setBlobBuffer (size_t i, const std::string &v)
 Set the value of a BLOB field. More...
 
void setBlobBuffer (const std::string &n, const std::string &v)
 Set the value of a BLOB field. More...
 
const std::vector< FieldValue > & getList (const Schema::Field &f) const
 Return the value of a LIST field. More...
 
const std::vector< FieldValue > & getList (size_t i) const
 Return the value of a LIST field. More...
 
const std::vector< FieldValue > & getList (const std::string &n) const
 Return the value of a LIST field. More...
 
void setList (const Schema::Field &f, const std::vector< FieldValue > &v)
 Set the value of a LIST field. More...
 
void setList (size_t i, const std::vector< FieldValue > &v)
 Set the value of a LIST field. More...
 
void setList (const std::string &n, const std::vector< FieldValue > &v)
 Set the value of a LIST field. More...
 
const std::string & getString (const Field &f) const
 Return the value of a string field. More...
 
const std::string & getString (size_t i) const
 Return the value of a string field. More...
 
const std::string & getString (const std::string &n) const
 Return the value of a string field. More...
 
void setString (const Field &field, const std::string &value, Flags flags=NONE)
 Set the value of a string field. More...
 
void setString (size_t field, const char *data, size_t len, Flags flags=NONE)
 Set the value of a string field. More...
 
void setString (const std::string &field, const char *data, size_t len, Flags flags=NONE)
 Set the value of a string field. More...
 
void setString (const Field &field, const char *data, size_t len, Flags flags=NONE)
 Set the value of a string field. More...
 
void setString (size_t field_index, const std::string &value, Flags flags=NONE)
 Set the value of a string field. More...
 
void setString (const std::string &field_name, const std::string &value, Flags flags=NONE)
 Set the value of a string field. More...
 
const TuplegetTuple (const Field &f) const
 Return the value of a nested tuple field. More...
 
const TuplegetTuple (size_t i) const
 Return the value of a nested tuple field. More...
 
const TuplegetTuple (const std::string &n) const
 Return the value of a nested tuple field. More...
 
const Function & getFunction (const Field &f) const
 Return the value of a function field. More...
 
const Function & getFunction (size_t i) const
 Return the value of a function field. More...
 
const Function & getFunction (const std::string &n) const
 Return the value of a function field. More...
 
void setTuple (const Field &f, const Tuple &v)
 Set the value of a nested tuple field. More...
 
void setTuple (size_t i, const Tuple &v)
 Set the value of a nested tuple field. More...
 
void setTuple (const std::string &n, const Tuple &v)
 Set the value of a nested tuple field. More...
 
void setFunction (const Field &f, const Function &v)
 Set the value of a function field. More...
 
void setFunction (size_t i, const Function &v)
 Set the value of a function field. More...
 
void setFunction (const std::string &n, const Function &v)
 Set the value of a function field. More...
 

Static Public Member Functions

static const std::string & getNullString ()
 Return the default string used to represent null, i.e., null. More...
 

Detailed Description

Tuples are value types that can be copied and modified separately thus.

t2 = t1;
t2.setId(0); // does not modify t1

They will only make copies of the underlying data as needed, so they are relatively cheap to pass around by value

Member Enumeration Documentation

Flags that can be passed to setString().

TRUNCATE: starting in StreamBase 6.3 the string type does not have a declared length and strings are never truncated.

Constructor & Destructor Documentation

sb::Tuple::Tuple ( const Tuple t)

Copy constructor.

sb::Tuple::Tuple ( const Schema s)

Construct a tuple of the specified schema.

sb::Tuple::~Tuple ( )

Destructor.

Member Function Documentation

std::string sb::Tuple::as_string ( ) const

Return a human-readable string value representing this tuple in its entirety (including all header values, if applicable).

Returns
the string value.
std::string sb::Tuple::as_string_external ( char  delimiter = ',',
const std::string &  null_string = getNullString() 
) const

Return a human-readable string value representing this tuple.

It compares to as_string by allowing a user-specified delimiter between fields, making the header timestamp stand out, and omitting the TupleId header field. null_string is written out for any null field.

Returns
the string value
void sb::Tuple::clear ( )
inline

null all fields in the tuple

template<typename T >
T sb::Tuple::get ( const Field f) const
inline

Return the value of the given field of type T.

T must be one of string, int, double, bool, long, or Timestamp, and correspond to the field's actual type.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the value of the field.
template<typename T >
T sb::Tuple::get ( size_t  i) const
inline

Return the value of the given field of type T.

T must be one of string, int, double, bool, long, or Timestamp, and correspond to the field's actual type.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the value of the field.
template<typename T >
T sb::Tuple::get ( const std::string &  field_name) const
inline

Return the value of the given field of type T.

T must be one of string, int, double, bool, long, or Timestamp, and correspond to the field's actual type.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the value of the field.
const std::string& sb::Tuple::getBlobBuffer ( const Field f) const

Return the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the BLOB value.
const std::string& sb::Tuple::getBlobBuffer ( size_t  i) const
inline

Return the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the BLOB value.
const std::string& sb::Tuple::getBlobBuffer ( const std::string &  n) const
inline

Return the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the BLOB value.
bool sb::Tuple::getBool ( const Field f) const

Return the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Boolean value.
bool sb::Tuple::getBool ( size_t  i) const
inline

Return the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Boolean value.
bool sb::Tuple::getBool ( const std::string &  n) const
inline

Return the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Boolean value.
double sb::Tuple::getDouble ( const Field f) const

Return the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the double value.
double sb::Tuple::getDouble ( size_t  i) const
inline

Return the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the double value.
double sb::Tuple::getDouble ( const std::string &  n) const
inline

Return the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the double value.
FieldValue& sb::Tuple::getFieldValue ( const Field f)

Takes a field with a path and returns the field at the target of that path.

const FieldValue& sb::Tuple::getFieldValue ( const Schema::Field f) const

Takes a field with a path and returns the field at the target of that path.

FieldValue& sb::Tuple::getFieldValue ( size_t  field_num)

Takes the index of a field in this tuple's schema, returns the corresponding field value.

const FieldValue& sb::Tuple::getFieldValue ( size_t  field_num) const

Takes the index of a field in this tuple's schema, returns the corresponding field value.

FieldValue& sb::Tuple::getFieldValue ( const std::string &  field_name)

Takes the name of a field in this tuple's schema, returns the corresponding field value.

const FieldValue& sb::Tuple::getFieldValue ( const std::string &  field_name) const

Takes the name of a field in this tuple's schema, returns the corresponding field value.

const Function& sb::Tuple::getFunction ( const Field f) const

Return the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the function value.
const Function& sb::Tuple::getFunction ( size_t  i) const
inline

Return the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the function value.
const Function& sb::Tuple::getFunction ( const std::string &  n) const
inline

Return the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the function value.
unsigned int sb::Tuple::getId ( ) const
Returns
The id for this tuple
int sb::Tuple::getInt ( const Field f) const

Return the value of an int field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the int value.
int sb::Tuple::getInt ( size_t  i) const
inline

Return the value of an int field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the int value.
int sb::Tuple::getInt ( const std::string &  n) const
inline

Return the value of an int field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the int value.
const std::vector<FieldValue>& sb::Tuple::getList ( const Schema::Field f) const

Return the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the LIST value.
const std::vector<FieldValue>& sb::Tuple::getList ( size_t  i) const
inline

Return the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the LIST value.
const std::vector<FieldValue>& sb::Tuple::getList ( const std::string &  n) const
inline

Return the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the LIST value.
long long sb::Tuple::getLong ( const Field f) const

Return the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the long value.
long long sb::Tuple::getLong ( size_t  i) const
inline

Return the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the long value.
long long sb::Tuple::getLong ( const std::string &  n) const
inline

Return the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the long value.
static const std::string& sb::Tuple::getNullString ( )
inlinestatic

Return the default string used to represent null, i.e., null.

size_t sb::Tuple::getNumFields ( ) const
inline
Returns
the number of fields in the tuple's schema

References sb::Schema::getNumFields().

const Schema& sb::Tuple::getSchema ( ) const
Returns
the schema
size_t sb::Tuple::getSize ( ) const
Returns
the serialized size of this tuple
const std::string& sb::Tuple::getString ( const Field f) const

Return the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the string value.
const std::string& sb::Tuple::getString ( size_t  i) const
inline

Return the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the string value.
const std::string& sb::Tuple::getString ( const std::string &  n) const
inline

Return the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the string value.
Timestamp sb::Tuple::getTimestamp ( const Field f) const

Return the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Timestamp value.
Timestamp sb::Tuple::getTimestamp ( size_t  i) const
inline

Return the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Timestamp value.
Timestamp sb::Tuple::getTimestamp ( const std::string &  n) const
inline

Return the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the Timestamp value.
const Tuple& sb::Tuple::getTuple ( const Field f) const

Return the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the nested tuple value.
const Tuple& sb::Tuple::getTuple ( size_t  i) const
inline

Return the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the nested tuple value.
const Tuple& sb::Tuple::getTuple ( const std::string &  n) const
inline

Return the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
the nested tuple value.
bool sb::Tuple::hasHeader ( ) const
inline
Returns
true if tuple has a header, false otherwise
bool sb::Tuple::isNull ( const Field f) const

Test the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
true if field is null, false otherwise
bool sb::Tuple::isNull ( size_t  i) const
inline

Test the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
true if field is null, false otherwise
bool sb::Tuple::isNull ( const std::string &  n) const
inline

Test the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

Returns
true if field is null, false otherwise
template<typename T >
void sb::Tuple::set ( const Field field,
value 
)
inline

Set a field to a specific value.

Supported values are string, int, double, bool and Timestamp. field must be a of a matching DataType.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

template<typename T >
void sb::Tuple::set ( int  fieldNum,
value 
)
inline

Set a field to a specific value.

Supported values are string, int, double, bool and Timestamp. field must be a of a matching DataType.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

template<typename T >
void sb::Tuple::set ( const std::string &  field_name,
value 
)
inline

Set a field to a specific value.

Supported values are string, int, double, bool and Timestamp. field must be a of a matching DataType.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBlobBuffer ( const Field f,
const std::string &  v 
)

Set the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBlobBuffer ( size_t  i,
const std::string &  v 
)
inline

Set the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBlobBuffer ( const std::string &  n,
const std::string &  v 
)
inline

Set the value of a BLOB field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBool ( const Field f,
bool  v 
)

Set the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBool ( size_t  i,
bool  v 
)
inline

Set the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setBool ( const std::string &  n,
bool  v 
)
inline

Set the value of a Boolean field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setDouble ( const Field f,
double  v 
)

Set the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setDouble ( size_t  i,
double  v 
)
inline

Set the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setDouble ( const std::string &  n,
double  v 
)
inline

Set the value of a double field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setFieldValue ( const Field f,
const FieldValue fv 
)

Takes a field with a path and sets the value of the field at the target of that path to that of the provided FieldValue.

void sb::Tuple::setFieldValue ( size_t  field_num,
const FieldValue fv 
)

Takes the index of a field in this tuple's schema and sets the corresponding field value.

void sb::Tuple::setFieldValue ( const std::string &  field_name,
const FieldValue fv 
)

Takes the name of a field in this tuple's schema and sets the corresponding field value.

void sb::Tuple::setFunction ( const Field f,
const Function &  v 
)

Set the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setFunction ( size_t  i,
const Function &  v 
)
inline

Set the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setFunction ( const std::string &  n,
const Function &  v 
)
inline

Set the value of a function field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setId ( unsigned int  tid)

set the id

void sb::Tuple::setInt ( const Field f,
int  v 
)

Set the value of an integer field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setInt ( size_t  i,
int  v 
)
inline

Set the value of an integer field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setInt ( const std::string &  n,
int  v 
)
inline

Set the value of an integer field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setList ( const Schema::Field f,
const std::vector< FieldValue > &  v 
)

Set the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setList ( size_t  i,
const std::vector< FieldValue > &  v 
)
inline

Set the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setList ( const std::string &  n,
const std::vector< FieldValue > &  v 
)
inline

Set the value of a LIST field.

The Schema::Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setLong ( const Field f,
long long  v 
)

Set the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setLong ( size_t  i,
long long  v 
)
inline

Set the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setLong ( const std::string &  n,
long long  v 
)
inline

Set the value of a long field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setNull ( const Field f)

Set the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setNull ( size_t  i)
inline

Set the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

References setNull().

Referenced by setNull().

void sb::Tuple::setNull ( const std::string &  n)
inline

Set the null setting for field f.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

References setNull().

Referenced by setNull().

void sb::Tuple::setSchema ( const Schema )

set the schema

void sb::Tuple::setString ( const Field field,
const std::string &  value,
Flags  flags = NONE 
)

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setString ( size_t  field,
const char *  data,
size_t  len,
Flags  flags = NONE 
)
inline

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setString ( const std::string &  field,
const char *  data,
size_t  len,
Flags  flags = NONE 
)
inline

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setString ( const Field field,
const char *  data,
size_t  len,
Flags  flags = NONE 
)
inline

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setString ( size_t  field_index,
const std::string &  value,
Flags  flags = NONE 
)
inline

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setString ( const std::string &  field_name,
const std::string &  value,
Flags  flags = NONE 
)
inline

Set the value of a string field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTimestamp ( const Field f,
const Timestamp v 
)

Set the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTimestamp ( size_t  i,
const Timestamp v 
)
inline

Set the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTimestamp ( const std::string &  n,
const Timestamp v 
)
inline

Set the value of a Timestamp field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTuple ( const Field f,
const Tuple v 
)

Set the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTuple ( size_t  i,
const Tuple v 
)
inline

Set the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

void sb::Tuple::setTuple ( const std::string &  n,
const Tuple v 
)
inline

Set the value of a nested tuple field.

The Field objects used to set and get Tuple field values must be obtained via the Tuple's Schema object. A Schema.Field object that has been created by the user or retrieved from a different Schema may not work.

std::string sb::Tuple::toDelimitedString ( const std::string &  delimiter,
const std::string &  null_string = getNullString(),
bool  include_names = false,
bool  quote_all_strings = false 
) const

Return a string value representing this tuple, separated by the given delimiter.

Parameters
delimiterthe string to put between fields
null_stringthe string used to represent null values
include_nameswhether to preface each field with "<name>="
quote_all_stringswhether to put quotes around all strings, regardless of need
Returns
the result string
void sb::Tuple::verify ( ) const

verify that the tuple is valid Throws StreamBaseException on invalid tuple


The documentation for this class was generated from the following file: