2#include <tdeapplication.h>
3#include <tdeaboutdata.h>
4#include <tdecmdlineargs.h>
18class TestSubResource :
public TestResource
21 TestSubResource() : TestResource() {}
25 kdDebug() <<
"TestSubResource" << endl;
30int main(
int argc,
char **argv )
32 TDEAboutData aboutData(
"testresources",
"Kresource Test",
"0" );
33 TDECmdLineArgs::init( argc, argv, &aboutData );
39 TestResource *resource1 =
new TestResource;
40 resource1->setResourceName(
"One" );
41 manager.add( resource1 );
43 TestResource *resource2 =
new TestSubResource;
44 resource2->setResourceName(
"Two" );
45 manager.add( resource2 );
47 TestResource *resource3 =
new TestSubResource;
48 resource3->setResourceName(
"Three" );
49 manager.add( resource3 );
51 kdDebug() <<
"LIST ALL:" << endl;
53 for( it = manager.begin(); it != manager.end(); ++it ) {
57 resource2->setActive(
false );
58 resource3->setActive(
true );
60 kdDebug() <<
"LIST ACTIVE" << endl;
62 for( it2 = manager.activeBegin(); it2 != manager.activeEnd(); ++it2 ) {
66 resource1->setActive(
false );
67 resource2->setActive(
true );
68 resource3->setActive(
true );
70 kdDebug() <<
"LIST ACTIVE" << endl;
71 for( it2 = manager.activeBegin(); it2 != manager.activeEnd(); ++it2 ) {
75 kdDebug() <<
"LIST ALL" << endl;
76 for( it = manager.begin(); it != manager.end(); ++it ) {
Iterator for iterations over only active resources managed by a manager.
Iterator for iterations over all resources managed by a manager.
This class provides a manager for resources of a specified family.
This class provides a resource which is managed in a general way.
virtual void dump() const
Print resource information as debug output.