text:
//
// Events documentation
// ----------------------------------------------------------------------------------------------------------------
// TODO: replace objectId by data-object-id
// TODO: document events data payloads

//
// sonata:domready
// --------------------------------------------------------
/**
 * Fires whenever sonata loads an html page via an AJAX request.
 * @see sonataDomReadyCallback
 *
 * @event sonata:domready
 * @type {jQuery.Event}
 * @property {jQuery} target The root element of the newly inserted DOM.
 */
/**
 * @callback sonataDomReadyCallback
 * @param {jQuery.Event} event
 */

//
// sonata:association-update(d)
// --------------------------------------------------------
/**
 * Fires before the value of an association is updated,
 * in a `sonata_type_model` or `sonata_type_model_list` form.
 *
 * @event sonata:association-update
 * @type {jQuery.Event}
 * @property {jQuery} target The form field that will be updated.
 * @see sonataAssociationUpdateCallback
 */

/**
 * Fires after the value of an association was updated,
 * in a `sonata_type_model` or `sonata_type_model_list` form.
 *
 * @event sonata:association-updated
 * @type {jQuery.Event}
 * @property {jQuery} target The form field that was updated.
 * @see sonataAssociationUpdateCallback
 */

/**
 * @callback sonataAssociationUpdateCallback
 * @param {jQuery.Event} event
 * @param {string} objectId The id of the associated object
 * @param {FieldDescriptionType} fieldDescription
 */

//
// sonata:collection-*
// --------------------------------------------------------
/**
 * Fires when a new empty row is added to a `sonata_type_collection` form.
 *
 * @event sonata:collection-item-add
 * @type {jQuery.Event}
 * @property {jQuery} target The form widget that will receive the new field.
 * @see sonataCollectionUpdateCallback
 */

/**
 * Fires when a new empty row has been added to a `sonata_type_collection` form.
 *
 * @event sonata:collection-item-added
 * @type {jQuery.Event}
 * @property {jQuery} target The field that was just added.
 * @see sonataCollectionUpdateCallback
 */
/**
 * @callback sonataCollectionUpdateCallback
 * @param {jQuery.Event} event
 * @param {FieldDescriptionType} fieldDescription
 */

//
// sonata:native-collection-*
// --------------------------------------------------------
/**
 * Fires before a new item is added to a `sonata_type_native_collection` form.
 *
 * @event sonata:native-collection-item-add
 * @type {jQuery.Event}
 * @property {jQuery} target The form widget that will receive the new item.
 * @see sonataNativeCollectionItemAddCallback
 */
/**
 * Fires after a new item was added to a `sonata_type_native_collection` form.
 *
 * @event sonata:native-collection-item-added
 * @type {jQuery.Event}
 * @property {jQuery} target The form widget that will receive the new item.
 * @see sonataNativeCollectionItemAddCallback
 */
/**
 * @callback sonataNativeCollectionItemAddCallback
 * @param {jQuery.Event} event
 * @param {jQuery} newRow The new row
 */

/**
 * Fires before a new item is removed from a `sonata_type_native_collection` form.
 *
 * @event sonata:native-collection-item-delete
 * @type {jQuery.Event}
 * @property {jQuery} target The form widget from which a row will be removed.
 * @see sonataNativeCollectionDeleteCallback
 */
/**
 * Fires after a new item was removed from a `sonata_type_native_collection` form.
 *
 * @event sonata:native-collection-item-deleted
 * @type {jQuery.Event}
 * @property {jQuery} target The form widget from which a row was removed.
 * @see sonataNativeCollectionDeleteCallback
 */
/**
 * @callback sonataNativeCollectionDeleteCallback
 * @param {jQuery.Event} event
 * @param {jQuery} row The removed row
 */


text:
require 'puppet/util/feature'

# Add the simple features, all in one file.

# Order is important as some features depend on others

# We have a syslog implementation
Puppet.features.add(:syslog, :libs => ["syslog"])

# We can use POSIX user functions
Puppet.features.add(:posix) do
  require 'etc'
  !Etc.getpwuid(0).nil? && Puppet.features.syslog?
end

# We can use Microsoft Windows functions
Puppet.features.add(:microsoft_windows) do
  begin
    # ruby
    require 'Win32API'          # case matters in this require!
    require 'win32ole'
    require 'win32/registry'
    # gems
    require 'sys/admin'
    require 'win32/process'
    require 'win32/dir'
    require 'win32/service'
    require 'win32/api'
    require 'win32/taskscheduler'
    true
  rescue LoadError => err
    warn "Cannot run on Microsoft Windows without the sys-admin, win32-process, win32-dir, win32-service and win32-taskscheduler gems: #{err}" unless Puppet.features.posix?
  end
end

raise Puppet::Error,"Cannot determine basic system flavour" unless Puppet.features.posix? or Puppet.features.microsoft_windows?

# We've got LDAP available.
Puppet.features.add(:ldap, :libs => ["ldap"])

# We have the Rdoc::Usage library.
Puppet.features.add(:usage, :libs => %w{rdoc/ri/ri_paths rdoc/usage})

# We have libshadow, useful for managing passwords.
Puppet.features.add(:libshadow, :libs => ["shadow"])

# We're running as root.
Puppet.features.add(:root) { require 'puppet/util/suidmanager'; Puppet::Util::SUIDManager.root? }

# We have lcs diff
Puppet.features.add :diff, :libs => %w{diff/lcs diff/lcs/hunk}

# We have augeas
Puppet.features.add(:augeas, :libs => ["augeas"])

# We have RRD available
Puppet.features.add(:rrd_legacy, :libs => ["RRDtool"])
Puppet.features.add(:rrd, :libs => ["RRD"])

# We have OpenSSL
Puppet.features.add(:openssl, :libs => ["openssl"])

# We have CouchDB
Puppet.features.add(:couchdb, :libs => ["couchrest"])

# We have sqlite
Puppet.features.add(:sqlite, :libs => ["sqlite3"])

# We have Hiera
Puppet.features.add(:hiera, :libs => ["hiera"])

Puppet.features.add(:minitar, :libs => ["archive/tar/minitar"])

# We can manage symlinks
Puppet.features.add(:manages_symlinks) do
  if ! Puppet::Util::Platform.windows?
    true
  else
    begin
      require 'Win32API'
      Win32API.new('kernel32', 'CreateSymbolicLink', 'SSL', 'B')
      true
    rescue LoadError => err
      Puppet.debug("CreateSymbolicLink is not available")
      false
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
You discovered the Oscillation of Neutral B Mesons.

The Oscillation of Neutral B mesons

More information will come soon...

Resources

B-Bbar on Wikipedia


text:
id: 587d7daa367417b2b2512b6b
title: Split a String into an Array Using the split Method
challengeType: 1
isHidden: false
forumTopicId: 18305
---

## Description

The split method splits a string into an array of strings. It takes an argument for the delimiter, which can be a character to use to break up the string or a regular expression. For example, if the delimiter is a space, you get an array of words, and if the delimiter is an empty string, you get an array of each character in the string.
Here are two examples that split one string by spaces, then another by digits using a regular expression:

```js
var str = "Hello World";
var bySpace = str.split(" ");
// Sets bySpace to ["Hello", "World"]

var otherString = "How9are7you2today";
var byDigits = otherString.split(/\d/);
// Sets byDigits to ["How", "are", "you", "today"]
```

Since strings are immutable, the split method makes it easier to work with them.

## Instructions

Use the split method inside the splitify function to split str into an array of words. The function should return the array. Note that the words are not always separated by spaces, and the array should not contain punctuation.

## Tests

```yml
tests:
  - text: Your code should use the <code>split</code> method.
    testString: assert(code.match(/\.split/g));
  - text: <code>splitify("Hello World,I-am code")</code> should return <code>["Hello", "World", "I", "am", "code"]</code>.
    testString: assert(JSON.stringify(splitify("Hello World,I-am code")) === JSON.stringify(["Hello", "World", "I", "am", "code"]));
  - text: <code>splitify("Earth-is-our home")</code> should return <code>["Earth", "is", "our", "home"]</code>.
    testString: assert(JSON.stringify(splitify("Earth-is-our home")) === JSON.stringify(["Earth", "is", "our", "home"]));
  - text: <code>splitify("This.is.a-sentence")</code> should return <code>["This", "is", "a", "sentence"]</code>.
    testString: assert(JSON.stringify(splitify("This.is.a-sentence")) === JSON.stringify(["This", "is", "a", "sentence"]));

```

## Challenge Seed

```js
function splitify(str) {
  // Only change code below this line

  // Only change code above this line
}
splitify("Hello World,I-am code");
```

