Changeset 993f5ac in rtems for cpukit/score/include/rtems/score/rbtree.h
- Timestamp:
- 07/23/14 11:03:54 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 0ef6e3bf
- Parents:
- 4752550f
- git-author:
- Sebastian Huber <sebastian.huber@…> (07/23/14 11:03:54)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (08/07/14 13:59:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/score/include/rtems/score/rbtree.h
r4752550f r993f5ac 301 301 302 302 /** 303 * @brief Return pointer to RBTree's root node. 304 * 305 * This function returns a pointer to the root node of @a the_rbtree. 303 * @brief Returns a pointer to root node of the red-black tree. 304 * 305 * The root node may change after insert or extract operations. 306 * 307 * @param[in] the_rbtree The red-black tree control. 308 * 309 * @retval NULL The tree is empty. 310 * @retval root The root node. 311 * 312 * @see _RBTree_Is_root(). 306 313 */ 307 314 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Root( … … 327 334 328 335 /** 329 * @brief Return pointer to the parent of this node. 330 * 331 * This function returns a pointer to the parent node of @a the_node. 336 * @brief Returns a pointer to the parent of this node. 337 * 338 * The node must have a parent, thus it is invalid to use this function for the 339 * root node or a node that is not part of a tree. To test for the root node 340 * compare with _RBTree_Root() or use _RBTree_Is_root(). 341 * 342 * @param[in] the_node The node of interest. 343 * 344 * @retval parent The parent of this node. 345 * @retval undefined The node is the root node or not part of a tree. 332 346 */ 333 347 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( … … 335 349 ) 336 350 { 337 if (!the_node->parent->parent) return NULL;338 351 return the_node->parent; 339 352 } … … 410 423 411 424 /** 412 * @brief Is this node the RBTree root. 413 * 414 * This function returns true if @a the_node is the root of @a the_rbtree and 425 * @brief Returns true if this node is the root node of a red-black tree, and 415 426 * false otherwise. 416 427 * 417 * @retval true @a the_node is the root of @a the_rbtree. 418 * @retval false @a the_node is not the root of @a the_rbtree. 428 * The root node may change after insert or extract operations. In case the 429 * node is not a node of a tree, then this function yields unpredictable 430 * results. 431 * 432 * @param[in] the_node The node of interest. 433 * 434 * @retval true The node is the root node. 435 * @retval false Otherwise. 436 * 437 * @see _RBTree_Root(). 419 438 */ 420 439 RTEMS_INLINE_ROUTINE bool _RBTree_Is_root( 421 const RBTree_Control *the_rbtree, 422 const RBTree_Node *the_node 423 ) 424 { 425 return (the_node == _RBTree_Root(the_rbtree)); 440 const RBTree_Node *the_node 441 ) 442 { 443 return _RBTree_Parent( _RBTree_Parent( the_node ) ) == NULL; 426 444 } 427 445
Note: See TracChangeset
for help on using the changeset viewer.