COSA
An Object-Oriented Platform for Arduino Programming
Actor.hh
Go to the documentation of this file.
1 
21 #ifndef COSA_NUCLEO_ACTOR_HH
22 #define COSA_NUCLEO_ACTOR_HH
23 
24 #include "Thread.hh"
25 
26 namespace Nucleo {
27 
31 class Actor : public Thread {
32 public:
36  Actor() :
37  Thread(),
38  m_receiving(false),
39  m_sending(),
40  m_port(0),
41  m_size(0),
42  m_buf(NULL)
43  {}
44 
54  int send(uint8_t port, const void* buf = NULL, size_t size = 0);
55 
66  int recv(Actor*& sender, uint8_t& port, void* buf = NULL, size_t size = 0);
67 
68 protected:
69  volatile bool m_receiving;
71  uint8_t m_port;
72  size_t m_size;
73  const void* m_buf;
74 };
75 
76 };
77 #endif
Definition: Actor.hh:26
Head m_sending
Definition: Actor.hh:70
#define NULL
Definition: Types.h:101
int recv(Actor *&sender, uint8_t &port, void *buf=NULL, size_t size=0)
Definition: Actor.cpp:45
size_t m_size
Definition: Actor.hh:72
uint8_t m_port
Definition: Actor.hh:71
const void * m_buf
Definition: Actor.hh:73
int send(uint8_t port, const void *buf=NULL, size_t size=0)
Definition: Actor.cpp:26
Definition: Linkage.hh:132
volatile bool m_receiving
Definition: Actor.hh:69