COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Resource.hh>
Public Member Functions | |
Resource () | |
void | acquire () |
bool | try_acquire () |
void | release () |
Protected Member Functions | |
virtual void | on_acquire ()=0 |
virtual void | on_release ()=0 |
Abstract Resource Handler. Secure acquire and release of resources.
Definition at line 29 of file Resource.hh.
|
inline |
Construct Resource Handler.
Definition at line 34 of file Resource.hh.
|
inline |
Acquire the resource. Wait until the resource is not busy. Mark as busy and call on_acquire() in synchronized context.
Definition at line 42 of file Resource.hh.
|
protectedpure virtual |
Resource extension on acquire.
|
protectedpure virtual |
Resource extension on release.
|
inline |
Release the resource. Call on_release() in synchronized context and mark the resource as available.
Definition at line 67 of file Resource.hh.
|
inline |
Try to acquire the resource. If successful, mark as busy and call on_acquire() in synchronized context.
Definition at line 54 of file Resource.hh.