## Solution

```js
function splitify(str) {
  // Only change code below this line
  return str.split(/\W/);
  // Only change code above this line
}
```


text:
// $Id: test_remove.cpp,v 1.13 2003/03/02 15:17:21 t1mpy Exp $

#if defined(HAVE_CONFIG_H)
# include "config.h"
#endif

#include "id3/id3lib_streams.h"
#include "id3/tag.h"
#include "id3/misc_support.h"
#include "id3/id3lib_strings.h"

using std::cout;
using std::endl;
using std::cerr;

using namespace dami;

typedef const char* LPCTSTR;

/* CSharedTag is a wrapper I made for some features I need */
/* LPCTSTR means const char * */
size_t RemoveFrame(ID3_Tag& pTag, ID3_FrameID fID, LPCTSTR sDescription)
{
  size_t nCount = 0;
  const ID3_Frame * frame = NULL;

  do {
    if (!sDescription)
    {
      cerr << "*** description is null" << endl;
      frame = pTag.Find(fID);
    }
    else
    {
      cerr << "*** description is \"" << sDescription << "\"" << endl;
      frame = pTag.Find(fID, ID3FN_DESCRIPTION, sDescription);
    }

    if (frame)
    {
      ID3_Field* fld = frame->GetField(ID3FN_TEXT);
      String text(fld->GetRawText(), fld->Size());
      cerr << "*** delete frame with text \"" << text << "\"" << endl;
      /* pTag is an ID3_Tag */
      delete pTag.RemoveFrame(frame);
      nCount++;
    }
  } while (frame != NULL);

  return nCount;
}

int main( int argc, char *argv[])
{
  ID3_Tag tag;
  ID3_Frame frame;

  if (argc == 2)
  {
    tag.Link(argv[1]);
    cerr << "removed " << RemoveFrame(tag, ID3FID_COMMENT, "") << " descriptionless comment frames" << endl;
    tag.Update();

  }
  else
  {
    tag.Link("test-remove.tag");
    tag.Strip(ID3TT_ALL);
    tag.Clear();

    frame.SetID(ID3FID_TITLE);
    frame.GetField(ID3FN_TEXT)->Set("Test title");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_COMPOSER);
    frame.GetField(ID3FN_TEXT)->Set("Test composer");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_BAND);
    frame.GetField(ID3FN_TEXT)->Set("Test band");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_CONDUCTOR);
    frame.GetField(ID3FN_TEXT)->Set("Test conductor");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_COMMENT);
    frame.GetField(ID3FN_LANGUAGE)->Set("eng");
    frame.GetField(ID3FN_TEXT)->Set("Test comment");
    frame.GetField(ID3FN_DESCRIPTION)->Set("A Description");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_COMMENT);
    frame.GetField(ID3FN_LANGUAGE)->Set("eng");
    frame.GetField(ID3FN_TEXT)->Set("Test comment 2");
    frame.GetField(ID3FN_DESCRIPTION)->Set("");
    tag.AddFrame(frame);

    frame.SetID(ID3FID_COMMENT);
    frame.GetField(ID3FN_LANGUAGE)->Set("eng");
    frame.GetField(ID3FN_TEXT)->Set("ID3v1 comment text?");
    frame.GetField(ID3FN_DESCRIPTION)->Set(STR_V1_COMMENT_DESC);
    tag.AddFrame(frame);

    tag.SetPadding(false);
    tag.Update(ID3TT_ID3V2);

    cerr << "removed " << ID3_RemoveArtists(&tag) << " artist frames" << endl;
    tag.Update();
    cerr << "removed " << ID3_RemoveTitles(&tag) << " title frames" << endl;
    tag.Update();
    cerr << "removed " << RemoveFrame(tag, ID3FID_COMMENT, "") << " descriptionless comment frames" << endl;
    tag.Update();
  }

  return 0;
}


text:
{% extends "socialaccount/base.html" %}

