Stimfit  0.13.15
Public Member Functions

A Channel contains several data Sections representing observations of the same physical quantity. More...

#include <channel.h>

List of all members.

Public Member Functions

 Channel (void)
 Default constructor.
 Channel (const Section &c_Section)
 Constructor.
 Channel (const std::vector< Section > &SectionList)
 Constructor.
 Channel (std::size_t c_n_sections, std::size_t section_size=0)
 Constructor.
 ~Channel ()
 Destructor.
Sectionoperator[] (std::size_t at_)
 Unchecked access to a section (read and write)
const Sectionoperator[] (std::size_t at_) const
 Unchecked access to a section (read-only)
const std::string & GetChannelName () const
 Retrieves the channel name.
const std::string & GetYUnits () const
 Retrieves the y units string.
size_t size () const
 Retrieves the size of the section array.
const Sectionat (std::size_t at_) const
 Range-checked access to a section (read-only).
Sectionat (std::size_t at_)
 Range-checked access to a section (read and write).
const std::vector< Section > & get () const
 Low-level access to the section array (read-only).
std::vector< Section > & get ()
 Low-level access to the section array (read and write).
void SetChannelName (const std::string &value)
 Sets the channel name.
void SetYUnits (const std::string &value)
 Sets the y units string.
void InsertSection (const Section &c_Section, std::size_t pos)
 Inserts a section at the given position, overwriting anything that's currently stored at that position.
void resize (std::size_t newSize)
 Resize the section array.
void reserve (std::size_t resSize)
 Reserve memory for a number of sections.

Detailed Description

A Channel contains several data Sections representing observations of the same physical quantity.

Definition at line 31 of file channel.h.


Constructor & Destructor Documentation

Channel::Channel ( const Section c_Section) [explicit]

Constructor.

Parameters:
c_SectionA single section from which to construct the channel
Channel::Channel ( const std::vector< Section > &  SectionList) [explicit]

Constructor.

Parameters:
SectionListA vector of Sections from which to construct the channel
Channel::Channel ( std::size_t  c_n_sections,
std::size_t  section_size = 0 
) [explicit]

Constructor.

Setting the number of sections at construction time will avoid unnecessary memory re-allocations.

Parameters:
c_n_sectionsThe number of sections.
section_sizeInitial section size. Will serve additional re-alocations if known at construction time.

Member Function Documentation

const Section& Channel::at ( std::size_t  at_) const

Range-checked access to a section (read-only).

Will throw std::out_of_range if out of range.

Parameters:
at_The index of the section.
Returns:
The section at index at_.
Section& Channel::at ( std::size_t  at_)

Range-checked access to a section (read and write).

Will throw std::out_of_range if out of range.

Parameters:
at_The index of the section.
Returns:
The section at index at_.
const std::vector< Section >& Channel::get ( ) const [inline]

Low-level access to the section array (read-only).

Returns:
The vector containing the sections.

Definition at line 110 of file channel.h.

std::vector< Section >& Channel::get ( ) [inline]

Low-level access to the section array (read and write).

Returns:
The vector containing the sections.

Definition at line 116 of file channel.h.

const std::string& Channel::GetChannelName ( ) const [inline]

Retrieves the channel name.

Returns:
The channel name.

Definition at line 81 of file channel.h.

const std::string& Channel::GetYUnits ( ) const [inline]

Retrieves the y units string.

Returns:
The y units string.

Definition at line 86 of file channel.h.

void Channel::InsertSection ( const Section c_Section,
std::size_t  pos 
)

Inserts a section at the given position, overwriting anything that's currently stored at that position.

Meant to be used after constructing with Channel(const unsigned int& c_n_sections}. The section array size has to be larger than pos because it won't be resized. Will throw std::out_of_range if out of range.

Parameters:
c_SectionThe section to be inserted.
posThe position at which to insert the section.
Section& Channel::operator[] ( std::size_t  at_) [inline]

Unchecked access to a section (read and write)

Use at() for range-checked access.

Parameters:
at_The section index.
Returns:
The section at index at_.

Definition at line 67 of file channel.h.

const Section& Channel::operator[] ( std::size_t  at_) const [inline]

Unchecked access to a section (read-only)

Use at() for range-checked access.

Parameters:
at_The section index.
Returns:
The section at index at_.

Definition at line 74 of file channel.h.

void Channel::reserve ( std::size_t  resSize)

Reserve memory for a number of sections.

This will avoid unnecessary memory re-allocations.

Parameters:
resSizeThe number of sections to reserve memory for.
void Channel::resize ( std::size_t  newSize)

Resize the section array.

Parameters:
newSizeThe new number of sections.
void Channel::SetChannelName ( const std::string &  value) [inline]

Sets the channel name.

Parameters:
valueThe channel name.

Definition at line 123 of file channel.h.

void Channel::SetYUnits ( const std::string &  value) [inline]

Sets the y units string.

Parameters:
valueThe new y units string.

Definition at line 128 of file channel.h.

size_t Channel::size ( ) const [inline]

Retrieves the size of the section array.

Returns:
The size of the section array.

Definition at line 91 of file channel.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines