blip  0.1
Looper.hpp
Go to the documentation of this file.
1 #include <blip/Blip.hpp>
2 
3 struct ALooper;
4 
5 namespace blip {
6 
11 class Looper
12 {
13  friend class NativeActivity;
14 
15  public:
16 
18  Looper();
19 
21  ~Looper();
22 
29  void addInputDescriptor(filedesc_t fd, uint_t id);
30 
37  void addOutputDescriptor(filedesc_t fd, uint_t id);
38 
45 
47  void interrupt();
48 
58  static int poll(timespan_ms_t timeout);
59 
60  private: // called by NativeActivity
61 
62  inline ALooper* getHandle()
63  { return(_looper); }
64 
65  private:
66 
67  ALooper* _looper;
68 
69  CCXX_COPY_DECLS(Looper);
70 };
71 
72 } // namespace blip
void removeDescriptor(filedesc_t fd)
Remove a file descriptor from this looper&#39;s list of file descriptors to monitor.
Definition: Looper.cpp:49
int filedesc_t
A file descriptor.
Definition: Blip.hpp:36
void addOutputDescriptor(filedesc_t fd, uint_t id)
Add an output descriptor to the looper&#39;s list of file descriptors to monitor.
Definition: Looper.cpp:41
~Looper()
Destructor.
Definition: Looper.cpp:26
void interrupt()
Interrupt the Looper.
Definition: Looper.cpp:57
Looper()
Construct a new Looper for the calling thread.
Definition: Looper.cpp:18
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
void addInputDescriptor(filedesc_t fd, uint_t id)
Add an input descriptor to the looper&#39;s list of file descriptors to monitor.
Definition: Looper.cpp:33
An abstract base class for all "native" (C++) Android activities.
Definition: NativeActivity.hpp:71
static int poll(timespan_ms_t timeout)
Poll the Looper, returning if any of the monitored file descriptors are ready.
Definition: Looper.cpp:66
Low-level Android event looper.
Definition: Looper.hpp:11