{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Signup" %}{% endblock %}

{% block content %}

{% trans "Sign Up" %}

{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to
        {{site_name}}. As a final step, please complete the following form:{% endblocktrans %}

        <form class="signup" id="signup_form" method="post" action="{% url 'socialaccount_signup' %}">
          {% csrf_token %}
          {{ form|crispy }}
          {% if redirect_field_value %}
          <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
          {% endif %}
          <button class="btn btn-primary btn-block" type="submit">{% trans "Sign Up" %} »</button>
        </form>

{% endblock %}


text:
pub mod direct_send;
pub mod health_checker;
pub mod identity;
pub mod network;
pub mod rpc;
pub mod stream;
pub mod wire;


text:
cask "wifi-explorer-pro" do
  version "3.4.2,21"
  sha256 "07144100479dadb01ac5f4fe435bb36b717c8b454ea71a744e6f57b3a1be1dc8"

  url "https://www.intuitibits.com/appcasts/WiFiExplorerPro_#{version.csv.first}.zip"
  name "WiFi Explorer Pro"
  desc "Scan, monitor, and troubleshoot wireless networks"
  homepage "https://www.intuitibits.com/products/wifi-explorer/"

  livecheck do
    url "https://www.intuitibits.com/appcasts/com.intuitibits.wifiexplorerpro#{version.major}cast.xml"
    strategy :sparkle
  end

  depends_on macos: ">= :high_sierra"

  app "WiFi Explorer Pro #{version.major}.app"

  zap trash: [
    "~/Library/Application Support/WiFi Explorer Pro #{version.major}",
    "~/Library/Caches/com.apple.helpd/Generated/com.intuitibits.wifiexplorerpro#{version.major}.*",
    "~/Library/Caches/com.intuitibits.wifiexplorerpro#{version.major}",
    "~/Library/Group Containers/2B9R362QNU.com.adriangranados.wifiexplorer",
    "~/Library/Preferences/com.intuitibits.wifiexplorerpro#{version.major}.plist",
    "~/Library/Saved Application State/com.intuitibits.wifiexplorerpro#{version.major}.savedState",
  ]
end


text:
#import <AppKit/AppKit.h>

@interface OpacityTransferView : NSView
{

	IBOutlet		NSTextField *position;

	NSMutableArray  *points;

	NSInteger		curIndex;

	unsigned char   red[256], green[256], blue[256];
}

- (NSMutableArray*) getPoints;
- (void) setCurrentCLUT :( unsigned char*) r : (unsigned char*) g : (unsigned char*) b;
- (IBAction) renderButton:(id) sender;
+ (NSData*) tableWith256Entries: (NSArray*) pointsArray;
+ (NSData*) tableWith4096Entries: (NSArray*) pointsArray;
@end


text:
namespace ark {

//[[core::class]]
class Paragraph : public Renderer, public Block {
public:
    Paragraph(const sp<Characters>& characters);

    virtual void render(RenderRequest& renderRequest, const V3& position) override;

    virtual const sp<Size>& size() override;

//  [[plugin::builder("paragraph")]]
    class BUILDER : public Builder<Renderer> {
    public:
        BUILDER(BeanFactory& factory, const document& manifest);

        virtual sp<Renderer> build(const Scope& args) override;

    private:
        sp<Builder<Characters>> _characters;
        sp<Builder<LayoutParam>> _layout_param;
        SafePtr<Builder<String>> _string;
    };

private:
    sp<RenderLayer> _render_layer;
    sp<Characters> _characters;
};

}

#endif


text:
package com.paypal.selion.logging;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

import com.paypal.selion.utils.JarSpawner;

/**
 * A Simple utils logger that will be used by {@link JarSpawner}
 *
 */
public class SeLionGridLogger {
    private static final String CLASS_NAME = SeLionGridLogger.class.getSimpleName();
    public static final String CONSOLE_LOGGER_NAME = SeLionGridLogger.class.getPackage().toString();
    private static Logger logger = null;

    public static synchronized Logger getLogger() {
        if (logger != null) {
            return logger;
        }
        logger = Logger.getLogger(CONSOLE_LOGGER_NAME);
        Handler handler = null;
        try {
            handler = new FileHandler("jar-spawner.log", true);
            handler.setFormatter(new SimpleFormatter());
            handler.setLevel(Level.FINE);
            logger.addHandler(handler);
            return logger;
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * Function entry log convenience method.
     */
    public static void entering() {
        if (!getLogger().isLoggable(Level.FINER)) {
            return;
        }
        FrameInfo fi = getLoggingFrame();
        getLogger().entering(fi.className, fi.methodName);
    }

    /**
     * Function entry log convenience method with additional parm.
     *
     * @param object
     *            additional parm
     */
    public static void entering(Object object) {
        if (!getLogger().isLoggable(Level.FINER)) {
            return;
        }
        FrameInfo fi = getLoggingFrame();
        getLogger().entering(fi.className, fi.methodName, object);
    }

    /**
     * Function exit log convenience method.
     */
    public static void exiting() {
        if (!getLogger().isLoggable(Level.FINER)) {
            return;
        }
        FrameInfo fi = getLoggingFrame();
        getLogger().exiting(fi.className, fi.methodName);
    }

    /**
     * Function exit log convenience method.
     *
     * @param object
     *            return value
     */
    public static void exiting(Object object) {
        if (!getLogger().isLoggable(Level.FINER)) {
            return;
        }
        FrameInfo fi = getLoggingFrame();
        getLogger().exiting(fi.className, fi.methodName, object);
    }

    /**
     * Calculate the logging frame's class name and method name.
     *
     * @return FrameInfo with className and methodName.
     */
    private static FrameInfo getLoggingFrame() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        StackTraceElement loggingFrame = null;
        /*
         * We need to dig through all the frames until we get to a frame that contains this class, then dig through all
         * frames for this class, to finally come to a point where we have the frame for the calling method.
         */
        // Skip stackTrace[0], which is getStackTrace() on Win32 JDK 1.6.
        for (int ix = 1; ix < stackTrace.length; ix++) {
            loggingFrame = stackTrace[ix];
            if (loggingFrame.getClassName().contains(CLASS_NAME)) {
                for (int iy = ix; iy < stackTrace.length; iy++) {
                    loggingFrame = stackTrace[iy];
                    if (!loggingFrame.getClassName().contains(CLASS_NAME)) {
                        break;
                    }
                }
                break;
            }
        }
        return new FrameInfo(loggingFrame.getClassName(), loggingFrame.getMethodName());
    }

    private static class FrameInfo {
        private String className;
        private String methodName;

        private FrameInfo(String className, String methodName) {
            this.className = className;
            this.methodName = methodName;
        }

        @Override
        public String toString() {
            return this.className + "." + this.methodName;
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    >

	 <ImageButton
	     android:id="@+id/complete_checkbox"
	     style="?android:attr/buttonBarButtonStyle"
	     android:layout_width="48dp"
	     android:layout_height="wrap_content"
	     android:src="@drawable/checkbox_empty"
	     />

	<EditText
	    android:id="@+id/to_do_item"
	    android:layout_width="0dp"
	    android:layout_height="wrap_content"
	    android:layout_weight="1"
		android:paddingTop="14dp"
	    android:paddingBottom="14dp"
	    android:paddingRight="14dp"
	    android:textStyle="bold"
	    android:textSize="16sp"
	    android:background="@android:color/transparent"
	    android:hint="@string/new_to_do_hint"
	    android:textColorHint="@color/grey"
	    android:inputType="textMultiLine|textNoSuggestions"
        />

</LinearLayout>


text:
from django.conf.urls import url

# Import auth_views for login and logout methods
from django.contrib.auth import views as auth_views

from . import views
from . import api_imports
from . import api_exports
from . import apiV2

urlpatterns = [
    url(r'^$', auth_views.login, { "template_name" : "login.html"}),
    url(r'^logout/$', auth_views.logout, { "next_page" : '/'}),
    url(r'^map$', views.map),
    url(r'^api/v1/zone$', api_imports.zone_info),
	url(r'^api/v1/room$', api_imports.room_info),
	url(r'^api/v1/furniture$', api_imports.furniture_info),
	url(r'^api/v1/person$', api_imports.person_info),
    url(r'^api/v1/zones/csv$', api_exports.zone_export_csv),
    url(r'^api/v1/persons/csv$', api_exports.person_export_csv),
    url(r'^api/v1/furniture/geojson$', api_exports.furniture_export_geojson),
    url(r'^api/v1/furniture/csv$', api_exports.furniture_export_csv),
    url(r'^api/v2/zones/export$', apiV2.zone_export_multithread)
]


text:
/* { dg-do compile } */
#include <altivec.h>
extern vector unsigned int gn00111;
long f() { return (long)&gn00111; }


text:
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace DriverAssistent_WebService.Models
{

    public class UserContext : DbContext
    {
        public DbSet<User> Users { get; set; }
        public DbSet<UserRole> Roles { get; set; }
        public DbSet<Destination> Destinations { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>G</logradouro><bairro>Santos Dumont</bairro><cidade>Aracaju</cidade><uf>SE</uf><cep>49087556</cep></feed>


text:
<?php

namespace Aluno\Entity;

use Doctrine\ORM\Mapping as ORM;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;

/**
 * Aluno
 *
 * @ORM\Table(name="aluno")
 * @ORM\Entity
 */
class Aluno implements InputFilterAwareInterface
{
    protected $inputFilter;

    /**
     * @var integer
     *
     * @ORM\Column(name="idaluno", type="integer", precision=0, scale=0, nullable=false, unique=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $idaluno;

    /**
     * @var string
     *
     * @ORM\Column(name="nomeAluno", type="string", length=75, precision=0, scale=0, nullable=false, unique=false)
     */
    private $nomealuno;

    /**
     * @var string
     *
     * @ORM\Column(name="emailAluno", type="string", length=45, precision=0, scale=0, nullable=false, unique=false)
     */
    private $emailaluno;

    /**
     * @var string
     *
     * @ORM\Column(name="telefoneAluno", type="string", length=45, precision=0, scale=0, nullable=false, unique=false)
     */
    private $telefonealuno;

    /**
     * @var string
     *
     * @ORM\Column(name="matriculaAluno", type="string", length=45, precision=0, scale=0, nullable=false, unique=false)
     */
    private $matriculaaluno;

    /**
     * @var \Curso\Entity\Curso
     *
     * @ORM\ManyToOne(targetEntity="Curso\Entity\Curso")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="cursoAluno", referencedColumnName="idcurso", nullable=true)
     * })
     */
    private $cursoAluno;

    /**
     * @var boolean
     *
     * @ORM\Column(name="bolsista", type="boolean", precision=0, scale=0, nullable=false, unique=false)
     */
    private $bolsista;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="dataNasc", type="datetime", precision=0, scale=0, nullable=false, unique=false)
     */
    private $datanasc;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Projeto\Entity\Projeto", inversedBy="alunoaluno")
     * @ORM\JoinTable(name="aluno_has_projeto",
     *   joinColumns={
     *     @ORM\JoinColumn(name="aluno_idaluno", referencedColumnName="idaluno", nullable=true)
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="Projeto_idProjeto", referencedColumnName="idProjeto", nullable=true)
     *   }
     * )
     */
    private $alunoprojeto;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->alunoprojeto = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get idaluno
     *
     * @return integer
     */
    public function getIdaluno()
    {
        return $this->idaluno;
    }

    /**
     * Set nomealuno
     *
     * @param string $nomealuno
     * @return Aluno
     */
    public function setNomealuno($nomealuno)
    {
        $this->nomealuno = utf8_decode($nomealuno);

        return $this;
    }

    /**
     * Get nomealuno
     *
     * @return string
     */
    public function getNomealuno()
    {
        return $this->nomealuno;
    }

    /**
     * Set emailaluno
     *
     * @param string $emailaluno
     * @return Aluno
     */
    public function setEmailaluno($emailaluno)
    {
        $this->emailaluno = $emailaluno;

        return $this;
    }

    /**
     * Get emailaluno
     *
     * @return string
     */
    public function getEmailaluno()
    {
        return $this->emailaluno;
    }

    /**
     * Set telefonealuno
     *
     * @param string $telefonealuno
     * @return Aluno
     */
    public function setTelefonealuno($telefonealuno)
    {
        $this->telefonealuno = $telefonealuno;

        return $this;
    }

    /**
     * Get telefonealuno
     *
     * @return string
     */
    public function getTelefonealuno()
    {
        return $this->telefonealuno;
    }

    /**
     * Set matriculaaluno
     *
     * @param string $matriculaaluno
     * @return Aluno
     */
    public function setMatriculaaluno($matriculaaluno)
    {
        $this->matriculaaluno = $matriculaaluno;

        return $this;
    }

    /**
     * Get matriculaaluno
     *
     * @return string
     */
    public function getMatriculaaluno()
    {
        return $this->matriculaaluno;
    }

    /**
     * Set cursoAluno
     *
     * @param \Curso\Entity\Curso $cursoAluno
     * @return Aluno
     */
    public function setCursoAluno(\Curso\Entity\Curso $cursoAluno = null)
    {
        $this->cursoAluno = $cursoAluno;

        return $this;
    }

    /**
     * Get cursoAluno
     *
     * @return \Curso\Entity\Curso
     */
    public function getCursoAluno()
    {
        return $this->cursoAluno;
    }

    /**
     * Set bolsista
     *
     * @param boolean $bolsista
     * @return Aluno
     */
    public function setBolsista($bolsista)
    {
        $this->bolsista = $bolsista;

        return $this;
    }

    /**
     * Get bolsista
     *
     * @return boolean
     */
    public function getBolsista()
    {
        return $this->bolsista;
    }

    /**
     * Set datanasc
     *
     * @param \DateTime $datanasc
     * @return Aluno
     */
    public function setDatanasc($datanasc)
    {
        $this->datanasc = $datanasc;

        return $this;
    }

    /**
     * Get datanasc
     *
     * @return \DateTime
     */
    public function getDatanasc()
    {
        return $this->datanasc;
    }

    /**
     * Add alunoprojeto
     *
     * @param \Projeto\Entity\Projeto $alunoprojeto
     * @return Aluno
     */
    public function addProjetoprojeto(\Projeto\Entity\Projeto $alunoprojeto)
    {
        $this->alunoprojeto[] = $alunoprojeto;

        return $this;
    }

    /**
     * Remove alunoprojeto
     *
     * @param \Projeto\Entity\Projeto $alunoprojeto
     */
    public function removeProjetoprojeto(\Projeto\Entity\Projeto $alunoprojeto)
    {
        $this->alunoprojeto->removeElement($alunoprojeto);
    }

    /**
     * Get alunoprojeto
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getProjetoprojeto()
    {
        return $this->alunoprojeto;
    }

    /**
     * Convert the object to an array.
     *
     * @return array
     */
    public function getArrayCopy()
    {
        $obj_vars = get_object_vars($this);
        $obj_vars['datanasc'] = $obj_vars['datanasc']->format('d/m/Y');
        $obj_vars['bolsista'] = $obj_vars['bolsista'] == true ? "true" : "false";
        $obj_vars['cursoAluno'] = $obj_vars['cursoAluno']->getIdcurso();
        return $obj_vars;
    }

    /**
     * Populate from an array.
     *
     * @param array $data
     */
    public function populate($data = array())
    {
        foreach ($data as $property => $value) {
            if (! property_exists($this, $property)) {
                continue;
            }
            $this->$property = $value;
        }
    }

    public function setInputFilter(InputFilterInterface $inputFilter)
    {
        throw new \Exception("Not used!");
    }

    public function getInputFilter()
    {
        if (! $this->inputFilter) {
            $inputFilter = new InputFilter();

            $factory = new InputFactory();

              $inputFilter->add($factory->createInput(array(
                'name'     => 'nomealuno',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    array(
                        'name'    => 'StringLength',
                        'options' => array(
                            'encoding' => 'UTF-8',
                            'min'      => 1,
                            'max'      => 255,
                        ),
                    ),
                ),
            )));

            $inputFilter->add($factory->createInput(array(
                'name'     => 'emailaluno',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    /*array(
                        'name' => 'record_exists',
                        'options' => array(
                            'allow' => Hostname::ALLOW_DNS,
                            'deep' => FALSE,
                            'domain' => TRUE,
                            'mx' => FALSE
                        ),
                    ),*/
                ),
            )));

            $inputFilter->add($factory->createInput(array(
                'name'     => 'telefonealuno',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    array(
                        'name'    => 'StringLength',
                        'options' => array(
                            'encoding' => 'UTF-8',
                            'min'      => 1,
                            'max'      => 14,
                        ),
                    ),
                ),
            )));

            $inputFilter->add($factory->createInput(array(
                'name'     => 'matriculaaluno',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    /*array(
                        'name'    => 'Int',
                        'options' => array(
                            'encoding' => 'UTF-8',
                            'min'      => 1,
                            'max'      => 9,
                        ),
                    ), */
                ),
            )));

              $inputFilter->add($factory->createInput(array(
                'name'     => 'datanasc',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    array(
                        'name' => 'date',
                        'options' => array(
                            'locale' => 'pt_BR',
                            'format' => 'd/m/Y'),
                        ),
                    ),
            )));

            $this->inputFilter = $inputFilter;
        }

        return $this->inputFilter;
    }
}


text:
using namespace OpenHome;
using namespace OpenHome::Net;

class SyncIncrementOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncIncrementOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncIncrementOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    uint32_t& iResult;
};

SyncIncrementOpenhomeOrgTestBasic1Cpp::SyncIncrementOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncIncrementOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndIncrement(aAsync, iResult);
}

class SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    uint32_t& iResult;
};

SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp::SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndEchoAllowedRangeUint(aAsync, iResult);
}

class SyncDecrementOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncDecrementOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, int32_t& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncDecrementOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    int32_t& iResult;
};

SyncDecrementOpenhomeOrgTestBasic1Cpp::SyncDecrementOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, int32_t& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncDecrementOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndDecrement(aAsync, iResult);
}

class SyncToggleOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncToggleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, bool& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncToggleOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    bool& iResult;
};

SyncToggleOpenhomeOrgTestBasic1Cpp::SyncToggleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, bool& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncToggleOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndToggle(aAsync, iResult);
}

class SyncEchoStringOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncEchoStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncEchoStringOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    std::string& iResult;
};

SyncEchoStringOpenhomeOrgTestBasic1Cpp::SyncEchoStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncEchoStringOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndEchoString(aAsync, iResult);
}

class SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    std::string& iResult;
};

SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp::SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndEchoAllowedValueString(aAsync, iResult);
}

class SyncEchoBinaryOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncEchoBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncEchoBinaryOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    std::string& iResult;
};

SyncEchoBinaryOpenhomeOrgTestBasic1Cpp::SyncEchoBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aResult)
    : iService(aProxy)
    , iResult(aResult)
{
}

void SyncEchoBinaryOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndEchoBinary(aAsync, iResult);
}

class SyncSetUintOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetUintOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetUintOpenhomeOrgTestBasic1Cpp::SyncSetUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetUintOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetUint(aAsync);
}

class SyncGetUintOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aValueUint);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetUintOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    uint32_t& iValueUint;
};

SyncGetUintOpenhomeOrgTestBasic1Cpp::SyncGetUintOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aValueUint)
    : iService(aProxy)
    , iValueUint(aValueUint)
{
}

void SyncGetUintOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetUint(aAsync, iValueUint);
}

class SyncSetIntOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetIntOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetIntOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetIntOpenhomeOrgTestBasic1Cpp::SyncSetIntOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetIntOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetInt(aAsync);
}

class SyncGetIntOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetIntOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, int32_t& aValueInt);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetIntOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    int32_t& iValueInt;
};

SyncGetIntOpenhomeOrgTestBasic1Cpp::SyncGetIntOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, int32_t& aValueInt)
    : iService(aProxy)
    , iValueInt(aValueInt)
{
}

void SyncGetIntOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetInt(aAsync, iValueInt);
}

class SyncSetBoolOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetBoolOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetBoolOpenhomeOrgTestBasic1Cpp::SyncSetBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetBoolOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetBool(aAsync);
}

class SyncGetBoolOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, bool& aValueBool);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetBoolOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    bool& iValueBool;
};

SyncGetBoolOpenhomeOrgTestBasic1Cpp::SyncGetBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, bool& aValueBool)
    : iService(aProxy)
    , iValueBool(aValueBool)
{
}

void SyncGetBoolOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetBool(aAsync, iValueBool);
}

class SyncSetMultipleOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetMultipleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetMultipleOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetMultipleOpenhomeOrgTestBasic1Cpp::SyncSetMultipleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetMultipleOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetMultiple(aAsync);
}

class SyncGetMultipleOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetMultipleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aValueUint, int32_t& aValueInt, bool& aValueBool);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetMultipleOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    uint32_t& iValueUint;
    int32_t& iValueInt;
    bool& iValueBool;
};

SyncGetMultipleOpenhomeOrgTestBasic1Cpp::SyncGetMultipleOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, uint32_t& aValueUint, int32_t& aValueInt, bool& aValueBool)
    : iService(aProxy)
    , iValueUint(aValueUint)
    , iValueInt(aValueInt)
    , iValueBool(aValueBool)
{
}

void SyncGetMultipleOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetMultiple(aAsync, iValueUint, iValueInt, iValueBool);
}

class SyncSetStringOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetStringOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetStringOpenhomeOrgTestBasic1Cpp::SyncSetStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetStringOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetString(aAsync);
}

class SyncGetStringOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aValueStr);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetStringOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    std::string& iValueStr;
};

SyncGetStringOpenhomeOrgTestBasic1Cpp::SyncGetStringOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aValueStr)
    : iService(aProxy)
    , iValueStr(aValueStr)
{
}

void SyncGetStringOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetString(aAsync, iValueStr);
}

class SyncSetBinaryOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncSetBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncSetBinaryOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncSetBinaryOpenhomeOrgTestBasic1Cpp::SyncSetBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncSetBinaryOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndSetBinary(aAsync);
}

class SyncGetBinaryOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncGetBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aValueBin);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncGetBinaryOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
    std::string& iValueBin;
};

SyncGetBinaryOpenhomeOrgTestBasic1Cpp::SyncGetBinaryOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy, std::string& aValueBin)
    : iService(aProxy)
    , iValueBin(aValueBin)
{
}

void SyncGetBinaryOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndGetBinary(aAsync, iValueBin);
}

class SyncToggleBoolOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncToggleBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncToggleBoolOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncToggleBoolOpenhomeOrgTestBasic1Cpp::SyncToggleBoolOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncToggleBoolOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndToggleBool(aAsync);
}

class SyncWriteFileOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncWriteFileOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncWriteFileOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncWriteFileOpenhomeOrgTestBasic1Cpp::SyncWriteFileOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncWriteFileOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndWriteFile(aAsync);
}

class SyncShutdownOpenhomeOrgTestBasic1Cpp : public SyncProxyAction
{
public:
    SyncShutdownOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy);
    virtual void CompleteRequest(IAsync& aAsync);
    virtual ~SyncShutdownOpenhomeOrgTestBasic1Cpp() {}
private:
    CpProxyOpenhomeOrgTestBasic1Cpp& iService;
};

SyncShutdownOpenhomeOrgTestBasic1Cpp::SyncShutdownOpenhomeOrgTestBasic1Cpp(CpProxyOpenhomeOrgTestBasic1Cpp& aProxy)
    : iService(aProxy)
{
}

void SyncShutdownOpenhomeOrgTestBasic1Cpp::CompleteRequest(IAsync& aAsync)
{
    iService.EndShutdown(aAsync);
}

CpProxyOpenhomeOrgTestBasic1Cpp::CpProxyOpenhomeOrgTestBasic1Cpp(CpDeviceCpp& aDevice)
    : iCpProxy("openhome-org", "TestBasic", 1, aDevice.Device())
{
    OpenHome::Net::Parameter* param;
    TChar** allowedValues;
    TUint index;

    iActionIncrement = new Action("Increment");
    param = new OpenHome::Net::ParameterUint("Value");
    iActionIncrement->AddInputParameter(param);
    param = new OpenHome::Net::ParameterUint("Result");
    iActionIncrement->AddOutputParameter(param);

    iActionEchoAllowedRangeUint = new Action("EchoAllowedRangeUint");
    param = new OpenHome::Net::ParameterUint("Value", 10, 20);
    iActionEchoAllowedRangeUint->AddInputParameter(param);
    param = new OpenHome::Net::ParameterUint("Result");
    iActionEchoAllowedRangeUint->AddOutputParameter(param);

    iActionDecrement = new Action("Decrement");
    param = new OpenHome::Net::ParameterInt("Value");
    iActionDecrement->AddInputParameter(param);
    param = new OpenHome::Net::ParameterInt("Result");
    iActionDecrement->AddOutputParameter(param);

    iActionToggle = new Action("Toggle");
    param = new OpenHome::Net::ParameterBool("Value");
    iActionToggle->AddInputParameter(param);
    param = new OpenHome::Net::ParameterBool("Result");
    iActionToggle->AddOutputParameter(param);

    iActionEchoString = new Action("EchoString");
    param = new OpenHome::Net::ParameterString("Value");
    iActionEchoString->AddInputParameter(param);
    param = new OpenHome::Net::ParameterString("Result");
    iActionEchoString->AddOutputParameter(param);

    iActionEchoAllowedValueString = new Action("EchoAllowedValueString");
    index = 0;
    allowedValues = new TChar*[4];
    allowedValues[index++] = (TChar*)"One";
    allowedValues[index++] = (TChar*)"Two";
    allowedValues[index++] = (TChar*)"Three";
    allowedValues[index++] = (TChar*)"Four";
    param = new OpenHome::Net::ParameterString("Value", allowedValues, 4);
    iActionEchoAllowedValueString->AddInputParameter(param);
    delete[] allowedValues;
    param = new OpenHome::Net::ParameterString("Result");
    iActionEchoAllowedValueString->AddOutputParameter(param);

    iActionEchoBinary = new Action("EchoBinary");
    param = new OpenHome::Net::ParameterBinary("Value");
    iActionEchoBinary->AddInputParameter(param);
    param = new OpenHome::Net::ParameterBinary("Result");
    iActionEchoBinary->AddOutputParameter(param);

    iActionSetUint = new Action("SetUint");
    param = new OpenHome::Net::ParameterUint("ValueUint");
    iActionSetUint->AddInputParameter(param);

    iActionGetUint = new Action("GetUint");
    param = new OpenHome::Net::ParameterUint("ValueUint");
    iActionGetUint->AddOutputParameter(param);

    iActionSetInt = new Action("SetInt");
    param = new OpenHome::Net::ParameterInt("ValueInt");
    iActionSetInt->AddInputParameter(param);

    iActionGetInt = new Action("GetInt");
    param = new OpenHome::Net::ParameterInt("ValueInt");
    iActionGetInt->AddOutputParameter(param);

    iActionSetBool = new Action("SetBool");
    param = new OpenHome::Net::ParameterBool("ValueBool");
    iActionSetBool->AddInputParameter(param);

    iActionGetBool = new Action("GetBool");
    param = new OpenHome::Net::ParameterBool("ValueBool");
    iActionGetBool->AddOutputParameter(param);

    iActionSetMultiple = new Action("SetMultiple");
    param = new OpenHome::Net::ParameterUint("ValueUint");
    iActionSetMultiple->AddInputParameter(param);
    param = new OpenHome::Net::ParameterInt("ValueInt");
    iActionSetMultiple->AddInputParameter(param);
    param = new OpenHome::Net::ParameterBool("ValueBool");
    iActionSetMultiple->AddInputParameter(param);

    iActionGetMultiple = new Action("GetMultiple");
    param = new OpenHome::Net::ParameterUint("ValueUint");
    iActionGetMultiple->AddOutputParameter(param);
    param = new OpenHome::Net::ParameterInt("ValueInt");
    iActionGetMultiple->AddOutputParameter(param);
    param = new OpenHome::Net::ParameterBool("ValueBool");
    iActionGetMultiple->AddOutputParameter(param);

    iActionSetString = new Action("SetString");
    param = new OpenHome::Net::ParameterString("ValueStr");
    iActionSetString->AddInputParameter(param);

    iActionGetString = new Action("GetString");
    param = new OpenHome::Net::ParameterString("ValueStr");
    iActionGetString->AddOutputParameter(param);

    iActionSetBinary = new Action("SetBinary");
    param = new OpenHome::Net::ParameterBinary("ValueBin");
    iActionSetBinary->AddInputParameter(param);

    iActionGetBinary = new Action("GetBinary");
    param = new OpenHome::Net::ParameterBinary("ValueBin");
    iActionGetBinary->AddOutputParameter(param);

    iActionToggleBool = new Action("ToggleBool");

    iActionWriteFile = new Action("WriteFile");
    param = new OpenHome::Net::ParameterString("Data");
    iActionWriteFile->AddInputParameter(param);
    param = new OpenHome::Net::ParameterString("FileFullName");
    iActionWriteFile->AddInputParameter(param);

    iActionShutdown = new Action("Shutdown");

    Functor functor;
    functor = MakeFunctor(*this, &CpProxyOpenhomeOrgTestBasic1Cpp::VarUintPropertyChanged);
    iVarUint = new PropertyUint("VarUint", functor);
    AddProperty(iVarUint);
    functor = MakeFunctor(*this, &CpProxyOpenhomeOrgTestBasic1Cpp::VarIntPropertyChanged);
    iVarInt = new PropertyInt("VarInt", functor);
    AddProperty(iVarInt);
    functor = MakeFunctor(*this, &CpProxyOpenhomeOrgTestBasic1Cpp::VarBoolPropertyChanged);
    iVarBool = new PropertyBool("VarBool", functor);
    AddProperty(iVarBool);
    functor = MakeFunctor(*this, &CpProxyOpenhomeOrgTestBasic1Cpp::VarStrPropertyChanged);
    iVarStr = new PropertyString("VarStr", functor);
    AddProperty(iVarStr);
    functor = MakeFunctor(*this, &CpProxyOpenhomeOrgTestBasic1Cpp::VarBinPropertyChanged);
    iVarBin = new PropertyBinary("VarBin", functor);
    AddProperty(iVarBin);
}

