diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2018-06-07 15:05:53 +0200 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@iot.bzh> | 2018-06-12 16:23:44 +0200 |
commit | 9a631c30c9c8792865ce2aa0ec06a1bb5fd16751 (patch) | |
tree | e1bd8c4ce3cc408144aedcf0f26fd873d8db8634 /ahl-binding/interrupt.cpp | |
parent | 322f8932476eda944c7d3ac65eafde12c69b2ae9 (diff) |
Add some policy emulation
Add a very simplistic policy emulation just for demo.
The real policy engine will be brought back soon.
Change-Id: I6f77c8dc58ba335eabd1a1d858354a84559d9e7f
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'ahl-binding/interrupt.cpp')
-rw-r--r-- | ahl-binding/interrupt.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ahl-binding/interrupt.cpp b/ahl-binding/interrupt.cpp new file mode 100644 index 0000000..fc54139 --- /dev/null +++ b/ahl-binding/interrupt.cpp @@ -0,0 +1,34 @@ +#include "interrupt.hpp" + +interrupt_t::interrupt_t(json_object* o) +{ + jcast(type_, o, "type"); + args_ = json_object_object_get(o, "args"); +} + +interrupt_t& interrupt_t::operator<<(json_object* o) +{ + jcast(type_, o, "type"); + args_ = json_object_object_get(o, "args"); + return *this; +} + +std::string interrupt_t::type() const +{ + return type_; +} + +json_object* interrupt_t::args() const +{ + return args_; +} + +void interrupt_t::type(std::string v) +{ + type_ = v; +} + +void interrupt_t::args(json_object* v) +{ + args_ = v; +} |