Beispiel #1
0
static int _list_remove_name(QSP_ARG_DECL  Container *cnt_p, const char *name)
{
	Node *np;

	np = list_find_named_item(cnt_p->cnt_lp,name);
	if( np == NULL ) return -1;
	np = remNode(cnt_p->cnt_lp,np);
	assert( np != NULL );
	rls_node(np);
	return 0;
}
//Recursively Remove data from the Tree
void BinaryTree::rRemove(string s, TreeNode*& that) {

	//Error Handling
	if (that == NULL) return;

	//Base Case
	if (s == that->data) { remNode(that);			return; }
	if (s <= that->data) { rRemove(s, that->left);	return; }
	if (s >  that->data) { rRemove(s, that->rght);	return; }

	cout << "Recursive Delete has Failed" << endl;
	return;
}
Beispiel #3
0
int main(int argc, char const *argv[])
{

	ListaLigada* l = newListaLigada();
	char f = 'f';
	char c = 'c';
	Teste* n = (Teste*)malloc(sizeof(Teste));
	n->i=5;
	n->c='p';
	addNode(l, (void*)&f, sizeof(char));
	addNode(l, (void*)&c, sizeof(char));
	addNode(l, (void*)n, sizeof(Teste));
	//remNode(l, 1);
	remNode(l, 0);
	remNode(l, 0);
	//printListaLigada(l);
	Teste* f2 = (Teste*)getNodeByIndex(l, 0);
	printf("-----------------------------\n");
	printf("%i, %c", f2->i, f2->c);
	freeListaLigada(l);
	free(f2);
	free(n);
	return 0;
}
medBrowserPacsNodesToolBox::medBrowserPacsNodesToolBox(QWidget *parent) : medToolBox(parent), d(new medBrowserPacsNodesToolBoxPrivate)
{
    QWidget *page = new QWidget(this);

    QValidator* validator = new QIntValidator( 0, 65535, this );

    d->title = new QLineEdit("DCM4CHEE", page);
    d->address = new QLineEdit("jumbo-4.irisa.fr", page);
    d->port = new QLineEdit("10012", page);
    d->port->setValidator(validator);

    d->table = new QTableWidget(page);

    d->add = new QPushButton("Add"); d->add->setObjectName("left");
    d->ech = new QPushButton("Echo"); d->ech->setObjectName("center");
    d->rem = new QPushButton("Remove"); d->rem->setObjectName("right");

    QHBoxLayout *buttons_layout = new QHBoxLayout;
    buttons_layout->setSpacing(0);
    buttons_layout->addWidget(d->add);
    buttons_layout->addWidget(d->ech);
    buttons_layout->addWidget(d->rem);

    QFormLayout *form = new QFormLayout;
    form->addRow("Title", d->title);
    form->addRow("Address", d->address);
    form->addRow("Port", d->port);

    QVBoxLayout *layout = new QVBoxLayout(page);
    layout->addLayout(form);
    layout->addWidget(d->table);
    layout->addLayout(buttons_layout);

    this->setTitle("Remote Clients");
    this->addWidget(page);

    connect(d->add, SIGNAL(clicked()), this, SLOT(addNode()));
    connect(d->ech, SIGNAL(clicked()), this, SIGNAL(echoRequest()));
    connect(d->rem, SIGNAL(clicked()), this, SLOT(remNode()));

    this->readSettings();
}