StreamBase C++ API
10.6.4.2
|
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 TupleList & | operator= (const TupleList &rhs) |
const Schema & | getSchema () 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... | |
void | clear () |
clear the list More... | |
bool | empty () const |
Is the list empty? More... | |
const Tuple & | operator[] (size_t index) const |
Get the nth tuple. More... | |
Tuple & | operator[] (size_t index) |
Get the nth tuple. More... | |
void | push_back (const Tuple &r) |
append a tuple to the list More... | |
std::string | as_string () const |
Return a human-readable string value representing this list in its entirety (including all header values, if applicable). More... | |
size_t | getSize () const |
Get the number of tuples in the list. More... | |
size_t | size () const |
Get the number of tuples in the list. More... | |
void | resize (size_t size) |
Change the size of the list any new tuples will be entirely null. More... | |
void | setSize (size_t size) |
Change the size of the list any new tuples will be entirely null. More... | |
Tuple & | back () |
return the last tuple in the list More... | |
const Tuple & | back () const |
return the last tuple in the list More... | |
iterator | begin () |
STL compatible iterators. More... | |
iterator | end () |
STL compatible iterators. More... | |
const_iterator | begin () const |
STL compatible iterators. More... | |
const_iterator | end () const |
STL compatible iterators. More... | |
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
sb::TupleList::TupleList | ( | ) |
Default (null) constructor.
sb::TupleList::TupleList | ( | const Tuple & | tuple | ) |
Create tuple list from a single tuple.
sb::TupleList::TupleList | ( | const TupleList & | list | ) |
Create tuple list from a tuplelist.
sb::TupleList::TupleList | ( | const Schema & | schema, |
size_t | size = 0 |
||
) |
Create tuple list with an initial size of size
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).
Tuple& sb::TupleList::back | ( | ) |
return the last tuple in the list
const Tuple& sb::TupleList::back | ( | ) | const |
return the last tuple in the list
iterator sb::TupleList::begin | ( | ) |
STL compatible iterators.
const_iterator sb::TupleList::begin | ( | ) | const |
STL compatible iterators.
|
inline |
clear the list
|
inline |
Is the list empty?
iterator sb::TupleList::end | ( | ) |
STL compatible iterators.
const_iterator sb::TupleList::end | ( | ) | const |
STL compatible iterators.
const Schema& sb::TupleList::getSchema | ( | ) | const |
Get the schema.
size_t sb::TupleList::getSize | ( | ) | const |
Get the number of tuples in the list.
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.
Tuple& sb::TupleList::operator[] | ( | size_t | index | ) |
Get the nth tuple.
Fails with a std::out_of_range exception if out of range.
void sb::TupleList::push_back | ( | const Tuple & | r | ) |
append a tuple to the list
|
inline |
Change the size of the list any new tuples will be entirely null.
void sb::TupleList::setSchema | ( | const Schema & | schema | ) |
set the schema for this list (also setting the schema for any tuples in the list)
void sb::TupleList::setSize | ( | size_t | size | ) |
Change the size of the list any new tuples will be entirely null.
|
inline |
Get the number of tuples in the list.