StreamBase C++ API  10.6.2.5
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...
 
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...
 
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...
 
Tupleback ()
 return the last tuple in the list More...
 
const Tupleback () 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...
 

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

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

Member Function Documentation

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.
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.

void sb::TupleList::clear ( )
inline

clear the list

bool sb::TupleList::empty ( ) const
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

void sb::TupleList::resize ( size_t  size)
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.

size_t sb::TupleList::size ( ) const
inline

Get the number of tuples in the list.


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