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

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
#include "PStlCheck.h"
PStlCheck::PStlCheck()
{
}
PStlCheck::~PStlCheck()
{
fPpo.clear();
}

View File

@@ -0,0 +1,17 @@
#ifndef _PSTLCHECK_H_
#define _PSTLCHECK_H_
#include <list>
using namespace std;
#include "PPointObj.h"
class PStlCheck {
public:
PStlCheck();
~PStlCheck();
list<PPointObj> fPpo;
};
#endif // _PSTLCHECK_H_

View File

@@ -0,0 +1,28 @@
#include <iostream>
#include <list>
using namespace std;
#include "PStlCheck.h"
int main()
{
PStlCheck check;
unsigned int counter = 0;
for (unsigned int i=0; i<2; i++) {
check.fPpo.push_back(PPointObj(counter++));
cout << endl << "----------";
}
cout << endl << "size = " << check.fPpo.size();
cout << endl;
list<PPointObj>::iterator iter;
for (iter=check.fPpo.begin(); iter!=check.fPpo.end(); ++iter)
iter->PrintTest();
for (iter=check.fPpo.begin(); iter!=check.fPpo.end(); ++iter)
iter->CleanUp();
return 0;
}

View File

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