Web Analytics Made Easy - Statcounter
Skip to content

File SBCReferencePointerList.hpp#

FileList > Core > Reference > SBCReferencePointerList.hpp

  • #include "SBCReferenceListLink.hpp"
  • #include "SBCReferenceOwnerList.hpp"
  • #include "SBCContainerFor.hpp"

Classes#

Type Name
class SBCContainerConstListForEach <typename T>
class SBCContainerConstListReverseForEach <typename T>
class SBCReferencePointerList <class ReferenceTargetType, class ReferenceToTargetType>
The class SBCReferencePointerList is a convenience class used to reference a list of targets of a given type that derives fromSBCReferenceTarget .
class const_iterator
class const_reverse_iterator
class iterator
class reverse_iterator

Macros#

Type Name
define SBPointerList
define SBPointerListLink
define SB_CONST_LIST_FOR (VARIABLE, CONTAINER)
A macro to easily write for loops involving pointer lists that remain constant during traversal.
define SB_CONST_LIST_REVERSE_FOR (VARIABLE, CONTAINER)
A macro to easily write reverse for loops involving pointer lists that remain constant during traversal.

Macro Definition Documentation#

define SBPointerList#

#define SBPointerList 

#define SBPointerListLink 

define SB_CONST_LIST_FOR#

A macro to easily write for loops involving pointer lists that remain constant during traversal.

#define SB_CONST_LIST_FOR (
    VARIABLE,
    CONTAINER
) 

This macro should be strongly preferred whenever a pointer list is traversed in a way that guarantees that the list is not changed during traversal, as it is much faster than SB_FOR. Note that pointer lists are automatically changed when pointed objects are deleted. As a result, to use this macro, traversal should be done in such a way that pointed objects cannot be deleted, either directly or indirectly.

Example:

SB_CONST_LIST_FOR(SBNode* node, *SAMSON::getActiveDocument()->getChildren()) {
 // do something with a node
}


define SB_CONST_LIST_REVERSE_FOR#

A macro to easily write reverse for loops involving pointer lists that remain constant during traversal.

#define SB_CONST_LIST_REVERSE_FOR (
    VARIABLE,
    CONTAINER
) 

This macro should be strongly preferred whenever a pointer list is traversed in a way that guarantees that the list is not changed during traversal, as it is much faster than SB_REVERS_FOR. Note that pointer lists are automatically changed when pointed objects are deleted. As a result, to use this macro, traversal should be done in such a way that pointed objects cannot be deleted, either directly or indirectly.