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

cpp_interface.event_class_hpp.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
${event.name}.hpp
/* Autogenerated with kurento-module-creator */

#ifndef __${camelToUnderscore(event.name)}_HPP__
#define __${camelToUnderscore(event.name)}_HPP__

#include 
#include 
<#if event.extends??>
#include "${event.extends.name}.hpp"


<#list module.code.implementation["cppNamespace"]?split("::") as namespace>
namespace ${namespace}
{

class ${event.name};
<#list module.code.implementation["cppNamespace"]?split("::")?reverse as namespace>
} /* ${namespace} */


namespace kurento
{
class JsonSerializer;
void Serialize (std::shared_ptr<${module.code.implementation["cppNamespace"]}::${event.name}> &object, JsonSerializer &s);
}

${organizeDependencies(typeDependencies(event),false)}
<#list module.code.implementation["cppNamespace"]?split("::") as namespace>
namespace ${namespace}
{

<#list event.properties as property>
<#if module.remoteClasses?seq_contains(property.type.type) ||
  module.complexTypes?seq_contains(property.type.type) ||
  module.events?seq_contains(property.type.type)>
class ${property.type.name};



class ${event.name}<#if event.extends??> : public ${event.extends.name}
{

public:

  ${event.name} (<#rt>
    <#lt><#assign first = true><#rt>
    <#lt><#list event.parentProperties as property><#rt>
      <#lt><#if property.name != "timestamp" && property.name != "tags"><#rt>
        <#lt><#if !property.optional><#rt>
          <#lt><#if !first>, <#rt>
          <#lt><#assign first = false><#rt>
          <#lt>${getCppObjectType(property.type)}${property.name}<#rt>
        <#lt><#rt>
      <#lt><#rt>
    <#lt><#rt>
    <#lt><#list event.properties as property><#rt>
      <#lt><#if property.name != "timestamp" && property.name != "tags"><#rt>
        <#lt><#if !property.optional><#rt>
          <#lt><#if !first>, <#rt>
          <#lt><#assign first = false><#rt>
          <#lt>${getCppObjectType(property.type)}${property.name}<#rt>
        <#lt><#rt>
      <#lt><#rt>
    <#lt>)<#rt>
    <#lt><#assign first = true><#rt>
    <#lt><#if event.extends??> : ${event.extends.name} (<#rt>
      <#lt><#if event.name != "RaiseBase"><#rt>
        <#lt><#list event.parentProperties as property><#rt>
          <#lt><#if property.name != "timestamp" && property.name != "tags"><#rt>
            <#lt><#if !property.optional><#rt>
              <#lt><#if !first>, <#rt>
              <#lt><#assign first = false><#rt>
              <#lt>${property.name}<#rt>
            <#lt><#rt>
          <#lt><#rt>
      <#lt>) {
      <#list event.properties as property><#rt>
        <#lt><#if property.name != "timestamp" && property.name != "tags"><#rt>
          <#lt><#if !property.optional><#rt>
      this->${property.name} = ${property.name};
          <#rt>
        <#rt>
      <#lt>
  };

  ${event.name} (const ${event.name} ©)<#rt>
    <#lt><#assign first = true><#rt>
    <#lt><#if event.extends??> : ${event.extends.name} (copy) {
      <#list event.properties as property><#rt>
        <#lt>
      this->${property.name} = copy.${property.name};
        <#lt><#if property.optional><#rt>
      this->_isSet${property.name} = copy._isSet${property.name};
        <#rt>
      <#lt>
  };

  ${event.name} (const Json::Value &value);

  <#list event.properties as property>
  virtual void set${property.name?cap_first} (${getCppObjectType(property.type, true)}${property.name}) {
    this->${property.name} = ${property.name};
    <#if property.optional>
    _isSet${property.name?cap_first} = true;
    
  };

  virtual ${getCppObjectType(property.type)}get${property.name?cap_first} () {
    return ${property.name};
  };

  <#if property.optional>
  virtual bool isSet${property.name?cap_first} () {
    return _isSet${property.name?cap_first};
  };

  
  
  static std::string getName() {
    return "${event.name}";
  }

  virtual void Serialize (JsonSerializer &s);

protected:

  ${event.name}() {};

private:
  <#list event.properties as property>
  ${getCppObjectType(property.type, false)} ${property.name};
  <#if property.optional>
  bool _isSet${property.name?cap_first} = false;
  
  

  friend void kurento::Serialize (std::shared_ptr<${module.code.implementation["cppNamespace"]}::${event.name}> &event, JsonSerializer &s);
};

<#list module.code.implementation["cppNamespace"]?split("::")?reverse as namespace>
} /* ${namespace} */


#endif /*  __${camelToUnderscore(event.name)}_HPP__ */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy