ON_FunctionList Class Reference

#include <opennurbs_function_list.h>

Public Member Functions

 ON_FunctionList (size_t function_count_estimate)
 
 ~ON_FunctionList ()
 
unsigned int AddFunction (void(*function)(ON__UINT_PTR), ON__UINT_PTR function_parameter)
 Unconditionally add a function to the list. More...
 
bool CallFunctions (bool bFirstToLast)
 Call all the functions in the function list. More...
 
bool EmptyList ()
 
unsigned int FunctionCount () const
 
bool InUse () const
 
unsigned int IsInList (void(*function)(ON__UINT_PTR), ON__UINT_PTR function_parameter) const
 
unsigned int IsInList (void(*function)(ON__UINT_PTR)) const
 
unsigned int RemoveFunction (void(*function)(ON__UINT_PTR))
 
unsigned int RemoveFunction (void(*function)(ON__UINT_PTR), ON__UINT_PTR function_parameter)
 

Constructor & Destructor Documentation

◆ ON_FunctionList()

ON_FunctionList::ON_FunctionList ( size_t  function_count_estimate)
Parameters
function_count_estimate[in] An estimate of the maximum number of functions that will be in the list at any one time. Pass 0 if you don't know.

◆ ~ON_FunctionList()

ON_FunctionList::~ON_FunctionList ( )

Member Function Documentation

◆ AddFunction()

unsigned int ON_FunctionList::AddFunction ( void(*)(ON__UINT_PTR)  function,
ON__UINT_PTR  function_parameter 
)

Unconditionally add a function to the list.

Parameters
function[in] A function that takes a single ON__UINT_PTR parameter.
function_parameter[in]
Returns
0: list in use 1: function added 2: invalid input

◆ CallFunctions()

bool ON_FunctionList::CallFunctions ( bool  bFirstToLast)

Call all the functions in the function list.

Parameters
bFirstToLast[in]
truefunction are called in the order added
falsefunctions are called in the reverse order added
Returns
True if the functions were called or the list is empty. False if the list is in use.

◆ EmptyList()

bool ON_FunctionList::EmptyList ( )
Returns
0: list in use 1: list was emptied

◆ FunctionCount()

unsigned int ON_FunctionList::FunctionCount ( ) const

◆ InUse()

bool ON_FunctionList::InUse ( ) const
Returns
True if the list is in use.

◆ IsInList() [1/2]

unsigned int ON_FunctionList::IsInList ( void(*)(ON__UINT_PTR)  function,
ON__UINT_PTR  function_parameter 
) const
Returns
0: Matching function and parameter are not in the list. 1: Matching function and parameter are in the list. 2: list in use

◆ IsInList() [2/2]

unsigned int ON_FunctionList::IsInList ( void(*)(ON__UINT_PTR)  function) const
Returns
0: list in use 1: Matching function is in the list. 2: Matching function is not in the list.

◆ RemoveFunction() [1/2]

unsigned int ON_FunctionList::RemoveFunction ( void(*)(ON__UINT_PTR)  function)
Returns
0: list in use 1: function removed 2: matching function not in the list

◆ RemoveFunction() [2/2]

unsigned int ON_FunctionList::RemoveFunction ( void(*)(ON__UINT_PTR)  function,
ON__UINT_PTR  function_parameter 
)
Returns
0: list in use 1: function removed 2: matching function not in the list