src/libYARP_OS/src/mesh.cpp
void MeshLink::SetSource ( MeshLink *link )
{
	if ( src != NULL )
	{
		//	Remove current source
		if ( src->asSrcRoot == this )	src->asSrcRoot = srcNext;
		if ( srcPrev != NULL )			srcPrev->srcNext = srcNext;
		if ( srcNext != NULL )			srcNext->srcPrev = srcPrev;
		srcPrev = srcNext = NULL;
		src = NULL;
	}
	if ( link != NULL )
	{
		//	Connect new source
		src = link;
		srcPrev = NULL;
		srcNext = link->asSrcRoot;
		if ( srcNext != NULL )	srcNext->srcPrev = this;
		link->asSrcRoot = this;
	}
}
/*-----------------------------------------------------------------------------
Function	SetSource
                                                                           
Description	Sets the source link for the object.

Input		link			The link to connect to.		

Returns		-
-----------------------------------------------------------------------------*/
Function        SetSource
Description     Sets the source link for the object.

Input           link                    The link to connect to.

Returns
Function SetSource Description Sets the source link for the object . Input link The link to connect to . Returns
void MeshLink::SetSource ( MeshLink *link )
{
	if ( src != NULL )
	{
		if ( src->asSrcRoot == this )	src->asSrcRoot = srcNext;
		if ( srcPrev != NULL )			srcPrev->srcNext = srcNext;
		if ( srcNext != NULL )			srcNext->srcPrev = srcPrev;
		srcPrev = srcNext = NULL;
		src = NULL;
	}
	if ( link != NULL )
	{
		src = link;
		srcPrev = NULL;
		srcNext = link->asSrcRoot;
		if ( srcNext != NULL )	srcNext->srcPrev = this;
		link->asSrcRoot = this;
	}
}
void MeshLink :: SetSource ( MeshLink * link ) { if ( src != NULL ) { if ( src -> asSrcRoot == this ) src -> asSrcRoot = srcNext ; if ( srcPrev != NULL ) srcPrev -> srcNext = srcNext ; if ( srcNext != NULL ) srcNext -> srcPrev = srcPrev ; srcPrev = srcNext = NULL ; src = NULL ; } if ( link != NULL ) { src = link ; srcPrev = NULL ; srcNext = link -> asSrcRoot ; if ( srcNext != NULL ) srcNext -> srcPrev = this ; link -> asSrcRoot = this ; } }
Function        SetSource
Description     Sets the source link for the object.
Function SetSource Description Sets the source link for the object .
//	Remove current source //	Connect new source