Alien-SmokeQt
view release on metacpan or search on metacpan
generator/parser/rpp/appendedlist.h view on Meta::CPAN
// #include <kdebug.h>
#include "../kdevvarlengtharray.h"
#include <iostream>
#include <time.h>
namespace KDevelop {
class AbstractItemRepository;
/**
* This file contains macros and classes that can be used to conveniently implement classes that store the data of an arbitrary count
* of additional lists within the same memory block directly behind the class data, in a way that one the whole data can be stored by one copy-operation
* to another place, like needed in ItemRepository. These macros simplify having two versions of a class: One that has its lists attached in memory,
* and one version that has them contained as a directly accessible KDevVarLengthArray. Both versions have their lists accessible through access-functions,
* have a completeSize() function that computes the size of the one-block version, and a copyListsFrom(..) function which can copy the lists from one
* version to the other.
*
* @warning Always follow these rules:
* You must call initalizeAppendedLists(bool) on construction, also in any copy-constructor, but before calling copyFrom(..).
* The parameter to that function should be whether the lists in the items should be dynamic, and thus most times "true".
* You must call freeAppendedLists() on destruction, our you will be leaking memory(only when dynamic)
*
* For each embedded list, you must use macros to define a global hash that will be used to allocate the temporary lists, example fir identifier.cpp:
( run in 1.285 second using v1.01-cache-2.11-cpan-e1769b4cff6 )