EventManager: Move pool sizes to config #113

Closed
opened 2020-06-19 12:50:03 +02:00 by muellerr · 0 comments
Owner

I think N_ELEMENTS of the event manager should be part of the config (factory) and passed via ctor, maybe with the specified N_ELEMENT as default value (although not making it a default value forces the dev to think about how much space he needs).
The comment is propably related to FLP so maybe it should be made more generic?
Also, maybe explain the meaning of ReportRangeMatcher and EventIdMatcher and why there are 1-2 for each listener.

const uint16_t EventManager::POOL_SIZES[N_POOLS] = {
		sizeof(EventMatchTree::Node), sizeof(EventIdRangeMatcher),
		sizeof(ReporterRangeMatcher) };
// If one checks registerListener calls, there are around 40 (to max 50)
// objects registering for certain events.
// Each listener requires 1 or 2 EventIdMatcher and 1 or 2 ReportRangeMatcher.
// So a good guess is 75 to a max of 100 pools required for each, which fits well.
// SHOULDDO: Shouldn't this be in the config folder and passed via ctor?
const uint16_t EventManager::N_ELEMENTS[N_POOLS] = { 240, 120, 120 };
I think `N_ELEMENTS` of the event manager should be part of the config (factory) and passed via ctor, maybe with the specified `N_ELEMENT` as default value (although not making it a default value forces the dev to think about how much space he needs). The comment is propably related to FLP so maybe it should be made more generic? Also, maybe explain the meaning of ReportRangeMatcher and EventIdMatcher and why there are 1-2 for each listener. ```cpp const uint16_t EventManager::POOL_SIZES[N_POOLS] = { sizeof(EventMatchTree::Node), sizeof(EventIdRangeMatcher), sizeof(ReporterRangeMatcher) }; // If one checks registerListener calls, there are around 40 (to max 50) // objects registering for certain events. // Each listener requires 1 or 2 EventIdMatcher and 1 or 2 ReportRangeMatcher. // So a good guess is 75 to a max of 100 pools required for each, which fits well. // SHOULDDO: Shouldn't this be in the config folder and passed via ctor? const uint16_t EventManager::N_ELEMENTS[N_POOLS] = { 240, 120, 120 }; ```
muellerr added the
question
API Change
labels 2020-06-19 12:50:03 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fsfw/fsfw#113
No description provided.