| 1 |
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|---|
| 2 |
|
|---|
| 3 |
/* flow-emitter.c - A packet emitter. |
|---|
| 4 |
* |
|---|
| 5 |
* Copyright (C) 2006 Hans Petter Jansson |
|---|
| 6 |
* |
|---|
| 7 |
* This library is free software; you can redistribute it and/or |
|---|
| 8 |
* modify it under the terms of the GNU Lesser General Public |
|---|
| 9 |
* License as published by the Free Software Foundation; either |
|---|
| 10 |
* version 2 of the License, or (at your option) any later version. |
|---|
| 11 |
* |
|---|
| 12 |
* This library is distributed in the hope that it will be useful, |
|---|
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 |
* Lesser General Public License for more details. |
|---|
| 16 |
* |
|---|
| 17 |
* You should have received a copy of the GNU Lesser General Public |
|---|
| 18 |
* License along with this library; if not, write to the |
|---|
| 19 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|---|
| 20 |
* Boston, MA 02111-1307, USA. |
|---|
| 21 |
* |
|---|
| 22 |
* Authors: Hans Petter Jansson <hpj@copyleft.no> |
|---|
| 23 |
*/ |
|---|
| 24 |
|
|---|
| 25 |
#include "config.h" |
|---|
| 26 |
#include "flow-gobject-util.h" |
|---|
| 27 |
#include "flow-emitter.h" |
|---|
| 28 |
|
|---|
| 29 |
/* --- FlowEmitter private data --- */ |
|---|
| 30 |
|
|---|
| 31 |
typedef struct |
|---|
| 32 |
{ |
|---|
| 33 |
} |
|---|
| 34 |
FlowEmitterPrivate; |
|---|
| 35 |
|
|---|
| 36 |
/* --- FlowEmitter properties --- */ |
|---|
| 37 |
|
|---|
| 38 |
FLOW_GOBJECT_PROPERTIES_BEGIN (flow_emitter) |
|---|
| 39 |
FLOW_GOBJECT_PROPERTIES_END () |
|---|
| 40 |
|
|---|
| 41 |
/* --- FlowEmitter definition --- */ |
|---|
| 42 |
|
|---|
| 43 |
FLOW_GOBJECT_MAKE_IMPL (flow_emitter, FlowEmitter, FLOW_TYPE_ELEMENT, G_TYPE_FLAG_ABSTRACT) |
|---|
| 44 |
|
|---|
| 45 |
/* --- FlowEmitter implementation --- */ |
|---|
| 46 |
|
|---|
| 47 |
static void |
|---|
| 48 |
flow_emitter_type_init (GType type) |
|---|
| 49 |
{ |
|---|
| 50 |
} |
|---|
| 51 |
|
|---|
| 52 |
static void |
|---|
| 53 |
flow_emitter_class_init (FlowEmitterClass *klass) |
|---|
| 54 |
{ |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
static void |
|---|
| 58 |
flow_emitter_init (FlowEmitter *emitter) |
|---|
| 59 |
{ |
|---|
| 60 |
FlowElement *element = (FlowElement *) emitter; |
|---|
| 61 |
|
|---|
| 62 |
g_ptr_array_add (element->output_pads, g_object_new (FLOW_TYPE_OUTPUT_PAD, "owner-element", emitter, NULL)); |
|---|
| 63 |
} |
|---|
| 64 |
|
|---|
| 65 |
static void |
|---|
| 66 |
flow_emitter_construct (FlowEmitter *emitter) |
|---|
| 67 |
{ |
|---|
| 68 |
} |
|---|
| 69 |
|
|---|
| 70 |
static void |
|---|
| 71 |
flow_emitter_dispose (FlowEmitter *emitter) |
|---|
| 72 |
{ |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
static void |
|---|
| 76 |
flow_emitter_finalize (FlowEmitter *emitter) |
|---|
| 77 |
{ |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|
| 80 |
/* --- FlowEmitter public API --- */ |
|---|
| 81 |
|
|---|
| 82 |
/** |
|---|
| 83 |
* flow_emitter_get_output_pad: |
|---|
| 84 |
* @emitter: A #FlowEmitter. |
|---|
| 85 |
* |
|---|
| 86 |
* Returns @emitter's only #FlowOutputPad. |
|---|
| 87 |
* |
|---|
| 88 |
* Return value: A #FlowOutputPad. |
|---|
| 89 |
**/ |
|---|
| 90 |
FlowOutputPad * |
|---|
| 91 |
flow_emitter_get_output_pad (FlowEmitter *emitter) |
|---|
| 92 |
{ |
|---|
| 93 |
FlowElement *element = (FlowElement *) emitter; |
|---|
| 94 |
|
|---|
| 95 |
g_return_val_if_fail (FLOW_IS_EMITTER (emitter), NULL); |
|---|
| 96 |
|
|---|
| 97 |
return g_ptr_array_index (element->output_pads, 0); |
|---|
| 98 |
} |
|---|