MNE-CPP
0.1.9
A Framework for Electrophysiology
|
#include <eventmanager.h>
Public Member Functions | |
EventManager () | |
size_t | getNumEvents () const |
Event | getEvent (idNum eventId) const |
std::unique_ptr< std::vector< Event > > | getEvents (const std::vector< idNum > eventIds) const |
std::unique_ptr< std::vector< Event > > | getAllEvents () const |
std::unique_ptr< std::vector< Event > > | getEventsInSample (int sample) const |
std::unique_ptr< std::vector< Event > > | getEventsBetween (int sampleStart, int sampleEnd) const |
std::unique_ptr< std::vector< Event > > | getEventsBetween (int sampleStart, int sampleEnd, idNum groupid) const |
std::unique_ptr< std::vector< Event > > | getEventsBetween (int sampleStart, int sampleEnd, const std::vector< idNum > &groupIdsList) const |
std::unique_ptr< std::vector< Event > > | getEventsInGroup (const idNum groupId) const |
std::unique_ptr< std::vector< Event > > | getEventsInGroups (const std::vector< idNum > &groupIdsList) const |
Event | addEvent (int sample) |
Event | addEvent (int sample, idNum groupId) |
bool | moveEvent (idNum eventId, int newSample) |
bool | deleteEvent (idNum eventId) noexcept |
bool | deleteEvents (const std::vector< idNum > &eventIds) |
bool | deleteEvents (std::unique_ptr< std::vector< Event > > eventIds) |
bool | deleteEventsInGroup (idNum groupId) |
int | getNumGroups () const |
EventGroup | getGroup (idNum groupId) const |
std::unique_ptr< std::vector< EventGroup > > | getAllGroups () const |
std::unique_ptr< std::vector< EventGroup > > | getGroups (const std::vector< idNum > &groupIds) const |
EventGroup | addGroup (const std::string &sGroupName) |
EventGroup | addGroup (const std::string &sGroupName, const RgbColor &color) |
bool | deleteGroup (const idNum groupId) |
bool | deleteGroups (const std::vector< idNum > &groupIds) |
void | renameGroup (const idNum groupId, const std::string &newName) |
void | setGroupColor (const idNum groupId, const RgbColor &color) |
EventGroup | mergeGroups (const std::vector< idNum > &groupIds, const std::string &newName) |
EventGroup | duplicateGroup (const idNum groupId, const std::string &newName) |
bool | addEventToGroup (const idNum eventId, const idNum groupId) |
bool | addEventsToGroup (const std::vector< idNum > &eventIds, const idNum groupId) |
void | initSharedMemory () |
void | initSharedMemory (SharedMemoryMode mode) |
void | stopSharedMemory () |
bool | isSharedMemoryInit () |
Friends | |
class | EVENTSINTERNAL::EventSharedMemManager |
The EventManager class.
This class can be understood as an API, for the whole Event system, which is the Events library (EVENTSLIB namespace).
Definition at line 85 of file eventmanager.h.
EventManager::EventManager | ( | ) |
EventManager constructor.
Definition at line 63 of file eventmanager.cpp.
Event EventManager::addEvent | ( | int | sample | ) |
Add an event at a specific sample. The event will be added to a "Default" group.
[in] | sample | The sample at which the event should be added. |
Definition at line 287 of file eventmanager.cpp.
Event EventManager::addEvent | ( | int | sample, |
idNum | groupId | ||
) |
Overriden function. Add event in a specific sample.
[in] | sample | The sample at which the event should be created. |
[in] | groupId | The id of the event group to which the event belongs to. |
Definition at line 270 of file eventmanager.cpp.
bool EventManager::addEventsToGroup | ( | const std::vector< idNum > & | eventIds, |
const idNum | groupId | ||
) |
Add more than one event to a group.
eventIds | The identifiers for the events to add. |
groupId | The group to add the events to. |
Definition at line 573 of file eventmanager.cpp.
bool EventManager::addEventToGroup | ( | const idNum | eventId, |
const idNum | groupId | ||
) |
Add one event to a group.
eventId | Identifier for the event. |
groupId | Group to add the event to. |
Definition at line 549 of file eventmanager.cpp.
EventGroup EventManager::addGroup | ( | const std::string & | sGroupName | ) |
Add a new group of events.
[in] | sGroupName | The group's name string. |
Definition at line 440 of file eventmanager.cpp.
EventGroup EventManager::addGroup | ( | const std::string & | sGroupName, |
const RgbColor & | color | ||
) |
Add a new group of events, specifying its name and color. This is an overriden funcion.
[in] | sGroupName | The name of the new group.. |
[in] | color | The color of the new group. |
Definition at line 449 of file eventmanager.cpp.
|
noexcept |
Delete an event.
eventId | The id of the event to be deleted from the event system. |
Definition at line 312 of file eventmanager.cpp.
bool EventManager::deleteEvents | ( | const std::vector< idNum > & | eventIds | ) |
This is an overriden function. Delete a set of events.
[in] | eventIds | The ids of the events to be deleted. |
Definition at line 343 of file eventmanager.cpp.
bool EventManager::deleteEvents | ( | std::unique_ptr< std::vector< Event > > | eventIds | ) |
deleteEvents Delete a set of events.
[in] | eventIds | A pointer to a vector with the events to be deleted. |
Definition at line 355 of file eventmanager.cpp.
bool EventManager::deleteEventsInGroup | ( | idNum | groupId | ) |
Delete all the events in a specific group.
[in] | groupId | The id of the group who's events are to be deleted. |
Definition at line 366 of file eventmanager.cpp.
bool EventManager::deleteGroup | ( | const idNum | groupId | ) |
Delete a group. If there are events in the group the group won't be deleted.
[in] | groupId | The ids of the group events to be deleted. |
Definition at line 458 of file eventmanager.cpp.
bool EventManager::deleteGroups | ( | const std::vector< idNum > & | groupIds | ) |
Delete all groups. If any of the groups has events in it, that group will not be deleted.
[in] | groupIds |
Definition at line 481 of file eventmanager.cpp.
EventGroup EventManager::duplicateGroup | ( | const idNum | groupId, |
const std::string & | newName | ||
) |
Duplicate a specified group. All the events in the group will also be duplicated.
groupId | |
newName |
Definition at line 536 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getAllEvents | ( | ) | const |
Retrieve all the events in the system.
Definition at line 121 of file eventmanager.cpp.
std::unique_ptr< std::vector< EventGroup > > EventManager::getAllGroups | ( | ) | const |
Retrieve all the groups declared in the event system.
Definition at line 410 of file eventmanager.cpp.
Event EventManager::getEvent | ( | idNum | eventId | ) | const |
Retrieve an event from its id.
[in] | eventId | Event id. |
Definition at line 76 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEvents | ( | const std::vector< idNum > | eventIds | ) | const |
Retrieve a set of events, given their ids.
[in] | eventIds | The ids of events to retrieve. |
Definition at line 105 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsBetween | ( | int | sampleStart, |
int | sampleEnd | ||
) | const |
getEventsBetween Get all the events ocurring between (inclusive) two given samples.
[in] | sampleStart | First sample to look for events. |
[in] | sampleEnd | Last sample to look for events. |
Definition at line 149 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsBetween | ( | int | sampleStart, |
int | sampleEnd, | ||
const std::vector< idNum > & | groupIdsList | ||
) | const |
Overriden function to retrieve all the events in between (inclusive) two samples, however only the ones that belong to one of a given list of groups.
[in] | sampleStart | First sample to look events for. |
[in] | sampleEnd | Last sample to look for events. |
[in] | groupidList | The list of groups to which the events have to belong. |
Definition at line 188 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsBetween | ( | int | sampleStart, |
int | sampleEnd, | ||
idNum | groupid | ||
) | const |
Overriden function to retrieve all the events in between (inclusive) two samples, however only the ones belonging to a specified group.
[in] | sampleStart | First sample to look events for. |
[in] | sampleEnd | Last sample to look for events. |
[in] | groupid | The group to which the events have to belong. |
Definition at line 167 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsInGroup | ( | const idNum | groupId | ) | const |
Retrieve all the events belonging to a specified group of events.
[in] | groupId | The group of events. |
Definition at line 212 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsInGroups | ( | const std::vector< idNum > & | groupIdsList | ) | const |
Retrieve all the events belonging to a specified set of group of events.
[in] | groupIdsList | The set of group of events to which the events will belong to. |
Definition at line 228 of file eventmanager.cpp.
std::unique_ptr< std::vector< Event > > EventManager::getEventsInSample | ( | int | sample | ) | const |
Get all the events declared in the given sample.
[in] | sample | The sample from where to get the events from. |
Definition at line 133 of file eventmanager.cpp.
EventGroup EventManager::getGroup | ( | idNum | groupId | ) | const |
Retrieve an event group.
[in] | groupId | The id of the event group to be retrieved. |
Definition at line 396 of file eventmanager.cpp.
std::unique_ptr< std::vector< EventGroup > > EventManager::getGroups | ( | const std::vector< idNum > & | groupIds | ) | const |
Get group events given their ids.
[in] | groupIds | A list of group eveent ids to be retrieved. |
Definition at line 424 of file eventmanager.cpp.
size_t EventManager::getNumEvents | ( | ) | const |
Retrive the number of events already stored in the Event system.
Definition at line 263 of file eventmanager.cpp.
int EventManager::getNumGroups | ( | ) | const |
Retrieve the number of groups created in the event system.
Definition at line 389 of file eventmanager.cpp.
void EventManager::initSharedMemory | ( | ) |
Initialize the shared memory mecanism. This mecanism allows for inter-process communication. Typically this would be with mne-scan.
Definition at line 585 of file eventmanager.cpp.
void EventManager::initSharedMemory | ( | SharedMemoryMode | mode | ) |
Initialize the shared memory space with an empty linked list.
mode | Enum stating the mode to use for in the shared memory. |
Definition at line 594 of file eventmanager.cpp.
bool EventManager::isSharedMemoryInit | ( | ) |
Getter to know if the shared memory mechanism has been initialized already.
Definition at line 612 of file eventmanager.cpp.
EventGroup EventManager::mergeGroups | ( | const std::vector< idNum > & | groupIds, |
const std::string & | newName | ||
) |
Merge two groups together into a diferent third group.
groupIds | Group Ids of the groups to merge. |
newName | New name to be applied. |
Definition at line 515 of file eventmanager.cpp.
bool EventManager::moveEvent | ( | idNum | eventId, |
int | newSample | ||
) |
Move an event to a new sample. All other fields of the event will remain unaltered.
[in] | eventId | The id of the event to be moved. |
[in] | newSample | The new sample to which the event will be moved to. |
Definition at line 295 of file eventmanager.cpp.
void EventManager::renameGroup | ( | const idNum | groupId, |
const std::string & | newName | ||
) |
Change the name of the specified group (groupId).
groupId | Id of the group. |
newName | New string to use as the group name. |
Definition at line 493 of file eventmanager.cpp.
void EventManager::setGroupColor | ( | const idNum | groupId, |
const RgbColor & | color | ||
) |
Change the color of the group to a specified one.
groupId | Group identifier. |
color | New color for the group. |
Definition at line 504 of file eventmanager.cpp.
void EventManager::stopSharedMemory | ( | ) |
Disable the shared memory management.
Definition at line 603 of file eventmanager.cpp.