/*
**==============================================================================
**
** CAUTION: This file generated by KonkretCMPI. Please do not edit.
**
**==============================================================================
*/

#ifndef _konkrete_Gadget_h
#define _konkrete_Gadget_h

#include <konkret/konkret.h>
#include "Widget.h"

/*
**==============================================================================
**
** struct GadgetRef 
**
**==============================================================================
*/

/* classname=KC_Gadget */
typedef struct _GadgetRef
{
    KBase __base;
    /* KC_Gadget features */
    const KRef Left; /* Widget */
    const KRef Right; /* Widget */
}
GadgetRef;

static const unsigned char __GadgetRef_sig[] =
{
    0x09,0x4b,0x43,0x5f,0x47,0x61,0x64,0x67,0x65,0x74,0x00,0x02,0x4e,0x04,0x4c,
    0x65,0x66,0x74,0x00,0x4e,0x05,0x52,0x69,0x67,0x68,0x74,0x00,
};

KINLINE void GadgetRef_Init(
    GadgetRef* self,
    const CMPIBroker* cb,
    const char* ns)
{
    const unsigned char* sig = __GadgetRef_sig;
    KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
    ((KRef*)&self->Left)->__sig = __Widget_sig;
    ((KRef*)&self->Right)->__sig = __Widget_sig;
}

KINLINE CMPIStatus GadgetRef_InitFromInstance(
    GadgetRef* self,
    const CMPIBroker* cb,
    const CMPIInstance* x)
{
    GadgetRef_Init(self, cb, NULL);
    return KBase_FromInstance(&self->__base, x);
}

KINLINE CMPIStatus GadgetRef_InitFromObjectPath(
    GadgetRef* self,
    const CMPIBroker* cb,
    const CMPIObjectPath* x)
{
    GadgetRef_Init(self, cb, NULL);
    return KBase_FromObjectPath(&self->__base, x);
}

KINLINE void GadgetRef_Print(
    const GadgetRef* self,
    FILE* os)
{
    KBase_Print(os, &self->__base, 'r');
}

KINLINE CMPIInstance* GadgetRef_ToInstance(
    const GadgetRef* self,
    CMPIStatus* status)
{
    return KBase_ToInstance(&self->__base, status);
}

KINLINE CMPIObjectPath* GadgetRef_ToObjectPath(
    const GadgetRef* self,
    CMPIStatus* status)
{
    return KBase_ToObjectPath(&self->__base, status);
}

KINLINE const char* GadgetRef_NameSpace(
    GadgetRef* self)
{
    if (self && self->__base.magic == KMAGIC)
        return self->__base.ns ? KChars(self->__base.ns) : NULL;
    return NULL;
}

KINLINE void GadgetRef_SetObjectPath_Left(
    GadgetRef* self,
    const CMPIObjectPath* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_SetObjectPath(field, x);
    }
}

KINLINE CMPIStatus GadgetRef_Set_Left(
    GadgetRef* self,
    const WidgetRef* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        return KRef_Set(field, &x->__base);
    }
    CMReturn(CMPI_RC_ERR_FAILED);
}

KINLINE void GadgetRef_Null_Left(
    GadgetRef* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_Null(field);
    }
}

KINLINE void GadgetRef_Clr_Left(
    GadgetRef* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_Clr(field);
    }
}

KINLINE void GadgetRef_SetObjectPath_Right(
    GadgetRef* self,
    const CMPIObjectPath* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_SetObjectPath(field, x);
    }
}

KINLINE CMPIStatus GadgetRef_Set_Right(
    GadgetRef* self,
    const WidgetRef* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        return KRef_Set(field, &x->__base);
    }
    CMReturn(CMPI_RC_ERR_FAILED);
}

KINLINE void GadgetRef_Null_Right(
    GadgetRef* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_Null(field);
    }
}

KINLINE void GadgetRef_Clr_Right(
    GadgetRef* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_Clr(field);
    }
}

/*
**==============================================================================
**
** struct Gadget 
**
**==============================================================================
*/

/* classname=KC_Gadget */
typedef struct _Gadget
{
    KBase __base;
    /* KC_Gadget features */
    const KRef Left; /* Widget */
    const KRef Right; /* Widget */
}
Gadget;

