code: def AddEvent(self, event):
      
      self._RaiseIfNotWritable()
  
      # TODO: change to no longer allow event_data_identifier is None
      # after refactoring every parser to generate event data.
      event_data_identifier = event.GetEventDataIdentifier()
      if event_data_identifier:
        if not isinstance(event_data_identifier, identifiers.SQLTableIdentifier):
          raise IOError('Unsupported event data identifier type: {0:s}'.format(
              type(event_data_identifier)))
  
        event.event_data_row_identifier = event_data_identifier.row_identifier
  
      self._AddSerializedEvent(event)
docs: Adds an event.
  
      Args:
        event (EventObject): event.
  
      Raises:
        IOError: when the storage file is closed or read-only or
            if the event data identifier type is not supported.
        OSError: when the storage file is closed or read-only or
            if the event data identifier type is not supported.