Skip to content

Commit

Permalink
Condition serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Sep 4, 2015
1 parent 491e9c1 commit cf2ec31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using namespace iscore;
using namespace Scenario::Command;

// TODO
SetCondition::SetCondition(
Path<EventModel>&& eventPath,
iscore::Condition&& cond) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ template<> void Visitor<Reader<DataStream>>::readFrom(const EventModel& ev)

m_stream << ev.m_timeNode
<< ev.m_states
// << ev.m_condition
<< ev.m_condition
// << ev.m_trigger
<< ev.m_extent
<< ev.m_date;
Expand All @@ -27,7 +27,7 @@ template<> void Visitor<Writer<DataStream>>::writeTo(EventModel& ev)

m_stream >> ev.m_timeNode
>> ev.m_states
// >> ev.m_condition
>> ev.m_condition
// >> ev.m_trigger
>> ev.m_extent
>> ev.m_date;
Expand All @@ -47,7 +47,7 @@ template<> void Visitor<Reader<JSONObject>>::readFrom(const EventModel& ev)
m_obj["States"] = toJsonArray(ev.m_states);

// TODO
//m_obj["Condition"] = ev.m_condition;
m_obj["Condition"] = toJsonObject(ev.m_condition);
//m_obj["Trigger"] = ev.m_trigger;

m_obj["Extent"] = toJsonValue(ev.m_extent);
Expand All @@ -64,7 +64,7 @@ template<> void Visitor<Writer<JSONObject>>::writeTo(EventModel& ev)
fromJsonValueArray(m_obj["States"].toArray(), ev.m_states);

// TODO
//ev.m_condition = m_obj["Condition"].toString();
fromJsonObject(m_obj["Condition"].toObject(), ev.m_condition);
//ev.m_trigger = m_obj["Trigger"].toString();

ev.m_extent = fromJsonValue<VerticalExtent>(m_obj["Extent"]);
Expand Down

0 comments on commit cf2ec31

Please sign in to comment.