static const unsigned char __Gadget_sig[] =
{
    0x09,0x4b,0x43,0x5f,0x47,0x61,0x64,0x67,0x65,0x74,0x00,0x02,0x4e,0x04,0x4c,
    0x65,0x66,0x74,0x00,0x4e,0x05,0x52,0x69,0x67,0x68,0x74,0x00,
};

KINLINE void Gadget_Init(
    Gadget* self,
    const CMPIBroker* cb,
    const char* ns)
{
    const unsigned char* sig = __Gadget_sig;
    KBase_Init(&self->__base, cb, sizeof(*self), sig, ns);
    ((KRef*)&self->Left)->__sig = __Widget_sig;
    ((KRef*)&self->Right)->__sig = __Widget_sig;
}

KINLINE CMPIStatus Gadget_InitFromInstance(
    Gadget* self,
    const CMPIBroker* cb,
    const CMPIInstance* x)
{
    Gadget_Init(self, cb, NULL);
    return KBase_FromInstance(&self->__base, x);
}

KINLINE CMPIStatus Gadget_InitFromObjectPath(
    Gadget* self,
    const CMPIBroker* cb,
    const CMPIObjectPath* x)
{
    Gadget_Init(self, cb, NULL);
    return KBase_FromObjectPath(&self->__base, x);
}

KINLINE void Gadget_Print(
    const Gadget* self,
    FILE* os)
{
    KBase_Print(os, &self->__base, 'i');
}

KINLINE CMPIInstance* Gadget_ToInstance(
    const Gadget* self,
    CMPIStatus* status)
{
    return KBase_ToInstance(&self->__base, status);
}

KINLINE CMPIObjectPath* Gadget_ToObjectPath(
    const Gadget* self,
    CMPIStatus* status)
{
    return KBase_ToObjectPath(&self->__base, status);
}

KINLINE const char* Gadget_NameSpace(
    Gadget* self)
{
    if (self && self->__base.magic == KMAGIC)
        return self->__base.ns ? KChars(self->__base.ns) : NULL;
    return NULL;
}

KINLINE void Gadget_SetObjectPath_Left(
    Gadget* self,
    const CMPIObjectPath* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_SetObjectPath(field, x);
    }
}

KINLINE CMPIStatus Gadget_Set_Left(
    Gadget* self,
    const WidgetRef* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        return KRef_Set(field, &x->__base);
    }
    CMReturn(CMPI_RC_ERR_FAILED);
}

KINLINE void Gadget_Null_Left(
    Gadget* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_Null(field);
    }
}

KINLINE void Gadget_Clr_Left(
    Gadget* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Left;
        KRef_Clr(field);
    }
}

KINLINE void Gadget_SetObjectPath_Right(
    Gadget* self,
    const CMPIObjectPath* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_SetObjectPath(field, x);
    }
}

KINLINE CMPIStatus Gadget_Set_Right(
    Gadget* self,
    const WidgetRef* x)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        return KRef_Set(field, &x->__base);
    }
    CMReturn(CMPI_RC_ERR_FAILED);
}

KINLINE void Gadget_Null_Right(
    Gadget* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_Null(field);
    }
}

KINLINE void Gadget_Clr_Right(
    Gadget* self)
{
    if (self && self->__base.magic == KMAGIC)
    {
        KRef* field = (KRef*)&self->Right;
        KRef_Clr(field);
    }
}

/*
**==============================================================================
**
** Gadget methods
**
**==============================================================================
*/

KINLINE CMPIStatus Gadget_DispatchMethod(
    const CMPIBroker* cb,
    CMPIMethodMI* mi,
    const CMPIContext* cc,
    const CMPIResult* cr,
    const CMPIObjectPath* cop,
    const char* meth,
    const CMPIArgs* in,
    CMPIArgs* out)
{
    GadgetRef self;

    KReturnIf(GadgetRef_InitFromObjectPath(&self, cb, cop));


    KReturn(ERR_METHOD_NOT_FOUND);
}

#define Gadget_ClassName "KC_Gadget"

#endif /* _konkrete_Gadget_h */
