cpp_server.remoteClass_impl_cpp.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kurento-module-creator Show documentation
Show all versions of kurento-module-creator Show documentation
Tool that generates code for RPC between the Kurento Media Server
and remote libraries.
${remoteClass.name}Impl.cpp
/* Autogenerated with kurento-module-creator */
#include
<#list typeDependencies(remoteClass) as dependency>
<#if module.remoteClasses?seq_contains(dependency)>
#include "${dependency.name}Impl.hpp"
<#else>
#include "${dependency.name}.hpp"
#if>
#list>
<#if remoteClass.constructor??>
#include <${remoteClass.name}ImplFactory.hpp>
#if>
#include "${remoteClass.name}Impl.hpp"
#include
#include
<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))>
#include "MediaPipelineImpl.hpp"
#if>
#define GST_CAT_DEFAULT kurento_${camelToUnderscore(remoteClass.name)?lower_case}_impl
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
#define GST_DEFAULT_NAME "Kurento${remoteClass.name}Impl"
<#list module.code.implementation["cppNamespace"]?split("::") as namespace>
namespace ${namespace}
{
#list>
<#if remoteClass.constructor??>
${remoteClass.name}Impl::${remoteClass.name}Impl (const boost::property_tree::ptree &config<#rt>
<#lt><#list remoteClass.constructor.params as param><#rt>
<#lt>, <#rt>
<#lt>${getCppObjectType(param.type, true)}${param.name}<#rt>
<#lt>#list>)<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))> : OpenCVFilterImpl (config, std::dynamic_pointer_cast (mediaPipeline) )
<#else> <#if remoteClass.extends??> : ${remoteClass.extends.name}Impl (/* FIXME: Add parent class constructor params here */)#if> #if>
<#else>
${remoteClass.name}Impl::${remoteClass.name}Impl (const boost::property_tree::ptree &config)<#if remoteClass.extends??> : ${remoteClass.extends.name}Impl (/* FIXME: Add parent class constructor params here */)#if>
#if>
{
<#if ! ((remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter")))>
// FIXME: Implement this
#if>
}
<#list remoteClass.properties as property>
${getCppObjectType (property.type, false)} ${remoteClass.name}Impl::get${property.name?cap_first} ()
{
<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))>
return ${remoteClass.name}OpenCVImpl::get${property.name?cap_first} ();
<#else>
// FIXME: Implement this
throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::get${property.name}: Not implemented");
#if>
}
<#if !property.final && !property.readOnly>
void ${remoteClass.name}Impl::set${property.name?cap_first} (${getCppObjectType (property.type, true)}${property.name})
{
<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))>
${remoteClass.name}OpenCVImpl::set${property.name?cap_first} (${property.name});
<#else>
// FIXME: Implement this
throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::set${property.name}: Not implemented");
#if>
}
#if>
#list>
<#macro methodStub method>
${getCppObjectType(method.return,false)} ${remoteClass.name}Impl::${method.name} (<#rt>
<#lt><#list method.params as param>${getCppObjectType(param.type)}${param.name}<#if param_has_next>, #if>#list>)
{
<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))>
${remoteClass.name}OpenCVImpl::${method.name} (<#rt>
<#lt><#list method.params as param>${param.name}<#if param_has_next>, #if>#list>);
<#else>
// FIXME: Implement this
throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::${method.name}: Not implemented");
#if>
}
#macro>
<#list remoteClass.methods as method><#rt>
<#list method.expandIfOpsParams() as expandedMethod ><#rt>
<#lt><@methodStub expandedMethod />
#list>
<#lt><@methodStub method />
#list>
<#if remoteClass.constructor??><#rt>
MediaObjectImpl *
${remoteClass.name}ImplFactory::createObject (const boost::property_tree::ptree &config<#rt>
<#lt><#list remoteClass.constructor.params as param><#rt>
<#lt>, <#rt>
<#lt>${getCppObjectType(param.type, true)}${param.name}<#rt>
<#lt>#list>) const
{
return new ${remoteClass.name}Impl (config<#rt>
<#lt><#list remoteClass.constructor.params as param><#rt>
<#lt>, <#rt>
<#lt>${param.name}<#rt>
<#lt>#list>);
}
#if>
${remoteClass.name}Impl::StaticConstructor ${remoteClass.name}Impl::staticConstructor;
${remoteClass.name}Impl::StaticConstructor::StaticConstructor()
{
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0,
GST_DEFAULT_NAME);
}
<#list module.code.implementation["cppNamespace"]?split("::")?reverse as namespace>
} /* ${namespace} */
#list>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy