Public Member Functions | Static Public Member Functions

FeatureAPIHooks< ID, N > Class Template Reference

Container for API hooks for a specific feature. More...

#include <InkAPIInternal.h>

Collaboration diagram for FeatureAPIHooks< ID, N >:
Collaboration graph
[legend]

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.
APIHookget (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)

Detailed Description

template<typename ID, ID N>
class FeatureAPIHooks< ID, N >

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.

Note:
The minimum value for a hook ID is zero. Therefore the template parameter N_ID should be one more than the maximum hook ID so the valid ids are 0..(N-1) in the standard C array style.

Definition at line 187 of file InkAPIInternal.h.


Constructor & Destructor Documentation

template<typename ID , ID N>
FeatureAPIHooks< ID, N >::FeatureAPIHooks (  ) 

Constructor (empty container).

Definition at line 224 of file InkAPIInternal.h.

template<typename ID , ID N>
FeatureAPIHooks< ID, N >::~FeatureAPIHooks (  ) 

Destructor.

Definition at line 230 of file InkAPIInternal.h.

References FeatureAPIHooks< ID, N >::clear().


Member Function Documentation

template<typename ID, ID N>
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().

template<typename ID , ID N>
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().

template<typename ID, ID N>
APIHook * FeatureAPIHooks< ID, N >::get ( ID  id  )  const
template<typename ID , ID N>
bool FeatureAPIHooks< ID, N >::has_hooks (  )  const

Fast check for any hooks in this container.

Returns:
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().

template<typename ID, ID N>
bool FeatureAPIHooks< ID, N >::has_hooks_for ( ID  id  )  const

Check for existence of hooks of a specific id.

Returns:
true if any hooks of type id are present.
template<typename ID, ID N>
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().

template<typename ID, ID N>
bool FeatureAPIHooks< ID, N >::is_valid ( ID  id  )  [static]
Returns:
true if id is a valid id, false otherwise.

Definition at line 284 of file InkAPIInternal.h.

template<typename ID, ID N>
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().


The documentation for this class was generated from the following file: