Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Commit d3f70ee9 authored by schultezub's avatar schultezub
Browse files

Replaced EventList by generic ItemList and used it also as GLTextureList

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@248 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 6fc7338d
......@@ -85,15 +85,15 @@ namespace kisscl {
LCL_ERROR(clFinish(_id));
}
Event CommandQueue::enqueueTask(const Kernel* kernel, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueTask(const Kernel* kernel, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
tgtAssert(kernel != 0, "Kernel must not be 0.");
cl_event e;
LCL_ERROR(clEnqueueTask(_id, kernel->getId(), eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueTask(_id, kernel->getId(), eventsToWaitFor._size, eventsToWaitFor._items, &e));
return Event(e);
}
Event CommandQueue::enqueueKernel(const Kernel* kernel, size_t globalWorkSize, size_t localWorkSize /*= 0*/, size_t offset /*= 0*/, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueKernel(const Kernel* kernel, size_t globalWorkSize, size_t localWorkSize /*= 0*/, size_t offset /*= 0*/, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
tgtAssert(kernel != 0, "Kernel must not be 0.");
tgtAssert(localWorkSize == 0 || localWorkSize < globalWorkSize, "Global work size must be greater than local work size.");
tgtAssert(localWorkSize == 0 || (globalWorkSize % localWorkSize == 0), "Global work size must be a multiple than local work size.");
......@@ -107,12 +107,12 @@ namespace kisscl {
&globalWorkSize,
(localWorkSize == 0 ? 0 : &localWorkSize),
eventsToWaitFor._size,
eventsToWaitFor._events,
eventsToWaitFor._items,
&e));
return Event(e);
}
Event CommandQueue::enqueueKernel(const Kernel* kernel, tgt::svec2 globalWorkSize, tgt::svec2 localWorkSize /*= tgt::svec2::zero*/, tgt::svec2 offset /*= tgt::svec2::zero*/, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueKernel(const Kernel* kernel, tgt::svec2 globalWorkSize, tgt::svec2 localWorkSize /*= tgt::svec2::zero*/, tgt::svec2 offset /*= tgt::svec2::zero*/, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
tgtAssert(kernel != 0, "Kernel must not be 0.");
tgtAssert(localWorkSize == tgt::svec2::zero || tgt::hor(tgt::lessThan(localWorkSize, globalWorkSize)), "Global work size must be greater than local work size.");
tgtAssert(localWorkSize == tgt::svec2::zero || (globalWorkSize.x % localWorkSize.x == 0), "Global work size must be a multiple than local work size.");
......@@ -127,12 +127,12 @@ namespace kisscl {
globalWorkSize.elem,
(localWorkSize == tgt::svec2::zero ? 0 : localWorkSize.elem),
eventsToWaitFor._size,
eventsToWaitFor._events,
eventsToWaitFor._items,
&e));
return Event(e);
}
Event CommandQueue::enqueueKernel(const Kernel* kernel, tgt::svec3 globalWorkSize, tgt::svec3 localWorkSize /*= tgt::svec3::zero*/, tgt::svec3 offset /*= tgt::svec3::zero*/, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueKernel(const Kernel* kernel, tgt::svec3 globalWorkSize, tgt::svec3 localWorkSize /*= tgt::svec3::zero*/, tgt::svec3 offset /*= tgt::svec3::zero*/, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
tgtAssert(kernel != 0, "Kernel must not be 0.");
tgtAssert(localWorkSize == tgt::svec3::zero || tgt::hor(tgt::lessThan (localWorkSize, globalWorkSize)), "Global work size must be greater than local work size.");
tgtAssert(localWorkSize == tgt::svec3::zero || (globalWorkSize.x % localWorkSize.x == 0), "Global work size must be a multiple than local work size.");
......@@ -148,7 +148,7 @@ namespace kisscl {
globalWorkSize.elem,
(localWorkSize == tgt::svec3::zero ? 0 : localWorkSize.elem),
eventsToWaitFor._size,
eventsToWaitFor._events,
eventsToWaitFor._items,
&e));
return Event(e);
}
......@@ -163,43 +163,41 @@ namespace kisscl {
return Event(e);
}
void CommandQueue::enqueueWaitForEvents(const EventList& eventsToWaitFor /*= EventList()*/) {
LCL_ERROR(clEnqueueWaitForEvents(_id, eventsToWaitFor._size, eventsToWaitFor._events));
void CommandQueue::enqueueWaitForEvents(const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
LCL_ERROR(clEnqueueWaitForEvents(_id, eventsToWaitFor._size, eventsToWaitFor._items));
}
Event CommandQueue::enqueueRead(const Buffer* buffer, void* data, bool blocking /*= true*/, size_t offset /*= 0*/, size_t numBytes /*= 0*/, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueRead(const Buffer* buffer, void* data, bool blocking /*= true*/, size_t offset /*= 0*/, size_t numBytes /*= 0*/, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
cl_event e;
if (numBytes == 0) {
LCL_ERROR(clEnqueueReadBuffer(_id, buffer->getId(), blocking, offset, buffer->getSize(), data, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueReadBuffer(_id, buffer->getId(), blocking, offset, buffer->getSize(), data, eventsToWaitFor._size, eventsToWaitFor._items, &e));
}
else {
LCL_ERROR(clEnqueueReadBuffer(_id, buffer->getId(), blocking, offset, numBytes, data, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueReadBuffer(_id, buffer->getId(), blocking, offset, numBytes, data, eventsToWaitFor._size, eventsToWaitFor._items, &e));
}
return Event(e);
}
Event CommandQueue::enqueueWrite(const Buffer* buffer, void* data, bool blocking /*= true*/, size_t offset /*= 0*/, size_t numBytes /*= 0*/, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueWrite(const Buffer* buffer, void* data, bool blocking /*= true*/, size_t offset /*= 0*/, size_t numBytes /*= 0*/, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
cl_event e;
if (numBytes == 0) {
LCL_ERROR(clEnqueueWriteBuffer(_id, buffer->getId(), blocking, offset, buffer->getSize(), data, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueWriteBuffer(_id, buffer->getId(), blocking, offset, buffer->getSize(), data, eventsToWaitFor._size, eventsToWaitFor._items, &e));
}
else {
LCL_ERROR(clEnqueueWriteBuffer(_id, buffer->getId(), blocking, offset, numBytes, data, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueWriteBuffer(_id, buffer->getId(), blocking, offset, numBytes, data, eventsToWaitFor._size, eventsToWaitFor._items, &e));
}
return Event(e);
}
Event CommandQueue::enqueueAcquireGLObject(const GLTexture* texture, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueAcquireGLObject(const ItemList<GLTexture>& textures, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
cl_event e;
cl_mem mem = texture->getId();
LCL_ERROR(clEnqueueAcquireGLObjects(_id, 1, &mem, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueAcquireGLObjects(_id, textures._size, textures._items, eventsToWaitFor._size, eventsToWaitFor._items, &e));
return Event(e);
}
Event CommandQueue::enqueueReleaseGLObject(const GLTexture* texture, const EventList& eventsToWaitFor /*= EventList()*/) {
Event CommandQueue::enqueueReleaseGLObject(const ItemList<GLTexture>& textures, const ItemList<Event>& eventsToWaitFor /*= ItemList<Event>()*/) {
cl_event e;
cl_mem mem = texture->getId();
LCL_ERROR(clEnqueueReleaseGLObjects(_id, 1, &mem, eventsToWaitFor._size, eventsToWaitFor._events, &e));
LCL_ERROR(clEnqueueReleaseGLObjects(_id, textures._size, textures._items, eventsToWaitFor._size, eventsToWaitFor._items, &e));
return Event(e);
}
......
......@@ -22,6 +22,7 @@
#include "tgt/vector.h"
#include "kisscl/kisscl.h"
#include "kisscl/itemlist.h"
#include "kisscl/event.h"
#include <vector>
......@@ -33,7 +34,10 @@ namespace kisscl {
class Device;
class Kernel;
class GLTexture;
typedef ItemList<Event> EventList;
typedef ItemList<GLTexture> GLTextureList;
/**
* Wrapper class for an OpenCL command queue.
*
......@@ -95,7 +99,7 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueTask(const Kernel* kernel, const EventList& eventsToWaitFor = EventList());
Event enqueueTask(const Kernel* kernel, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
* Enqueues an one-dimensional OpenCL kernel to this command queue.
......@@ -106,7 +110,7 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueKernel(const Kernel* kernel, size_t globalWorkSize, size_t localWorkSize = 0, size_t offset = 0, const EventList& eventsToWaitFor = EventList());
Event enqueueKernel(const Kernel* kernel, size_t globalWorkSize, size_t localWorkSize = 0, size_t offset = 0, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
* Enqueues a two-dimensional OpenCL kernel to this command queue.
......@@ -117,7 +121,7 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueKernel(const Kernel* kernel, tgt::svec2 globalWorkSize, tgt::svec2 localWorkSize = tgt::svec2::zero, tgt::svec2 offset = tgt::svec2::zero, const EventList& eventsToWaitFor = EventList());
Event enqueueKernel(const Kernel* kernel, tgt::svec2 globalWorkSize, tgt::svec2 localWorkSize = tgt::svec2::zero, tgt::svec2 offset = tgt::svec2::zero, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
* Enqueues a three-dimensional OpenCL kernel to this command queue.
......@@ -128,7 +132,7 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueKernel(const Kernel* kernel, tgt::svec3 globalWorkSize, tgt::svec3 localWorkSize = tgt::svec3::zero, tgt::svec3 offset = tgt::svec3::zero, const EventList& eventsToWaitFor = EventList());
Event enqueueKernel(const Kernel* kernel, tgt::svec3 globalWorkSize, tgt::svec3 localWorkSize = tgt::svec3::zero, tgt::svec3 offset = tgt::svec3::zero, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
......@@ -154,7 +158,7 @@ namespace kisscl {
* \todo This method is deprecated in OpenCL 1.2
* \param eventsToWaitFor List of Events to wait for, default is empty.
*/
void enqueueWaitForEvents(const EventList& eventsToWaitFor = EventList());
void enqueueWaitForEvents(const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
......@@ -167,7 +171,7 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueRead(const Buffer* buffer, void* data, bool blocking = true, size_t offset = 0, size_t numBytes = 0, const EventList& eventsToWaitFor = EventList());
Event enqueueRead(const Buffer* buffer, void* data, bool blocking = true, size_t offset = 0, size_t numBytes = 0, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
/**
* Enqueues to write into a buffer object from host memory.
......@@ -179,13 +183,13 @@ namespace kisscl {
* \param eventsToWaitFor List of Events to wait for, default is empty.
* \return Event object that identifies this particular kernel execution instance.
*/
Event enqueueWrite(const Buffer* buffer, void* data, bool blocking = true, size_t offset = 0, size_t numBytes = 0, const EventList& eventsToWaitFor = EventList());
Event enqueueWrite(const Buffer* buffer, void* data, bool blocking = true, size_t offset = 0, size_t numBytes = 0, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
// TODO: buffers, images, etc.
Event enqueueAcquireGLObject(const GLTexture* texture, const EventList& eventsToWaitFor = EventList());
Event enqueueAcquireGLObject(const ItemList<GLTexture>& textures, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
Event enqueueReleaseGLObject(const GLTexture* texture, const EventList& eventsToWaitFor = EventList());
Event enqueueReleaseGLObject(const ItemList<GLTexture>& textures, const ItemList<Event>& eventsToWaitFor = ItemList<Event>());
private:
......
......@@ -31,28 +31,4 @@ namespace kisscl {
{
}
EventList::EventList() {
_events = 0;
_size = 0;
}
EventList::EventList(const Event& e1) {
_size = 1;
_events = new cl_event[_size];
_events[0] = e1.getId();
}
EventList::EventList(const Event& e1, const Event& e2) {
_size = 2;
_events = new cl_event[_size];
_events[0] = e1.getId();
_events[1] = e2.getId();
}
EventList::~EventList() {
}
}
......@@ -39,19 +39,6 @@ namespace kisscl {
};
// = EventList starts here ========================================================================
struct EventList {
EventList();
EventList(const Event& e1);
EventList(const Event& e1, const Event& e2);
~EventList();
cl_event* _events;
size_t _size;
};
}
#endif // KISSCL_EVENT_H__
// ================================================================================================
//
// This file is part of the KissCL, an OpenCL C++ wrapper following the KISS principle.
//
// Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge (software@cszb.net)
//
// This library is free software; you can redistribute it and/or modify it under the terms of the
// GNU Lesser General Public License version 3 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License in the file
// "LICENSE.txt" along with this library. If not, see <http://www.gnu.org/licenses/>.
//
// ================================================================================================
#ifndef KISSCL_ITEMLIST_H__
#define KISSCL_ITEMLIST_H__
namespace kisscl {
/**
* Wraps around the ids of a fixed list of OpenCL items.
*/
template <typename T>
struct ItemList {
typedef typename T::cl_type ItemType; ///< Typedef for the OpenCL id type of the item.
/// Creates an empty ItemList
explicit ItemList();
/**
* Creates an ItemList containing 1 items.
* \param i1 Item 1
*/
explicit ItemList(const T& i1);
/**
* Creates an ItemList containing 2 items.
* \param i1 Item 1
* \param i2 Item 2
*/
explicit ItemList(const T& i1, const T& i2);
/**
* Creates an ItemList containing 3 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
*/
explicit ItemList(const T& i1, const T& i2, const T& i3);
/**
* Creates an ItemList containing 4 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4);
/**
* Creates an ItemList containing 5 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5);
/**
* Creates an ItemList containing 6 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
* \param i6 Item 6
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6);
/**
* Creates an ItemList containing 7 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
* \param i6 Item 6
* \param i7 Item 7
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7);
/**
* Creates an ItemList containing 8 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
* \param i6 Item 6
* \param i7 Item 7
* \param i8 Item 8
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8);
/**
* Creates an ItemList containing 9 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
* \param i6 Item 6
* \param i7 Item 7
* \param i8 Item 8
* \param i9 Item 9
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8, const T& i9);
/**
* Creates an ItemList containing 10 items.
* \param i1 Item 1
* \param i2 Item 2
* \param i3 Item 3
* \param i4 Item 4
* \param i5 Item 5
* \param i6 Item 6
* \param i7 Item 7
* \param i8 Item 8
* \param i9 Item 9
* \param i10 Item 10
*/
explicit ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8, const T& i9, const T& i10);
/// Destructor
~ItemList();
size_t _size; ///< Number of items in this list.
ItemType* _items; ///< Pointer to the Ids if the items.
};
// ================================================================================================
template <typename T>
kisscl::ItemList<T>::ItemList()
: _size(0)
, _items(0)
{
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1)
: _size(1)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2)
: _size(2)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3)
: _size(3)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4)
: _size(4)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5)
: _size(5)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6)
: _size(6)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
_items[5] = i6.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7)
: _size(7)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
_items[5] = i6.getId();
_items[6] = i7.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8)
: _size(8)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
_items[5] = i6.getId();
_items[6] = i7.getId();
_items[7] = i8.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8, const T& i9)
: _size(9)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
_items[5] = i6.getId();
_items[6] = i7.getId();
_items[7] = i8.getId();
_items[8] = i9.getId();
}
template <typename T>
kisscl::ItemList<T>::ItemList(const T& i1, const T& i2, const T& i3, const T& i4, const T& i5, const T& i6, const T& i7, const T& i8, const T& i9, const T& i10)
: _size(10)
, _items(0)
{
_items = new ItemType[_size];
_items[0] = i1.getId();
_items[1] = i2.getId();
_items[2] = i3.getId();
_items[3] = i4.getId();
_items[4] = i5.getId();
_items[5] = i6.getId();
_items[6] = i7.getId();
_items[7] = i8.getId();
_items[8] = i9.getId();
_items[9] = i10.getId();
}
template <typename T>
kisscl::ItemList<T>::~ItemList() {
delete _items;
}
}
#endif // KISSCL_ITEMLIST_H__
# Just a really simple script to automatically create the setArgument templates...
import string
def argList(numArgs):
toReturn = 'const T& i1'
for i in range(2, numArgs+1):
toReturn += ', const T& i' + str(i)
return toReturn;
def createTemplateDef(numArgs):
toReturn = """/**
* Wraps around the ids of a fixed list of OpenCL items.
*/
template <typename T>
struct ItemList {
typedef typename T::cl_type ItemType; ///< Typedef for the OpenCL id type of the item.
/// Creates an empty ItemList
explicit ItemList();
"""
for j in range(1, numArgs+1):
toReturn += ' /**\n * Creates an ItemList containing ' + str(j) + ' items.\n'
for i in range(1, j+1):
toReturn += ' * \\param i' + str(i) + ' Item ' + str(i) + '\n'
toReturn += ' */\n'
toReturn += ' explicit ItemList(' + argList(j) + ');\n\n'
toReturn += """ /// Destructor
~ItemList();
size_t _size; ///< Number of items in this list.
ItemType* _items; ///< Pointer to the Ids if the items.
};"""