Streaming C++ API
sb::TupleList Class Reference

TupleLists are value types that can be copied and modified seperately thus. More...

#include <TupleList.hpp>

Public Types

typedef std::vector< Tuple >::iterator iterator
 
typedef std::vector< Tuple >::const_iterator const_iterator
 

Public Member Functions

 TupleList ()
 Default (null) constructor. More...
 
 TupleList (const Tuple &tuple)
 Create tuple list from a single tuple. More...
 
 TupleList (const TupleList &list)
 Create tuple list from a tuplelist. More...
 
 TupleList (const Schema &schema, size_t size=0)
 Create tuple list with an initial size of size More...
 
const TupleListoperator= (const TupleList &rhs)
 
const SchemagetSchema () const
 Get the schema. More...
 
void setSchema (const Schema &schema)
 set the schema for this list (also setting the schema for any tuples in the list) More...
 
size_t getSize () const
 Get the number of tuples in the list. More...
 
size_t size () const
 
void resize (size_t size)
 Change the size of the list any new tuples will be entirely null. More...
 
void setSize (size_t size)
 
void clear ()
 clear the list More...
 
bool empty () const
 Is the list empty? More...
 
const Tupleoperator[] (size_t index) const
 Get the nth tuple. More...
 
Tupleoperator[] (size_t index)
 Get the nth tuple. More...
 
void push_back (const Tuple &r)
 append a tuple to the list More...
 
Tupleback ()
 return the last tuple in the list More...
 
const Tupleback () const
 
iterator begin ()
 STL compatible iterators. More...
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::string as_string () const
 Return a human-readable string value representing this list in its entirety (including all header values, if applicable). More...
 

Detailed Description

TupleLists are value types that can be copied and modified seperately thus.

tl2 = tl1; tl2[0].clear(); // 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

Constructor & Destructor Documentation

◆ TupleList() [1/4]

sb::TupleList::TupleList ( )

Default (null) constructor.

◆ TupleList() [2/4]

sb::TupleList::TupleList ( const Tuple tuple)

Create tuple list from a single tuple.

◆ TupleList() [3/4]

sb::TupleList::TupleList ( const TupleList list)

Create tuple list from a tuplelist.

◆ TupleList() [4/4]

sb::TupleList::TupleList ( const Schema schema,
size_t  size = 0 
)

Create tuple list with an initial size of size

Member Function Documentation

◆ as_string()

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

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

Returns
the string value.

◆ back()

Tuple & sb::TupleList::back ( )

return the last tuple in the list

◆ begin()

iterator sb::TupleList::begin ( )

STL compatible iterators.

◆ clear()

void sb::TupleList::clear ( )
inline

clear the list

◆ empty()

bool sb::TupleList::empty ( ) const
inline

Is the list empty?

◆ getSchema()

const Schema & sb::TupleList::getSchema ( ) const

Get the schema.

◆ getSize()

size_t sb::TupleList::getSize ( ) const

Get the number of tuples in the list.

◆ operator[]() [1/2]

Tuple & sb::TupleList::operator[] ( size_t  index)

Get the nth tuple.

Fails with a std::out_of_range exception if out of range.

◆ operator[]() [2/2]

const Tuple & sb::TupleList::operator[] ( size_t  index) const

Get the nth tuple.

Fails with a std::out_of_range exception if out of range.

◆ push_back()

void sb::TupleList::push_back ( const Tuple r)

append a tuple to the list

◆ resize()

void sb::TupleList::resize ( size_t  size)
inline

Change the size of the list any new tuples will be entirely null.

◆ setSchema()

void sb::TupleList::setSchema ( const Schema schema)

set the schema for this list (also setting the schema for any tuples in the list)


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