newly added. Not for productive used yetsvn diff | grep Index:

This commit is contained in:
nemu
2008-01-08 08:31:58 +00:00
commit c6cc508aaf
85 changed files with 14397 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include <iostream>
using namespace std;
#include "PPointObj.h"
#define PPO_SIZE 100
PPointObj::PPointObj(unsigned int counter) : fCounter(counter)
{
fTest = new int[PPO_SIZE];
for (unsigned int i=0; i<PPO_SIZE; i++)
fTest[i] = 2*PPO_SIZE*counter+i;
cout << endl << "in PPointObj() " << fCounter << ": fTest = " << fTest;
cout << endl;
}
PPointObj::~PPointObj()
{
if (fTest) {
delete [] fTest;
fTest = 0;
}
cout << endl << "in ~PPointObj() " << fCounter << ": fTest = " << fTest;
cout << endl;
}
void PPointObj::PrintTest()
{
cout << endl << fCounter << ": ";
for (unsigned int i=0; i<PPO_SIZE; i++)
cout << fTest[i] << ", ";
cout << endl;
}

View File

@@ -0,0 +1,16 @@
#ifndef _PPOINTOBJ_H_
#define _PPOINTOBJ_H_
class PPointObj {
public:
PPointObj(unsigned int counter);
~PPointObj();
void PrintTest();
private:
int fCounter;
int *fTest;
};
#endif // _PPOINTOBJ_H_

View File

@@ -0,0 +1,29 @@
#include "PStlCheck.h"
PStlCheck::PStlCheck()
{
}
PStlCheck::~PStlCheck()
{
fPpo.clear();
}
void PStlCheck::Add(unsigned int count)
{
fPpo.push_back(new PPointObj(count));
}
void PStlCheck::CleanUp()
{
for (unsigned int i=0; i<fPpo.size(); i++) {
fPpo[i]->~PPointObj();
}
}
void PStlCheck::PrintTest()
{
for (unsigned int i=0; i<fPpo.size(); i++)
fPpo[i]->PrintTest();
}

View File

@@ -0,0 +1,22 @@
#ifndef _PSTLCHECK_H_
#define _PSTLCHECK_H_
#include <vector>
using namespace std;
#include "PPointObj.h"
class PStlCheck {
public:
PStlCheck();
~PStlCheck();
void Add(unsigned int count);
void CleanUp();
void PrintTest();
private:
vector<PPointObj*> fPpo;
};
#endif // _PSTLCHECK_H_

View File

@@ -0,0 +1,21 @@
#include <iostream>
#include <vector>
using namespace std;
#include "PStlCheck.h"
int main()
{
PStlCheck check;
for (unsigned int i=0; i<2; i++) {
check.Add(i);
cout << endl << "----------";
}
check.PrintTest();
check.CleanUp();
return 0;
}

View File

@@ -0,0 +1,22 @@
#------------------------------------------------------
# stl_check_2.pro
# qmake file for stl_check_2
#
# Andreas Suter, 2007/05/14
#
# $Id$
#
#------------------------------------------------------
MAKEFILE = Makefile.stl_check_2
CONFIG += warn_on debug
HEADERS = PStlCheck.h \
PPointObj.h
SOURCES = stl_check_2.cpp \
PStlCheck.cpp \
PPointObj.cpp
TARGET=stl_check_2