Construct version 5.4.4
An agent based modeling framework
Social_Media_no_followers::event_container Class Reference

Container for media_events with various restrictions More...

Inherits std::list< media_event >.

Public Member Functions

iterator erase (iterator _Where) noexcept
 Reimplements list::erase to add the media_event to removed_events before its erased from the container.
 
iterator erase (iterator _First, iterator _Last) noexcept
 Reimplements list::erase to add the media_event to removed_events before its erased from the container. More...
 
void hard_erase (iterator _Where)
 
void clear () noexcept
 Reimplements list::erase to add the list of media_events to removed_events before they're cleared from the container.
 

Public Attributes

std::list< media_eventremoved_events
 All events removed by this container are put into this list and cleared after a full simulation cycle.
 

Detailed Description

Container for media_events with various restrictions

Container inheriets from list and makes the following functions private.

  • insert
  • push_back
  • emplace_back
  • emplace
  • swap
  • sort
  • reverse
  • merge

This stops events from being added to the back of the list. New events should only be added to the front of the list. Events can still be removed from anywhere in the list. Any event that is removed is added to removed_events. removed_events is cleared during Social_Media_with_followers::clean_up before events are checked for erasure.

Member Function Documentation

◆ erase()

iterator Social_Media_no_followers::event_container::erase ( iterator  _First,
iterator  _Last 
)
inlinenoexcept

Reimplements list::erase to add the media_event to removed_events before its erased from the container.

summary> Allows for events to be removed from the list without being added to removed_events.