All these information can be accessed/modified by using dedicated accessor/mutator but also using the property() and setProperty() methods.

A time can be positive, null, or negative. The null time indicates the start of the recording, while a negative and postive time corresponds to an event before and after the beginning of the recording, respectively.

There is no standard for the definition of a context. However, it is common to use the following context for task analysis:

Right: Events associated with the right side of the (human) body

Left: Events associated with the left side of the (human) body

General: Other events that cannot be assigned to the left or the right side of the body

The role of the context may be important or not depending of your later data processing/analysis. For example, inside a clinical gait analysis you can have several "Foot Strike" and "Foot Off" events assigned to the "Right" and "Left" sides. You could want to retrieve the events by name or by context or both. Thus, choosing a common orthography could help you as well as other researchers. The previous example could be implemented like in the following code. The important thing to remind is the case used for any string assigned (name, context, subject, ...)

// Several events are defined in the node "Events".
// A algorithm could have generated the following events
ma::Node* events = new ma::Node("Events");
new ma::Event("Foot Strike",1.3,"Right","JDoe",&events);
new ma::Event("Foot Off",2.4,"Right","JDoe",&events);
new ma::Event("Foot Strike",1.8,"Left","JDoe",&events);
new ma::Event("Foot Off",3.0,"Left","JDoe",&events);
// Later in the code, you could retrive only:
// Events with the context "Right"
std::list rightEvents = events.findChild({},{{"context","Right"}});
// Events with the name "Foot Strike"
std::list footStrikeEvents = events.findChild("Foot Strike");

The subject's identification is used to distinguish events between subject which are in the same trial (if any).

Do a deep copy of the the given src. The previous content is replaced.

Note

Each subclass must override this method to correctly do the deep copy.

Note

This method does not copy the parent. If you need to copy the parent, you must use the method addParent() afterwards. See the example in the desctription of the Node::copy() method.

voidma::Event::setContext (const std::string & value) noexcept

Sets the context associated with this event. There is no standard for the definition of a context. However, it is common to use the following context for task analysis:

Right: Events associated with the right side of the (human) body

Left: Events associated with the left side of the (human) body

General: Other events which cannot be assigned to the left or the right side of the body

voidma::Event::setSubject (const std::string & value) noexcept

Sets the subject's identification.

voidma::Event::setTime (double value) noexcept

Sets the time associated with an event. The time can be positive, null, or negative. The null time indicates the start of the recording, while a negative and postive time corresponds to an event before and after the beginning of the recording, respectively.

const std::string &ma::Event::subject () const noexcept

Return the subject's identification.

doublema::Event::time () const noexcept

Returns the time associated with this event. The time can be positive, null, or negative. The null time indicates the start of the recording, while a negative and postive time corresponds to an event before and after the beginning of the recording, respectively.