cdev-1.7.2n
This commit is contained in:
23
test/cdevCollection/remove3.cc
Executable file
23
test/cdevCollection/remove3.cc
Executable file
@@ -0,0 +1,23 @@
|
||||
#include <cdevCollection.h>
|
||||
|
||||
char * devices[] = {"device0", "device2"};
|
||||
|
||||
void main ( void )
|
||||
{
|
||||
/**************************************************************
|
||||
* Attach to a defined cdevCollection device and then remove
|
||||
* two cdevDevices from it.
|
||||
**************************************************************/
|
||||
cdevCollection & cDevice1 = cdevCollection::attachRef("cDevice1");
|
||||
cDevice1.remove(2, devices);
|
||||
|
||||
/**************************************************************
|
||||
* 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 = cDevice1.getList();
|
||||
for(char **s = list; *s!=NULL; s++) printf("%s\n", *s);
|
||||
delete list;
|
||||
}
|
||||
Reference in New Issue
Block a user