DevSlashLirc
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
 
microseconds_t getTotalDuration () const
 
IrSequenceclone () const
 Creates a (deep) clone of the current object. More...
 
void dump (std::ostream &stream=std::cout, bool usingSigns=false) const
 Prints the IrSequence on the stream provided. More...
 
void dumpWithSigns (std::ostream &stream=std::cout) const
 Prints the IrSequence on the stream provided. More...
 
const char * toString () const
 

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

Constructor & Destructor Documentation

◆ IrSequence() [1/4]

IrSequence::IrSequence ( )

Create an empty sequence.

Definition at line 6 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 9 of file IrSequence.cpp.

◆ ~IrSequence()

IrSequence::~IrSequence ( )
virtual

Definition at line 19 of file IrSequence.cpp.

◆ IrSequence() [3/4]

IrSequence::IrSequence ( const IrSequence orig)

Performs shallow copy.

Parameters
origoriginal IrSequence to be cloned

Definition at line 13 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 16 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 24 of file IrSequence.cpp.

◆ dump()

void IrSequence::dump ( std::ostream &  stream = std::cout,
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 30 of file IrSequence.cpp.

◆ dumpWithSigns()

void IrSequence::dumpWithSigns ( std::ostream &  stream = std::cout) 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 85 of file IrSequence.h.

◆ getDurations()

const microseconds_t* IrSequence::getDurations ( ) const
inline

Definition at line 60 of file IrSequence.h.

◆ getLength()

size_t IrSequence::getLength ( ) const
inline

Returns the length of the data.

Returns
length

Definition at line 52 of file IrSequence.h.

◆ getTotalDuration()

microseconds_t IrSequence::getTotalDuration ( ) const

Definition at line 50 of file IrSequence.cpp.

◆ isEmpty()

bool IrSequence::isEmpty ( ) const
inline

Definition at line 56 of file IrSequence.h.

◆ toString()

const char * IrSequence::toString ( ) const

Definition at line 41 of file IrSequence.cpp.


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