Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
IrSequence Class Reference

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

#include <IrSequence.h>

Collaboration diagram for IrSequence:
Collaboration graph
[legend]

Public Member Functions

 IrSequence ()
 Create an empty sequence. More...
 
 IrSequence (const microseconds_t *durations, size_t length)
 Creates an IrSequence. More...
 
virtual ~IrSequence ()
 
 IrSequence (const IrSequence &orig)
 Copy constructor. More...
 
 IrSequence (IrSequence &&orig)
 Move constructor. More...
 
IrSequenceoperator= (const IrSequence &rhs)
 Copy assignment. More...
 
IrSequenceoperator= (IrSequence &&rhs)
 Move assignment. More...
 
 operator bool () const
 True if and only if non-empty. More...
 
size_t getLength () const
 Returns the number of durations. More...
 
bool isEmpty () const
 
const microseconds_tgetDurations () const
 
size_t size () const
 
const microseconds_tbegin () const
 
const microseconds_tend () const
 
microseconds_t operator[] (int i) const
 
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)
 Create an IrSequence from data in PROGMEM. More...
 

Static Public Attributes

static const IrSequence emptyInstance
 

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 (except for assignments).

Definition at line 11 of file IrSequence.h.

Constructor & Destructor Documentation

◆ IrSequence() [1/4]

IrSequence::IrSequence ( )
inline

Create an empty sequence.

Definition at line 18 of file IrSequence.h.

◆ IrSequence() [2/4]

IrSequence::IrSequence ( const microseconds_t durations,
size_t  length 
)

Creates an IrSequence.

Parameters
durationsconst array of microseconds durations. Will be "moved", and delete []-d by the destructor.
lengthlength of durations. Should be even (not checked).

Definition at line 5 of file IrSequence.cpp.

◆ ~IrSequence()

IrSequence::~IrSequence ( )
virtual

Definition at line 41 of file IrSequence.cpp.

◆ IrSequence() [3/4]

IrSequence::IrSequence ( const IrSequence orig)

Copy constructor.

Parameters
origoriginal IrSequence to be copied.

Definition at line 13 of file IrSequence.cpp.

◆ IrSequence() [4/4]

IrSequence::IrSequence ( IrSequence &&  orig)

Move constructor.

Parameters
origoriginal IrSequence to be moved

Definition at line 8 of file IrSequence.cpp.

Member Function Documentation

◆ begin()

const microseconds_t * IrSequence::begin ( ) const
inline

Definition at line 81 of file IrSequence.h.

◆ 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 47 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 105 of file IrSequence.h.

◆ end()

const microseconds_t * IrSequence::end ( ) const
inline

Definition at line 85 of file IrSequence.h.

◆ getDurations()

const microseconds_t * IrSequence::getDurations ( ) const
inline

Definition at line 73 of file IrSequence.h.

◆ getLength()

size_t IrSequence::getLength ( ) const
inline

Returns the number of durations.

Returns
length

Definition at line 65 of file IrSequence.h.

◆ isEmpty()

bool IrSequence::isEmpty ( ) const
inline

Definition at line 69 of file IrSequence.h.

◆ operator bool()

IrSequence::operator bool ( ) const
inline

True if and only if non-empty.

Returns

Definition at line 59 of file IrSequence.h.

◆ operator=() [1/2]

IrSequence & IrSequence::operator= ( const IrSequence rhs)

Copy assignment.

Parameters
rhs

Definition at line 31 of file IrSequence.cpp.

◆ operator=() [2/2]

IrSequence & IrSequence::operator= ( IrSequence &&  rhs)

Move assignment.

Parameters
rhs

Definition at line 20 of file IrSequence.cpp.

◆ operator[]()

microseconds_t IrSequence::operator[] ( int  i) const
inline

Definition at line 89 of file IrSequence.h.

◆ readFlash()

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

Create an IrSequence from data in PROGMEM.

This must manually be deleted by the programmer. The function is available only on platforms implementing the memcpy_PF call.

Parameters
flashData
length
Returns
Pointer to IrSequence.

◆ size()

size_t IrSequence::size ( ) const
inline

Definition at line 77 of file IrSequence.h.

Member Data Documentation

◆ emptyInstance

const IrSequence IrSequence::emptyInstance
static

Definition at line 53 of file IrSequence.h.


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