Container for API hooks for a specific feature. More...
#include <InkAPIInternal.h>
Public Member Functions | |
FeatureAPIHooks () | |
Constructor (empty container). | |
~FeatureAPIHooks () | |
Destructor. | |
void | clear () |
Remove all hooks. | |
void | prepend (ID id, INKContInternal *cont) |
Add the hook cont to the front of the hooks for id. | |
void | append (ID id, INKContInternal *cont) |
Add the hook cont to the end of the hooks for id. | |
APIHook * | get (ID id) const |
Get the list of hooks for id. | |
void | invoke (ID id, int event, void *data) |
Invoke the callbacks for the hook id. | |
bool | has_hooks () const |
Fast check for any hooks in this container. | |
bool | has_hooks_for (ID id) const |
Check for existence of hooks of a specific id. | |
Static Public Member Functions | |
static bool | is_valid (ID id) |
Container for API hooks for a specific feature.
This is an array of hook lists, each identified by a numeric identifier (id). Each array element is a list of all hooks for that ID. Adding a hook means adding to the list in the corresponding array element. There is no provision for removing a hook.
Definition at line 187 of file InkAPIInternal.h.
FeatureAPIHooks< ID, N >::FeatureAPIHooks | ( | ) |
Constructor (empty container).
Definition at line 224 of file InkAPIInternal.h.
FeatureAPIHooks< ID, N >::~FeatureAPIHooks | ( | ) |
Destructor.
Definition at line 230 of file InkAPIInternal.h.
References FeatureAPIHooks< ID, N >::clear().
void FeatureAPIHooks< ID, N >::append | ( | ID | id, | |
INKContInternal * | cont | |||
) |
Add the hook cont to the end of the hooks for id.
Definition at line 255 of file InkAPIInternal.h.
References APIHooks::append().
Referenced by HttpSM::do_range_setup_if_necessary(), TSHttpHookAdd(), TSLifecycleHookAdd(), and HttpSM::txn_hook_append().
void FeatureAPIHooks< ID, N >::clear | ( | void | ) |
Remove all hooks.
Definition at line 237 of file InkAPIInternal.h.
References APIHooks::clear().
Referenced by ProxyClientSession::cleanup(), HttpSM::cleanup(), and FeatureAPIHooks< ID, N >::~FeatureAPIHooks().
APIHook * FeatureAPIHooks< ID, N >::get | ( | ID | id | ) | const |
Get the list of hooks for id.
Definition at line 263 of file InkAPIInternal.h.
References APIHooks::get().
Referenced by HttpTransactCache::calculate_quality_of_match(), CB_After_Cache_Init(), HttpSM::do_post_transform_open(), HttpSM::do_range_setup_if_necessary(), HttpSM::do_transform_open(), TransformControl::handle_event(), init_ssl_ctx_callback(), main(), ProxyClientSession::ssn_hook_get(), start_HttpProxyServer(), HttpSM::state_api_callout(), HttpSM::transform_cleanup(), and HttpSM::txn_hook_get().
bool FeatureAPIHooks< ID, N >::has_hooks | ( | ) | const |
Fast check for any hooks in this container.
true
if any list has at least one hook, false
if all lists have no hooks. Definition at line 277 of file InkAPIInternal.h.
Referenced by ProxyClientSession::has_hooks().
bool FeatureAPIHooks< ID, N >::has_hooks_for | ( | ID | id | ) | const |
Check for existence of hooks of a specific id.
true
if any hooks of type id are present. void FeatureAPIHooks< ID, N >::invoke | ( | ID | id, | |
int | event, | |||
void * | data | |||
) |
Invoke the callbacks for the hook id.
Definition at line 270 of file InkAPIInternal.h.
References APIHooks::invoke().
bool FeatureAPIHooks< ID, N >::is_valid | ( | ID | id | ) | [static] |
true
if id is a valid id, false
otherwise. Definition at line 284 of file InkAPIInternal.h.
void FeatureAPIHooks< ID, N >::prepend | ( | ID | id, | |
INKContInternal * | cont | |||
) |
Add the hook cont to the front of the hooks for id.
Definition at line 247 of file InkAPIInternal.h.
References APIHooks::prepend().
Referenced by ProxyClientSession::ssn_hook_append(), ProxyClientSession::ssn_hook_prepend(), and HttpSM::txn_hook_prepend().