just a fork
Fork of BLE_API by
Diff: ble/CallChainOfFunctionPointersWithContext.h
- Revision:
- 920:d18cff0c4b09
- Parent:
- 919:c5b9fac295f5
- Child:
- 921:ea542e6519bb
diff -r c5b9fac295f5 -r d18cff0c4b09 ble/CallChainOfFunctionPointersWithContext.h --- a/ble/CallChainOfFunctionPointersWithContext.h Thu Nov 26 12:52:04 2015 +0000 +++ b/ble/CallChainOfFunctionPointersWithContext.h Thu Nov 26 12:52:04 2015 +0000 @@ -97,42 +97,6 @@ return common_add(new FunctionPointerWithContext<ContextType>(tptr, mptr)); } - /** Add a function at the front of the chain. - * - * @param func The FunctionPointerWithContext to add. - */ - void add(const FunctionPointerWithContext<ContextType>& func) { - common_add(new FunctionPointerWithContext<ContextType>(func)); - } - - /** - * Detach a function pointer from a callchain - * - * @oaram toDetach FunctionPointerWithContext to detach from this callchain - * - * @return true if a function pointer has been detached and false otherwise - */ - void detach(const FunctionPointerWithContext<ContextType>& toDetach) { - pFunctionPointerWithContext_t current = chainHead; - pFunctionPointerWithContext_t previous = NULL; - - while (current) { - if(*current == toDetach) { - if(previous == NULL) { - chainHead = current->getNext(); - } else { - previous->chainAsNext(current->getNext()); - } - delete current; - return true; - } - - previous = current; - current = current->getNext(); - } - return false; - } - /** Clear the call chain (remove all functions in the chain). */ void clear(void) { @@ -161,29 +125,6 @@ } } - /** - * @brief same as above but const - */ - void call(ContextType context) const { - if (chainHead) { - chainHead->call(context); - } - } - - /** - * @brief same as above but with function call operator - */ - void operator()(ContextType context) const { - call(context); - } - - typedef void (CallChainOfFunctionPointersWithContext::*bool_type)() const; - void True() const {} - - operator bool_type() const { - return chainHead == NULL ? 0 : &CallChainOfFunctionPointersWithContext::True; - } - private: pFunctionPointerWithContext_t common_add(pFunctionPointerWithContext_t pf) { if (chainHead == NULL) {