All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpp_server.remoteClass_impl_cpp.ftl Maven / Gradle / Ivy

Go to download

Tool that generates code for RPC between the Kurento Media Server and remote libraries.

There is a newer version: 7.1.0
Show newest version
${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 remoteClass.constructor??>
#include <${remoteClass.name}ImplFactory.hpp>

#include "${remoteClass.name}Impl.hpp"
#include 
#include 
<#if (remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter"))>
#include "MediaPipelineImpl.hpp"


#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}
{


<#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>)<#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 (/* TO-DO: Add parent class constructor params here; for example: (config, std::dynamic_pointer_cast (mediaPipeline)) */) 
<#else>
${remoteClass.name}Impl::${remoteClass.name}Impl (const boost::property_tree::ptree &config)<#if remoteClass.extends??>
    : ${remoteClass.extends.name}Impl (/* TO-DO: Add parent class constructor params here */)

{
<#if ! ((remoteClass.extends??) && (remoteClass.extends.type.name?ends_with("OpenCVFilter")))>
  // TO-DO: Add implementation here

}
<#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>
  // TO-DO: Add implementation here
  throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::get${property.name}: Not implemented");

}
<#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>
  // TO-DO: Add implementation here
  throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::set${property.name}: Not implemented");

}


<#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 (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>, );
<#else>
  // TO-DO: Add implementation here
  throw KurentoException (NOT_IMPLEMENTED, "${remoteClass.name}Impl::${method.name}: Not implemented");

}

<#list remoteClass.methods as method><#rt>
  <#list method.expandIfOpsParams() as expandedMethod ><#rt>
    <#lt><@methodStub expandedMethod />
  
  <#lt><@methodStub method />


<#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>) const
{
  return new ${remoteClass.name}Impl (config<#rt>
     <#lt><#list remoteClass.constructor.params as param><#rt>
        <#lt>, <#rt>
        <#lt>${param.name}<#rt>
     <#lt>);
}


${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} */





© 2015 - 2024 Weber Informatics LLC | Privacy Policy