## Modulemd.Component Modulemd.Component — Pure virtual parent class for components that go into a module stream. |

## Stability Level

Stable, unless otherwise indicated

## Functions

gboolean | modulemd_component_equals ()
ModulemdComponent * | modulemd_component_copy ()
gboolean | modulemd_component_validate ()
void | modulemd_component_add_buildafter ()
void | modulemd_component_clear_buildafter ()
GStrv | modulemd_component_get_buildafter_as_strv ()
void | modulemd_component_set_buildonly ()
gboolean | modulemd_component_get_buildonly ()
void | modulemd_component_set_buildorder ()
gint64 | modulemd_component_get_buildorder ()
void | modulemd_component_set_name ()
const gchar * | modulemd_component_get_name ()
const gchar * | modulemd_component_get_key ()
void | modulemd_component_set_rationale ()
const gchar * | modulemd_component_get_rationale ()

## Properties

gboolean | buildonly | Read / Write
gint64 | buildorder | Read / Write
char * | name | Read / Write / Construct Only
char * | rationale | Read / Write

## Types and Values

#define | MODULEMD_TYPE_COMPONENT
struct | ModulemdComponentClass
| ModulemdComponent

## Object Hierarchy

        GObject
        ╰── ModulemdComponent
            ├── ModulemdComponentModule
            ╰── ModulemdComponentRpm

## Description

## Functions

### modulemd_component_equals ()

    gboolean
    modulemd_component_equals (ModulemdComponent *self_1,
                               ModulemdComponent *self_2);

#### Parameters

self_1 | A ModulemdComponent object. |
self_2 | A ModulemdComponent object. |

#### Returns

TRUE, if both the objects are equal. FALSE, otherwise.

Since: 2.3

### modulemd_component_copy ()

    ModulemdComponent *
    modulemd_component_copy (ModulemdComponent *self,
                             const gchar *key);

#### Parameters

self | This ModulemdComponent object. |
key | An optional new key for the copied component which is used as the lookup key when this component is attached to a ModulemdModuleStream. | [in][nullable]

#### Returns

A newly-allocated copy of `self` .

[transfer full]

Since: 2.0

### modulemd_component_validate ()

    gboolean
    modulemd_component_validate (ModulemdComponent *self,
                                 GError **error);

Verifies that all stored values are internally consistent and that the component is sufficiently-complete for emitting. This function is called implicitly before attempting to emit the contents.

#### Parameters

self | This ModulemdComponent object. | [in]
error | A GError that will return the reason for a validation error. | [out]

#### Returns

TRUE if the ModulemdComponent passed validation. FALSE and sets `error` appropriately if validation fails.

Since: 2.2

### modulemd_component_add_buildafter ()

    void
    modulemd_component_add_buildafter (ModulemdComponent *self,
                                       const gchar *key);

Add a build dependency of this component.

#### Parameters

self | This ModulemdComponent object. |
key | A key representing another component in the ModulemdModuleStream components map. | [in]

Since: 2.2

### modulemd_component_clear_buildafter ()

    void
    modulemd_component_clear_buildafter (ModulemdComponent *self);

Remove all buildafter entries for this component.

#### Parameters

self | This ModulemdComponent object. |

Since: 2.5

### modulemd_component_get_buildafter_as_strv ()

    GStrv
    modulemd_component_get_buildafter_as_strv
                                   (ModulemdComponent *self);

[rename-to modulemd_component_get_buildafter]

#### Parameters

self | This ModulemdComponent object. |

#### Returns

The set of component keys that this component depends upon.

[transfer full]

Since: 2.2

### modulemd_component_set_buildonly ()

    void
    modulemd_component_set_buildonly (ModulemdComponent *self,
                                      gboolean buildonly);

#### Parameters

self | This ModulemdComponent object. |
buildonly | Whether this component is used only for building this module. If set to TRUE, the build system should add any artifacts produced by this component to the data.filters section of the output modulemd. |

Since: 2.2

### modulemd_component_get_buildonly ()

    gboolean
    modulemd_component_get_buildonly (ModulemdComponent *self);

