22 lines
807 B
C++
Executable File
22 lines
807 B
C++
Executable File
#include <cdevCollection.h>
|
|
|
|
void main ( void )
|
|
{
|
|
/**************************************************************
|
|
* Attach to an undefined cdevCollection device and then add
|
|
* the cdevDevice "device0" to it.
|
|
**************************************************************/
|
|
cdevCollection & brandNew = cdevCollection::attachRef("brandNew");
|
|
brandNew.add("device0");
|
|
|
|
/**************************************************************
|
|
* Use the getList method to obtain the array of names that are
|
|
* currently stored in the cdevCollection and display them.
|
|
* Note that the list (not the list items) msut be deleted by
|
|
* the caller.
|
|
**************************************************************/
|
|
char ** list = brandNew.getList();
|
|
for(char **s = list; *s!=NULL; s++) printf("%s\n", *s);
|
|
delete list;
|
|
}
|