Infrared4Arduino
IrSequence.h
Go to the documentation of this file.
1 #ifndef IRSEQUENCE_H
2 #define IRSEQUENCE_H
3 
4 #include "InfraredTypes.h"
5 
12 class IrSequence {
13 private:
14  const microseconds_t *durations;
15  size_t length;
16  boolean toBeFreed;
17 
18 public:
20  IrSequence();
21 
28  IrSequence(const microseconds_t *durations, size_t length, boolean toBeFreed = false);
29 
30  virtual ~IrSequence();
31 
36  IrSequence(const IrSequence& orig);
37 
43  IrSequence(const IrSequence& orig, boolean toBeFreed);
44 
49  size_t getLength() const {
50  return length;
51  }
52 
53  boolean isEmpty() const {
54  return length == 0;
55  }
56 
57  const microseconds_t *getDurations() const {
58  return durations;
59  }
60 
66  IrSequence *clone() const;
67 
73  void dump(Stream& stream, boolean usingSigns = false) const;
74 
80  void dumpWithSigns(Stream& stream) const {
81  dump(stream, true);
82  };
83 };
84 
85 #endif /* IRSEQUENCE_H */
86 
boolean isEmpty() const
Definition: IrSequence.h:53
uint16_t microseconds_t
Type for durations in micro seconds.
Definition: InfraredTypes.h:16
void dump(Stream &stream, boolean usingSigns=false) const
Prints the IrSequence on the stream provided.
Definition: IrSequence.cpp:28
IrSequence * clone() const
Creates a (deep) clone of the current object.
Definition: IrSequence.cpp:22
size_t getLength() const
Returns the length of the data.
Definition: IrSequence.h:49
const microseconds_t * getDurations() const
Definition: IrSequence.h:57
This class consists of a vector of durations.
Definition: IrSequence.h:12
virtual ~IrSequence()
Definition: IrSequence.cpp:17
This file defines some general data types that are used in the library.
IrSequence()
Create an empty sequence.
Definition: IrSequence.cpp:4
void dumpWithSigns(Stream &stream) const
Prints the IrSequence on the stream provided.
Definition: IrSequence.h:80