#### Parameters

self | This ModulemdComponent object. |

#### Returns

TRUE if this component is used only for building this module.

Since: 2.2

### modulemd_component_set_buildorder ()

    void
    modulemd_component_set_buildorder (ModulemdComponent *self,
                                       gint64 buildorder);

#### Parameters

self | This ModulemdComponent object. |
buildorder | The order this component should be built relative to others. |

Since: 2.0

### modulemd_component_get_buildorder ()

    gint64
    modulemd_component_get_buildorder (ModulemdComponent *self);

#### Parameters

self | This ModulemdComponent object. |

#### Returns

The value of the buildorder.

Since: 2.0

### modulemd_component_set_name ()

    void
    modulemd_component_set_name (ModulemdComponent *self,
                                 const gchar *name);

#### Parameters

self | This ModulemdComponent object. |
name | The name of this component. Note that this is different from the key used to save this component to a ModulemdModuleStream. If this value is set, it adds a "name:" attribute to this component. This is used in bootstrapping cases where the key is a different name used to differentiate multiple ordered builds of the same component name. This function is currently only implemented for ModulemdComponentRpm and has no effect on other ModulemdComponent types. | [nullable]

Since: 2.2

### modulemd_component_get_name ()

    const gchar *
    modulemd_component_get_name (ModulemdComponent *self);

#### Parameters

self | This ModulemdComponent object. |

#### Returns

The name of the component. Note that this may be different from the key used to save this component to a ModulemdModuleStream. If you specifically need the key, use `modulemd_component_get_key()` instead.

[transfer none]

Since: 2.0

### modulemd_component_get_key ()

    const gchar *
    modulemd_component_get_key (ModulemdComponent *self);

#### Parameters

self | This ModulemdComponent object. |

#### Returns

The name of the key used to attach this component to a ModulemdModuleStream.

[transfer none]

Since: 2.2

### modulemd_component_set_rationale ()

    void
    modulemd_component_set_rationale (ModulemdComponent *self,
                                      const gchar *rationale);

#### Parameters

self | This ModulemdComponent object. |
rationale | The reason that this component is part of the stream. | [in][nullable]

Since: 2.0

### modulemd_component_get_rationale ()

    const gchar *
    modulemd_component_get_rationale (ModulemdComponent *self);

#### Parameters

self | This ModulemdComponent object. |

#### Returns

The rationale.

[transfer none]

Since: 2.0

## Types and Values

### MODULEMD_TYPE_COMPONENT

    #define MODULEMD_TYPE_COMPONENT (modulemd_component_get_type ())

### struct ModulemdComponentClass

    struct ModulemdComponentClass {
      GObjectClass parent_class;

      ModulemdComponent *(*copy) (ModulemdComponent *self, const gchar *key);
      void (*set_name) (ModulemdComponent *self, const gchar *name);
      const gchar *(*get_name) (ModulemdComponent *self);
      gboolean (*validate) (ModulemdComponent *self, GError **error);
      gboolean (*equals) (ModulemdComponent *self_1, ModulemdComponent *self_2);

      /* Padding to allow adding up to 7 new virtual functions without
       * breaking ABI. */
      gpointer padding[7];
    };

### ModulemdComponent

    typedef struct _ModulemdComponent ModulemdComponent;

## Property Details

### The `“buildonly”` property

      “buildonly”                gboolean

Whether the artifacts produced by this component are intended only for building this module.

Owner: ModulemdComponent

Flags: Read / Write

Default value: FALSE

### The `“buildorder”` property

      “buildorder”               gint64

The order this component should be built relative to others.

Owner: ModulemdComponent

Flags: Read / Write

Default value: 0

### The `“name”` property

      “name”                     char *

The name of the component. This is the real name of the component and may differ from the key used to associate this component with the ModuleStream.

Owner: ModulemdComponent

Flags: Read / Write / Construct Only

Default value: "__UNSET__"

### The `“rationale”` property

      “rationale”                char *

A description of the reason this component is part of the module stream.

Owner: ModulemdComponent

Flags: Read / Write

Default value: "__UNSET__"