<commit_before>/* vim:set et sw=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e2s: */
/*
 * Copyright © <NAME> 2015, 2016 <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * SECTION:source
 * @short_description: model of a #GMainContext from a log
 * @stability: Unstable
 * @include: libdunfell/source.h
 *
 * TODO
 *
 * Since: 0.1.0
 */

#include "config.h"

#include <errno.h>
#include <glib.h>
#include <gio/gio.h>
#include <string.h>

#include "event.h"
#include "event-sequence.h"
#include "source.h"
#include "time-sequence.h"


static void dfl_source_dispose (GObject *object);
static void dfl_source_dispatch_data_clear (DflSourceDispatchData *data);

struct _DflSource
{
  GObject parent;

  /* Note: Since this is derived from the #GSource’s address in memory, it is
   * not necessarily unique over the lifetime of the recorded process. */
  DflId id;

  /* Invariant: @free_timestamp ≥ @new_timestamp. */
  DflTimestamp new_timestamp;
  DflTimestamp free_timestamp;

  DflThreadId new_thread_id;

  /* Sequence of thread IDs and the duration between the start and end of the
   * dispatch. A duration of ≥ 0 is valid; < 0 is not. */
  DflTimeSequence/*<DflMainContextDispatchData>*/ dispatch_events;

  gchar *name;  /* owned; nullable */

  DflId attach_context;
  DflTimestamp attach_timestamp;
  DflThreadId attach_thread_id;
  DflTimestamp destroy_timestamp;
  DflThreadId destroy_thread_id;
<commit_msg>lib: Minor documentation typo fix in DflSource<commit_after>/* vim:set et sw=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e2s: */
/*
 * Copyright © <NAME> 2015, 2016 <<EMAIL>>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * SECTION:source
 * @short_description: model of a #GMainContext from a log
 * @stability: Unstable
 * @include: libdunfell/source.h
 *
 * TODO
 *
 * Since: 0.1.0
 */

#include "config.h"

#include <errno.h>
#include <glib.h>
#include <gio/gio.h>
#include <string.h>

#include "event.h"
#include "event-sequence.h"
#include "source.h"
#include "time-sequence.h"


static void dfl_source_dispose (GObject *object);
static void dfl_source_dispatch_data_clear (DflSourceDispatchData *data);

struct _DflSource
{
  GObject parent;

  /* Note: Since this is derived from the #GSource’s address in memory, it is
   * not necessarily unique over the lifetime of the recorded process. */
  DflId id;

  /* Invariant: @free_timestamp ≥ @new_timestamp. */
  DflTimestamp new_timestamp;
  DflTimestamp free_timestamp;

  DflThreadId new_thread_id;

  /* Sequence of thread IDs and the duration between the start and end of the
   * dispatch. A duration of ≥ 0 is valid; < 0 is not. */
  DflTimeSequence/*<DflSourceDispatchData>*/ dispatch_events;

  gchar *name;  /* owned; nullable */

  DflId attach_context;
  DflTimestamp attach_timestamp;
  DflThreadId attach_thread_id;
  DflTimestamp destroy_timestamp;
  DflThreadId destroy_thread_id;

{'fraction_non_alphanumeric': 0.09753146176185866, 'fraction_numerical': 0.01016456921587609, 'mean_word_length': 4.071165644171779, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4968490', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1281, 'n_words': 482}