CpProxyOpenhomeOrgTestBasic1Cpp::~CpProxyOpenhomeOrgTestBasic1Cpp()
{
    DestroyService();
    delete iActionIncrement;
    delete iActionEchoAllowedRangeUint;
    delete iActionDecrement;
    delete iActionToggle;
    delete iActionEchoString;
    delete iActionEchoAllowedValueString;
    delete iActionEchoBinary;
    delete iActionSetUint;
    delete iActionGetUint;
    delete iActionSetInt;
    delete iActionGetInt;
    delete iActionSetBool;
    delete iActionGetBool;
    delete iActionSetMultiple;
    delete iActionGetMultiple;
    delete iActionSetString;
    delete iActionGetString;
    delete iActionSetBinary;
    delete iActionGetBinary;
    delete iActionToggleBool;
    delete iActionWriteFile;
    delete iActionShutdown;
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncIncrement(uint32_t aValue, uint32_t& aResult)
{
    SyncIncrementOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginIncrement(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginIncrement(uint32_t aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionIncrement, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionIncrement->InputParameters();
    invocation->AddInput(new ArgumentUint(*inParams[inIndex++], aValue));
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionIncrement->OutputParameters();
    invocation->AddOutput(new ArgumentUint(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndIncrement(IAsync& aAsync, uint32_t& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("Increment"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aResult = ((ArgumentUint*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncEchoAllowedRangeUint(uint32_t aValue, uint32_t& aResult)
{
    SyncEchoAllowedRangeUintOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginEchoAllowedRangeUint(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginEchoAllowedRangeUint(uint32_t aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionEchoAllowedRangeUint, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionEchoAllowedRangeUint->InputParameters();
    invocation->AddInput(new ArgumentUint(*inParams[inIndex++], aValue));
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionEchoAllowedRangeUint->OutputParameters();
    invocation->AddOutput(new ArgumentUint(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndEchoAllowedRangeUint(IAsync& aAsync, uint32_t& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("EchoAllowedRangeUint"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aResult = ((ArgumentUint*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncDecrement(int32_t aValue, int32_t& aResult)
{
    SyncDecrementOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginDecrement(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginDecrement(int32_t aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionDecrement, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionDecrement->InputParameters();
    invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aValue));
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionDecrement->OutputParameters();
    invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndDecrement(IAsync& aAsync, int32_t& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("Decrement"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aResult = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncToggle(bool aValue, bool& aResult)
{
    SyncToggleOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginToggle(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginToggle(bool aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionToggle, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionToggle->InputParameters();
    invocation->AddInput(new ArgumentBool(*inParams[inIndex++], aValue));
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionToggle->OutputParameters();
    invocation->AddOutput(new ArgumentBool(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndToggle(IAsync& aAsync, bool& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("Toggle"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aResult = ((ArgumentBool*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncEchoString(const std::string& aValue, std::string& aResult)
{
    SyncEchoStringOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginEchoString(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginEchoString(const std::string& aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionEchoString, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionEchoString->InputParameters();
    {
        Brn buf((const TByte*)aValue.c_str(), (TUint)aValue.length());
        invocation->AddInput(new ArgumentString(*inParams[inIndex++], buf));
    }
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionEchoString->OutputParameters();
    invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndEchoString(IAsync& aAsync, std::string& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("EchoString"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    {
        const Brx& val = ((ArgumentString*)invocation.OutputArguments()[index++])->Value();
        aResult.assign((const char*)val.Ptr(), val.Bytes());
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncEchoAllowedValueString(const std::string& aValue, std::string& aResult)
{
    SyncEchoAllowedValueStringOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginEchoAllowedValueString(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginEchoAllowedValueString(const std::string& aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionEchoAllowedValueString, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionEchoAllowedValueString->InputParameters();
    {
        Brn buf((const TByte*)aValue.c_str(), (TUint)aValue.length());
        invocation->AddInput(new ArgumentString(*inParams[inIndex++], buf));
    }
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionEchoAllowedValueString->OutputParameters();
    invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndEchoAllowedValueString(IAsync& aAsync, std::string& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("EchoAllowedValueString"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    {
        const Brx& val = ((ArgumentString*)invocation.OutputArguments()[index++])->Value();
        aResult.assign((const char*)val.Ptr(), val.Bytes());
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncEchoBinary(const std::string& aValue, std::string& aResult)
{
    SyncEchoBinaryOpenhomeOrgTestBasic1Cpp sync(*this, aResult);
    BeginEchoBinary(aValue, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginEchoBinary(const std::string& aValue, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionEchoBinary, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionEchoBinary->InputParameters();
    {
        Brn buf((const TByte*)aValue.c_str(), (TUint)aValue.length());
        invocation->AddInput(new ArgumentBinary(*inParams[inIndex++], buf));
    }
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionEchoBinary->OutputParameters();
    invocation->AddOutput(new ArgumentBinary(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndEchoBinary(IAsync& aAsync, std::string& aResult)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("EchoBinary"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    {
        const Brx& val = ((ArgumentString*)invocation.OutputArguments()[index++])->Value();
        aResult.assign((const char*)val.Ptr(), val.Bytes());
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetUint(uint32_t aValueUint)
{
    SyncSetUintOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetUint(aValueUint, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetUint(uint32_t aValueUint, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetUint, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetUint->InputParameters();
    invocation->AddInput(new ArgumentUint(*inParams[inIndex++], aValueUint));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetUint(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetUint"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetUint(uint32_t& aValueUint)
{
    SyncGetUintOpenhomeOrgTestBasic1Cpp sync(*this, aValueUint);
    BeginGetUint(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetUint(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetUint, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetUint->OutputParameters();
    invocation->AddOutput(new ArgumentUint(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetUint(IAsync& aAsync, uint32_t& aValueUint)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetUint"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aValueUint = ((ArgumentUint*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetInt(int32_t aValueInt)
{
    SyncSetIntOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetInt(aValueInt, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetInt(int32_t aValueInt, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetInt, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetInt->InputParameters();
    invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aValueInt));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetInt(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetInt"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetInt(int32_t& aValueInt)
{
    SyncGetIntOpenhomeOrgTestBasic1Cpp sync(*this, aValueInt);
    BeginGetInt(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetInt(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetInt, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetInt->OutputParameters();
    invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetInt(IAsync& aAsync, int32_t& aValueInt)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetInt"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aValueInt = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetBool(bool aValueBool)
{
    SyncSetBoolOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetBool(aValueBool, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetBool(bool aValueBool, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetBool, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetBool->InputParameters();
    invocation->AddInput(new ArgumentBool(*inParams[inIndex++], aValueBool));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetBool(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetBool"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetBool(bool& aValueBool)
{
    SyncGetBoolOpenhomeOrgTestBasic1Cpp sync(*this, aValueBool);
    BeginGetBool(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetBool(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetBool, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetBool->OutputParameters();
    invocation->AddOutput(new ArgumentBool(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetBool(IAsync& aAsync, bool& aValueBool)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetBool"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aValueBool = ((ArgumentBool*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetMultiple(uint32_t aValueUint, int32_t aValueInt, bool aValueBool)
{
    SyncSetMultipleOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetMultiple(aValueUint, aValueInt, aValueBool, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetMultiple(uint32_t aValueUint, int32_t aValueInt, bool aValueBool, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetMultiple, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetMultiple->InputParameters();
    invocation->AddInput(new ArgumentUint(*inParams[inIndex++], aValueUint));
    invocation->AddInput(new ArgumentInt(*inParams[inIndex++], aValueInt));
    invocation->AddInput(new ArgumentBool(*inParams[inIndex++], aValueBool));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetMultiple(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetMultiple"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetMultiple(uint32_t& aValueUint, int32_t& aValueInt, bool& aValueBool)
{
    SyncGetMultipleOpenhomeOrgTestBasic1Cpp sync(*this, aValueUint, aValueInt, aValueBool);
    BeginGetMultiple(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetMultiple(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetMultiple, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetMultiple->OutputParameters();
    invocation->AddOutput(new ArgumentUint(*outParams[outIndex++]));
    invocation->AddOutput(new ArgumentInt(*outParams[outIndex++]));
    invocation->AddOutput(new ArgumentBool(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetMultiple(IAsync& aAsync, uint32_t& aValueUint, int32_t& aValueInt, bool& aValueBool)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetMultiple"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    aValueUint = ((ArgumentUint*)invocation.OutputArguments()[index++])->Value();
    aValueInt = ((ArgumentInt*)invocation.OutputArguments()[index++])->Value();
    aValueBool = ((ArgumentBool*)invocation.OutputArguments()[index++])->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetString(const std::string& aValueStr)
{
    SyncSetStringOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetString(aValueStr, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetString(const std::string& aValueStr, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetString, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetString->InputParameters();
    {
        Brn buf((const TByte*)aValueStr.c_str(), (TUint)aValueStr.length());
        invocation->AddInput(new ArgumentString(*inParams[inIndex++], buf));
    }
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetString(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetString"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetString(std::string& aValueStr)
{
    SyncGetStringOpenhomeOrgTestBasic1Cpp sync(*this, aValueStr);
    BeginGetString(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetString(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetString, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetString->OutputParameters();
    invocation->AddOutput(new ArgumentString(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetString(IAsync& aAsync, std::string& aValueStr)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetString"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    {
        const Brx& val = ((ArgumentString*)invocation.OutputArguments()[index++])->Value();
        aValueStr.assign((const char*)val.Ptr(), val.Bytes());
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncSetBinary(const std::string& aValueBin)
{
    SyncSetBinaryOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginSetBinary(aValueBin, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginSetBinary(const std::string& aValueBin, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionSetBinary, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionSetBinary->InputParameters();
    {
        Brn buf((const TByte*)aValueBin.c_str(), (TUint)aValueBin.length());
        invocation->AddInput(new ArgumentBinary(*inParams[inIndex++], buf));
    }
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndSetBinary(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("SetBinary"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncGetBinary(std::string& aValueBin)
{
    SyncGetBinaryOpenhomeOrgTestBasic1Cpp sync(*this, aValueBin);
    BeginGetBinary(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginGetBinary(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionGetBinary, aFunctor);
    TUint outIndex = 0;
    const Action::VectorParameters& outParams = iActionGetBinary->OutputParameters();
    invocation->AddOutput(new ArgumentBinary(*outParams[outIndex++]));
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndGetBinary(IAsync& aAsync, std::string& aValueBin)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("GetBinary"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
    TUint index = 0;
    {
        const Brx& val = ((ArgumentString*)invocation.OutputArguments()[index++])->Value();
        aValueBin.assign((const char*)val.Ptr(), val.Bytes());
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncToggleBool()
{
    SyncToggleBoolOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginToggleBool(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginToggleBool(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionToggleBool, aFunctor);
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndToggleBool(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("ToggleBool"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncWriteFile(const std::string& aData, const std::string& aFileFullName)
{
    SyncWriteFileOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginWriteFile(aData, aFileFullName, sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginWriteFile(const std::string& aData, const std::string& aFileFullName, FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionWriteFile, aFunctor);
    TUint inIndex = 0;
    const Action::VectorParameters& inParams = iActionWriteFile->InputParameters();
    {
        Brn buf((const TByte*)aData.c_str(), (TUint)aData.length());
        invocation->AddInput(new ArgumentString(*inParams[inIndex++], buf));
    }
    {
        Brn buf((const TByte*)aFileFullName.c_str(), (TUint)aFileFullName.length());
        invocation->AddInput(new ArgumentString(*inParams[inIndex++], buf));
    }
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndWriteFile(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("WriteFile"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SyncShutdown()
{
    SyncShutdownOpenhomeOrgTestBasic1Cpp sync(*this);
    BeginShutdown(sync.Functor());
    sync.Wait();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::BeginShutdown(FunctorAsync& aFunctor)
{
    Invocation* invocation = iCpProxy.GetService().Invocation(*iActionShutdown, aFunctor);
    iCpProxy.GetInvocable().InvokeAction(*invocation);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::EndShutdown(IAsync& aAsync)
{
    ASSERT(((Async&)aAsync).Type() == Async::eInvocation);
    Invocation& invocation = (Invocation&)aAsync;
    ASSERT(invocation.Action().Name() == Brn("Shutdown"));

    Error::ELevel level;
    TUint code;
    const TChar* ignore;
    if (invocation.Error(level, code, ignore)) {
        THROW_PROXYERROR(level, code);
    }
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyVarUintChanged(Functor& aFunctor)
{
    iCpProxy.GetLock().Wait();
    iVarUintChanged = aFunctor;
    iCpProxy.GetLock().Signal();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyVarIntChanged(Functor& aFunctor)
{
    iCpProxy.GetLock().Wait();
    iVarIntChanged = aFunctor;
    iCpProxy.GetLock().Signal();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyVarBoolChanged(Functor& aFunctor)
{
    iCpProxy.GetLock().Wait();
    iVarBoolChanged = aFunctor;
    iCpProxy.GetLock().Signal();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyVarStrChanged(Functor& aFunctor)
{
    iCpProxy.GetLock().Wait();
    iVarStrChanged = aFunctor;
    iCpProxy.GetLock().Signal();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyVarBinChanged(Functor& aFunctor)
{
    iCpProxy.GetLock().Wait();
    iVarBinChanged = aFunctor;
    iCpProxy.GetLock().Signal();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::PropertyVarUint(uint32_t& aVarUint) const
{
    AutoMutex a(iCpProxy.PropertyReadLock());
    if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
        THROW(ProxyNotSubscribed);
    }
    aVarUint = iVarUint->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::PropertyVarInt(int32_t& aVarInt) const
{
    AutoMutex a(iCpProxy.PropertyReadLock());
    if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
        THROW(ProxyNotSubscribed);
    }
    aVarInt = iVarInt->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::PropertyVarBool(bool& aVarBool) const
{
    AutoMutex a(iCpProxy.PropertyReadLock());
    if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
        THROW(ProxyNotSubscribed);
    }
    aVarBool = iVarBool->Value();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::PropertyVarStr(std::string& aVarStr) const
{
    AutoMutex a(iCpProxy.PropertyReadLock());
    if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
        THROW(ProxyNotSubscribed);
    }
    const Brx& val = iVarStr->Value();
    aVarStr.assign((const char*)val.Ptr(), val.Bytes());
}

void CpProxyOpenhomeOrgTestBasic1Cpp::PropertyVarBin(std::string& aVarBin) const
{
    AutoMutex a(iCpProxy.PropertyReadLock());
    if (iCpProxy.GetSubscriptionStatus() != CpProxy::eSubscribed) {
        THROW(ProxyNotSubscribed);
    }
    const Brx& val = iVarBin->Value();
    aVarBin.assign((const char*)val.Ptr(), val.Bytes());
}

void CpProxyOpenhomeOrgTestBasic1Cpp::VarUintPropertyChanged()
{
    ReportEvent(iVarUintChanged);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::VarIntPropertyChanged()
{
    ReportEvent(iVarIntChanged);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::VarBoolPropertyChanged()
{
    ReportEvent(iVarBoolChanged);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::VarStrPropertyChanged()
{
    ReportEvent(iVarStrChanged);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::VarBinPropertyChanged()
{
    ReportEvent(iVarBinChanged);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::Subscribe()
{
  iCpProxy.Subscribe();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::Unsubscribe()
{
 iCpProxy.Unsubscribe();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyChanged(Functor& aFunctor)
{
  iCpProxy.SetPropertyChanged(aFunctor);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::SetPropertyInitialEvent(Functor& aFunctor)
{
  iCpProxy.SetPropertyInitialEvent(aFunctor);
}
void CpProxyOpenhomeOrgTestBasic1Cpp::AddProperty(Property* aProperty)
{
  iCpProxy.AddProperty(aProperty);
}

void CpProxyOpenhomeOrgTestBasic1Cpp::DestroyService()
{
  iCpProxy.DestroyService();
}

void CpProxyOpenhomeOrgTestBasic1Cpp::ReportEvent(Functor aFunctor)
{
  iCpProxy.ReportEvent(aFunctor);
}

TUint CpProxyOpenhomeOrgTestBasic1Cpp::Version() const
{
  return iCpProxy.Version();
}


text:
package zstd

import (
	"errors"
	"fmt"
	"runtime"
	"strings"
)

// EOption is an option for creating a encoder.
type EOption func(*encoderOptions) error

// options retains accumulated state of multiple options.
type encoderOptions struct {
	concurrent      int
	level           EncoderLevel
	single          *bool
	pad             int
	blockSize       int
	windowSize      int
	crc             bool
	fullZero        bool
	noEntropy       bool
	allLitEntropy   bool
	customWindow    bool
	customALEntropy bool
	lowMem          bool
	dict            *dict
}

func (o *encoderOptions) setDefault() {
	*o = encoderOptions{
		concurrent:    runtime.GOMAXPROCS(0),
		crc:           true,
		single:        nil,
		blockSize:     1 << 16,
		windowSize:    8 << 20,
		level:         SpeedDefault,
		allLitEntropy: true,
		lowMem:        false,
	}
}

// encoder returns an encoder with the selected options.
func (o encoderOptions) encoder() encoder {
	switch o.level {
	case SpeedFastest:
		if o.dict != nil {
			return &fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}}
		}
		return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}

	case SpeedDefault:
		if o.dict != nil {
			return &doubleFastEncoderDict{fastEncoderDict: fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}}}
		}
		return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}}
	case SpeedBetterCompression:
		if o.dict != nil {
			return &betterFastEncoderDict{betterFastEncoder: betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}}
		}
		return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}
	case SpeedBestCompression:
		return &bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), lowMem: o.lowMem}}
	}
	panic("unknown compression level")
}

// WithEncoderCRC will add CRC value to output.
// Output will be 4 bytes larger.
func WithEncoderCRC(b bool) EOption {
	return func(o *encoderOptions) error { o.crc = b; return nil }
}

// WithEncoderConcurrency will set the concurrency,
// meaning the maximum number of encoders to run concurrently.
// The value supplied must be at least 1.
// By default this will be set to GOMAXPROCS.
func WithEncoderConcurrency(n int) EOption {
	return func(o *encoderOptions) error {
		if n <= 0 {
			return fmt.Errorf("concurrency must be at least 1")
		}
		o.concurrent = n
		return nil
	}
}

// WithWindowSize will set the maximum allowed back-reference distance.
// The value must be a power of two between MinWindowSize and MaxWindowSize.
// A larger value will enable better compression but allocate more memory and,
// for above-default values, take considerably longer.
// The default value is determined by the compression level.
func WithWindowSize(n int) EOption {
	return func(o *encoderOptions) error {
		switch {
		case n < MinWindowSize:
			return fmt.Errorf("window size must be at least %d", MinWindowSize)
		case n > MaxWindowSize:
			return fmt.Errorf("window size must be at most %d", MaxWindowSize)
		case (n & (n - 1)) != 0:
			return errors.New("window size must be a power of 2")
		}

		o.windowSize = n
		o.customWindow = true
		if o.blockSize > o.windowSize {
			o.blockSize = o.windowSize
		}
		return nil
	}
}

// WithEncoderPadding will add padding to all output so the size will be a multiple of n.
// This can be used to obfuscate the exact output size or make blocks of a certain size.
// The contents will be a skippable frame, so it will be invisible by the decoder.
// n must be > 0 and <= 1GB, 1<<30 bytes.
// The padded area will be filled with data from crypto/rand.Reader.
// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this.
func WithEncoderPadding(n int) EOption {
	return func(o *encoderOptions) error {
		if n <= 0 {
			return fmt.Errorf("padding must be at least 1")
		}
		// No need to waste our time.
		if n == 1 {
			o.pad = 0
		}
		if n > 1<<30 {
			return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
		}
		o.pad = n
		return nil
	}
}

// EncoderLevel predefines encoder compression levels.
// Only use the constants made available, since the actual mapping
// of these values are very likely to change and your compression could change
// unpredictably when upgrading the library.
type EncoderLevel int

const (
	speedNotSet EncoderLevel = iota

	// SpeedFastest will choose the fastest reasonable compression.
	// This is roughly equivalent to the fastest Zstandard mode.
	SpeedFastest

	// SpeedDefault is the default "pretty fast" compression option.
	// This is roughly equivalent to the default Zstandard mode (level 3).
	SpeedDefault

	// SpeedBetterCompression will yield better compression than the default.
	// Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage.
	// By using this, notice that CPU usage may go up in the future.
	SpeedBetterCompression

	// SpeedBestCompression will choose the best available compression option.
	// This will offer the best compression no matter the CPU cost.
	SpeedBestCompression

	// speedLast should be kept as the last actual compression option.
	// The is not for external usage, but is used to keep track of the valid options.
	speedLast
)

// EncoderLevelFromString will convert a string representation of an encoding level back
// to a compression level. The compare is not case sensitive.
// If the string wasn't recognized, (false, SpeedDefault) will be returned.
func EncoderLevelFromString(s string) (bool, EncoderLevel) {
	for l := speedNotSet + 1; l < speedLast; l++ {
		if strings.EqualFold(s, l.String()) {
			return true, l
		}
	}
	return false, SpeedDefault
}

// EncoderLevelFromZstd will return an encoder level that closest matches the compression
// ratio of a specific zstd compression level.
// Many input values will provide the same compression level.
func EncoderLevelFromZstd(level int) EncoderLevel {
	switch {
	case level < 3:
		return SpeedFastest
	case level >= 3 && level < 6:
		return SpeedDefault
	case level >= 6 && level < 10:
		return SpeedBetterCompression
	case level >= 10:
		return SpeedBestCompression
	}
	return SpeedDefault
}

// String provides a string representation of the compression level.
func (e EncoderLevel) String() string {
	switch e {
	case SpeedFastest:
		return "fastest"
	case SpeedDefault:
		return "default"
	case SpeedBetterCompression:
		return "better"
	case SpeedBestCompression:
		return "best"
	default:
		return "invalid"
	}
}

// WithEncoderLevel specifies a predefined compression level.
func WithEncoderLevel(l EncoderLevel) EOption {
	return func(o *encoderOptions) error {
		switch {
		case l <= speedNotSet || l >= speedLast:
			return fmt.Errorf("unknown encoder level")
		}
		o.level = l
		if !o.customWindow {
			switch o.level {
			case SpeedFastest:
				o.windowSize = 4 << 20
			case SpeedDefault:
				o.windowSize = 8 << 20
			case SpeedBetterCompression:
				o.windowSize = 16 << 20
			case SpeedBestCompression:
				o.windowSize = 32 << 20
			}
		}
		if !o.customALEntropy {
			o.allLitEntropy = l > SpeedFastest
		}

		return nil
	}
}

// WithZeroFrames will encode 0 length input as full frames.
// This can be needed for compatibility with zstandard usage,
// but is not needed for this package.
func WithZeroFrames(b bool) EOption {
	return func(o *encoderOptions) error {
		o.fullZero = b
		return nil
	}
}

// WithAllLitEntropyCompression will apply entropy compression if no matches are found.
// Disabling this will skip incompressible data faster, but in cases with no matches but
// skewed character distribution compression is lost.
// Default value depends on the compression level selected.
func WithAllLitEntropyCompression(b bool) EOption {
	return func(o *encoderOptions) error {
		o.customALEntropy = true
		o.allLitEntropy = b
		return nil
	}
}

// WithNoEntropyCompression will always skip entropy compression of literals.
// This can be useful if content has matches, but unlikely to benefit from entropy
// compression. Usually the slight speed improvement is not worth enabling this.
func WithNoEntropyCompression(b bool) EOption {
	return func(o *encoderOptions) error {
		o.noEntropy = b
		return nil
	}
}

// WithSingleSegment will set the "single segment" flag when EncodeAll is used.
// If this flag is set, data must be regenerated within a single continuous memory segment.
// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present.
// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content.
// In order to preserve the decoder from unreasonable memory requirements,
// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range.
// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB.
// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations.
// If this is not specified, block encodes will automatically choose this based on the input size.
// This setting has no effect on streamed encodes.
func WithSingleSegment(b bool) EOption {
	return func(o *encoderOptions) error {
		o.single = &b
		return nil
	}
}

// WithLowerEncoderMem will trade in some memory cases trade less memory usage for
// slower encoding speed.
// This will not change the window size which is the primary function for reducing
// memory usage. See WithWindowSize.
func WithLowerEncoderMem(b bool) EOption {
	return func(o *encoderOptions) error {
		o.lowMem = b
		return nil
	}
}

// WithEncoderDict allows to register a dictionary that will be used for the encode.
// The encoder *may* choose to use no dictionary instead for certain payloads.
func WithEncoderDict(dict []byte) EOption {
	return func(o *encoderOptions) error {
		d, err := loadDict(dict)
		if err != nil {
			return err
		}
		o.dict = d
		return nil
	}
}