
st.membrane.ContentController.stc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations Show documentation
Show all versions of annotations Show documentation
Common ADL and IDL annotations of the Mind programming model.
The newest version!
template st.membrane.ContentController : st.common.ComponentHelper implements st.membrane.ControllerGenerator { st.interfaces.IDLDefinition idl2c = st.interfaces.IDL2C; $${
// -----------------------------------------------------------------------------
// Implementation of the ControllerGenerator interface
// -----------------------------------------------------------------------------
ControllerGlobalDecl(definition, controller) ::= <<
#include "fractal/internal/CCdelegate.h"
/* declare internal interfaces descriptor. This structure is defined in the
membrane implementation (i.e. in 'ctrl_impl.c' file) */
extern struct __component_InternalItfsDescriptor _internalItfs_descriptor;
>>
ControllerData(definition, controller) ::= <<
struct __component_ContentDescriptor *contentDesc;
>>
ControllerDataStaticInit(definition, controller) ::= <<
/* contentDesc */ &instance_name##_contentDesc,
>>
nbDynamicSubComponent(definition) ::= <<
>>
ControllerGlobalDataStaticInit(definition, controller) ::= <<
struct __component_SubComponentDescriptor instance_name##_subComponentDesc[ + ] = \
{}; \
struct __component_ContentDescriptor instance_name##_contentDesc = { \
sizeof(instance_name##_subComponentDesc)/sizeof(struct __component_SubComponentDescriptor), \
instance_name##_subComponentDesc, \
& _internalItfs_descriptor \
};
>>
InitSubCompDesc(definition, component) ::= <<
{&(.__component_internal_data.type.component), ""}
>>
ControllerDataFactoryNew(definition, controller) ::= <<
newInstance->__component_internal_data.contentDesc =
(struct __component_ContentDescriptor*) CALL_PTR((memory_api_Allocator) allocItf, alloc)(sizeof(struct __component_ContentDescriptor));
if (newInstance->__component_internal_data.contentDesc == NULL)
goto error_contentDesc;
newInstance->__component_internal_data.contentDesc->nbSubComponent = + ;
newInstance->__component_internal_data.contentDesc->subComponents =
(struct __component_SubComponentDescriptor*) CALL_PTR((memory_api_Allocator) allocItf, alloc)(sizeof(struct __component_SubComponentDescriptor) * newInstance->__component_internal_data.contentDesc->nbSubComponent);
if (newInstance->__component_internal_data.contentDesc->subComponents == NULL)
goto error_content_dynamicSubComponents;
{
int i = 0;
}
>>
factoryInitCompDesc(definition, component) ::= <<
newInstance->__component_internal_data.contentDesc->subComponents[i].subComponent
= &(newInstance->__component_internal_data.components.->__component_internal_data.type.component);
newInstance->__component_internal_data.contentDesc->subComponents[i].name = "";
i++;
>>
ControllerDataFactoryNewClear(definition, controller) ::= <<
CALL_PTR((memory_api_Allocator) allocItf, free)(newInstance->__component_internal_data.contentDesc->subComponents);
error_content_dynamicSubComponents :
CALL_PTR((memory_api_Allocator) allocItf, free)(newInstance->__component_internal_data.contentDesc);
error_contentDesc :
>>
ControllerDataFactoryDestroy(definition, controller) ::= <<
CALL_PTR((memory_api_Allocator) allocItf, free)(destroyInstance->__component_internal_data.contentDesc->subComponents);
CALL_PTR((memory_api_Allocator) allocItf, free)(destroyInstance->__component_internal_data.contentDesc);
>>
ControllerImplementation(definition, controller, interfaceDefinitions) ::= <<
/* -----------------------------------------------------------------------------
Implementation of the ContentController interface
----------------------------------------------------------------------------- */
>>
// -----------------------------------------------------------------------------
// Internal templates
// -----------------------------------------------------------------------------
initInternalItfsDescriptor(definition) ::= <<
struct __component_InternalClientItfDescriptor _internalClientItf_descriptor[] = {
};
struct __component_InternalServerItfDescriptor _internalServerItf_descriptor[] = {
};
struct __component_InternalItfsDescriptor _internalItfs_descriptor = {
sizeof(_internalClientItf_descriptor)/sizeof(struct __component_InternalClientItfDescriptor),
_internalClientItf_descriptor,
sizeof(_internalServerItf_descriptor)/sizeof(struct __component_InternalServerItfDescriptor),
_internalServerItf_descriptor
};
>>
initInternalClientItfDescriptor(definition, itf) ::= <<
,
,
>>
initInternalClientItfDescriptor1(definition, itf, index) ::= <<
__COMPONENT_INIT_INTERNAL_CLIENT_ITF_DESCRIPTOR(, [], [])
>>
initInternalServerItfDescriptor(definition, itf) ::= <<
,
,
>>
initInternalServerItfDescriptor1(definition, itf, index) ::= <<
__COMPONENT_INIT_INTERNAL_SERVER_ITF_DESCRIPTOR(, [])
>>
initControllerServerItfDescriptor(definition, itf) ::= <<
,
,
>>
initControllerServerItfDescriptor1(definition, itf, index) ::= <<
__COMPONENT_INIT_CONTROLLER_SERVER_ITF_DESCRIPTOR(, [])
>>
getFcSubComponents(definition) ::= <<
int METH(contentController, getFcSubComponents)(fractal_api_Component subComponents[])
{
return __component_getFcSubComponents(subComponents,
);
}
>>
getFcSubComponent(definition) ::= <<
int METH(contentController, getFcSubComponent)(__MIND_STRING_TYPEDEF name,
fractal_api_Component *subComponent)
{
return __component_getFcSubComponent(name, subComponent,
);
}
>>
getFcSubComponentName(definition) ::= <<
int METH(contentController, getFcSubComponentName)(fractal_api_Component subComponent,
__MIND_STRING_TYPEDEF *name)
{
return __component_getFcSubComponentName(subComponent, name,
);
}
>>
addFcSubComponent(definition) ::= <<
int METH(contentController, addFcSubComponent)(fractal_api_Component subComponent)
{
return __component_addFcSubComponent(subComponent,
);
}
>>
addFcNamedSubComponent(definition) ::= <<
int METH(contentController, addFcNamedSubComponent)(fractal_api_Component subComponent,
__MIND_STRING_TYPEDEF name)
{
return __component_addFcNamedSubComponent(subComponent, name,
);
}
>>
removeFcSubComponent(definition) ::= <<
int METH(contentController, removeFcSubComponent)(fractal_api_Component subComponent)
{
return __component_removeFcSubComponents(subComponent,
);
}
>>
addFcSubBinding(definition) ::= <<
int METH(contentController, addFcSubBinding)(fractal_api_Component clientComponent,
__MIND_STRING_TYPEDEF clientItfName, fractal_api_Component serverComponent,
__MIND_STRING_TYPEDEF serverItfName)
{
return __component_addFcSubBinding(clientComponent, clientItfName, serverComponent, serverItfName,
, CONTEXT_PTR_ACCESS);
}
>>
removeFcSubBinding(definition) ::= <<
int METH(contentController, removeFcSubBinding)(fractal_api_Component clientComponent,
__MIND_STRING_TYPEDEF clientItfName)
{
return __component_removeFcSubBinding(clientComponent, clientItfName,
, CONTEXT_PTR_ACCESS);
}
>>
contentDescPointer(definition) ::= <<
CONTEXT_PTR_ACCESS->__component_internal_data.contentDesc
>>
}$$
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy