Infrared4Arduino
Public Member Functions | Static 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, bool toBeFreed=false)
 Creates an IrSequence. More...
 
virtual ~IrSequence ()
 
 IrSequence (const IrSequence &orig)
 Performs shallow copy. More...
 
 IrSequence (const IrSequence &orig, bool toBeFreed)
 Performs shallow copy. More...
 
size_t getLength () const
 Returns the length of the data. More...
 
bool isEmpty () const
 
const microseconds_tgetDurations () const
 
IrSequenceclone () const
 Creates a (deep) clone of the current object. More...
 
void dump (Stream &stream, bool usingSigns=false) const
 Prints the IrSequence on the stream provided. More...
 
void dumpWithSigns (Stream &stream) const
 Prints the IrSequence on the stream provided. More...
 

Static Public Member Functions

static IrSequencereadFlash (const microseconds_t *flashData, size_t length)
 

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 11 of file IrSequence.h.

Constructor & Destructor Documentation

◆ IrSequence() [1/4]

IrSequence::IrSequence ( )

Create an empty sequence.

Definition at line 4 of file IrSequence.cpp.

◆ IrSequence() [2/4]

IrSequence::IrSequence ( const microseconds_t durations,
size_t  length,
bool  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::~IrSequence ( )
virtual

Definition at line 17 of file IrSequence.cpp.

◆ IrSequence() [3/4]

IrSequence::IrSequence ( const IrSequence orig)

Performs shallow copy.

Parameters
origoriginal IrSequence to be cloned

Definition at line 11 of file IrSequence.cpp.

◆ IrSequence() [4/4]

IrSequence::IrSequence ( const IrSequence orig,
bool  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

◆ clone()

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.

◆ dump()

void IrSequence::dump ( Stream &  stream,
bool  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.

◆ dumpWithSigns()

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 79 of file IrSequence.h.

◆ getDurations()

const microseconds_t* IrSequence::getDurations ( ) const
inline

Definition at line 56 of file IrSequence.h.

◆ getLength()

size_t IrSequence::getLength ( ) const
inline

Returns the length of the data.

Returns
length

Definition at line 48 of file IrSequence.h.

◆ isEmpty()

bool IrSequence::isEmpty ( ) const
inline

Definition at line 52 of file IrSequence.h.

◆ readFlash()

IrSequence * IrSequence::readFlash ( const microseconds_t flashData,
size_t  length 
)
static

Definition at line 40 of file IrSequence.cpp.


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