Infrared4Arduino
Public Member Functions | List of all members
IrSequence Class Reference

This class consists of a vector of durations. More...

#include <IrSequence.h>

Public Member Functions

 IrSequence ()
 Create an empty sequence. More...
 
 IrSequence (const microseconds_t *durations, size_t length, boolean toBeFreed=false)
 Creates an IrSequence. More...
 
virtual ~IrSequence ()
 
 IrSequence (const IrSequence &orig)
 Performs shallow copy. More...
 
 IrSequence (const IrSequence &orig, boolean toBeFreed)
 Performs shallow copy. More...
 
size_t getLength () const
 Returns the length of the data. More...
 
boolean isEmpty () const
 
const microseconds_tgetDurations () const
 
IrSequenceclone () const
 Creates a (deep) clone of the current object. More...
 
void dump (Stream &stream, boolean usingSigns=false) const
 Prints the IrSequence on the stream provided. More...
 
void dumpWithSigns (Stream &stream) const
 Prints the IrSequence on the stream provided. More...
 

Detailed Description

This class consists of a vector of durations.

The even entries denotes spaces, while the odd entries denotes gaps. The length should always be even, i.e., the sequences starts with a space, and ends with a gap. This class is immutable.

Definition at line 12 of file IrSequence.h.

Constructor & Destructor Documentation

IrSequence::IrSequence ( )

Create an empty sequence.

Definition at line 4 of file IrSequence.cpp.

IrSequence::IrSequence ( const microseconds_t durations,
size_t  length,
boolean  toBeFreed = false 
)

Creates an IrSequence.

Parameters
durationsconst array of microseconds durations
lengthlength of durations. Shuld be even (not checked).
toBeFreedIf true, the destructor will delete the durations array.

Definition at line 7 of file IrSequence.cpp.

IrSequence::~IrSequence ( )
virtual

Definition at line 17 of file IrSequence.cpp.

IrSequence::IrSequence ( const IrSequence orig)

Performs shallow copy.

Parameters
origoriginal IrSequence to be cloned

Definition at line 11 of file IrSequence.cpp.

IrSequence::IrSequence ( const IrSequence orig,
boolean  toBeFreed 
)

Performs shallow copy.

Parameters
origoriginal IrSequence to be cloned
toBeFreedIf true, the destructor will delete the durations array.

Definition at line 14 of file IrSequence.cpp.

Member Function Documentation

IrSequence * IrSequence::clone ( ) const

Creates a (deep) clone of the current object.

The used must delete it manually.

Returns
pointer to the cloned object

Definition at line 22 of file IrSequence.cpp.

void IrSequence::dump ( Stream &  stream,
boolean  usingSigns = false 
) const

Prints the IrSequence on the stream provided.

Parameters
streamStream onto the output is printed.
usingSignsIf true, Gaps are written with a leading '+', spaces with a leading '-'.

Definition at line 28 of file IrSequence.cpp.

void IrSequence::dumpWithSigns ( Stream &  stream) const
inline

Prints the IrSequence on the stream provided.

Gaps are written with a leading '+', spaces with a leading '-'.

Parameters
streamStream onto the output is printed.

Definition at line 80 of file IrSequence.h.

const microseconds_t* IrSequence::getDurations ( ) const
inline

Definition at line 57 of file IrSequence.h.

size_t IrSequence::getLength ( ) const
inline

Returns the length of the data.

Returns
length

Definition at line 49 of file IrSequence.h.

boolean IrSequence::isEmpty ( ) const
inline

Definition at line 53 of file IrSequence.h.


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