proxygen
|
#include <FilterChain.h>
Public Types | |
using | Filter = GenericFilter< T1, T2, set_callback, TakeOwnership, Dp > |
Public Member Functions | |
GenericFilter (bool calls, bool callbacks) | |
~GenericFilter () override | |
void | append (Filter *nextFilter) |
Public Attributes | |
const bool | kWantsCalls_ |
const bool | kWantsCallbacks_ |
Protected Member Functions | |
void | setCallbackInternal (T2 *cb) |
void | drop () |
Protected Attributes | |
T1 * | call_ {nullptr} |
T2 * | callback_ {nullptr} |
Private Member Functions | |
void | setCallbackInternalImpl (T2 *cb, T2 *sourceSet) |
Private Attributes | |
Filter * | next_ {nullptr} |
Filter * | prev_ {nullptr} |
Filter * | callSource_ {nullptr} |
T1 * | callbackSource_ {nullptr} |
Friends | |
template<class A , class B , class F , void(A::*)(B *) fn, bool Own> | |
class | FilterChain |
A generic two-way filter. That is, this filter intercepts calls from an object A to some object B on an interface T1. It also intercepts calls from B to A on an interface T2.
Subclass GenericFilter templatized on the appropriate interfaces to intercept calls between T1 and T2.
T2 must have the ability to tell T1 to call it back using a certain object. Many different callback patterns have a different name for this function, but this filter needs to be informed when the callback object changes. Therefore, when you subclass this object, you must call
void setCallbackInternal(T2*);
from the appropriate virtual function and not forward that function call along the chain, or the filter will not work and may have errors!
Definition at line 40 of file FilterChain.h.
using proxygen::GenericFilter< T1, T2, set_callback, TakeOwnership, Dp >::Filter = GenericFilter<T1, T2, set_callback, TakeOwnership, Dp> |
Definition at line 42 of file FilterChain.h.
|
inline |
calls | You will intercept calls to T1 interface iff you pass true for this parameter. |
callbacks | You will intercept calls to T2 interface iff you pass true for this parameter. |
Definition at line 49 of file FilterChain.h.
|
inlineoverride |
Definition at line 53 of file FilterChain.h.
|
inline |
nextFilter | the new filter to insert after this filter |
Definition at line 69 of file FilterChain.h.
|
inlineprotected |
Removes this filter from the chain. For owning chains the caller must manually delete the filter
Definition at line 119 of file FilterChain.h.
|
inlineprotected |
Note: you MUST override the set_callback function and call setCallbackInternal() from your derived class.
Definition at line 111 of file FilterChain.h.
Referenced by proxygen::PassThroughHTTPCodecFilter::setCallback().
|
inlineprivate |
Definition at line 158 of file FilterChain.h.
|
friend |
Definition at line 177 of file FilterChain.h.
|
protected |
Definition at line 152 of file FilterChain.h.
Referenced by proxygen::PassThroughHTTPCodecFilter::addPriorityNodes(), proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), proxygen::PassThroughHTTPCodecFilter::closeOnEgressComplete(), proxygen::PassThroughHTTPCodecFilter::createStream(), proxygen::PassThroughHTTPCodecFilter::enableDoubleGoawayDrain(), proxygen::FlowControlFilter::generateBody(), proxygen::PassThroughHTTPCodecFilter::generateBody(), proxygen::PassThroughHTTPCodecFilter::generateCertificate(), proxygen::PassThroughHTTPCodecFilter::generateCertificateRequest(), proxygen::PassThroughHTTPCodecFilter::generateChunkHeader(), proxygen::PassThroughHTTPCodecFilter::generateChunkTerminator(), proxygen::PassThroughHTTPCodecFilter::generateConnectionPreface(), proxygen::PassThroughHTTPCodecFilter::generateEOM(), proxygen::PassThroughHTTPCodecFilter::generateExHeader(), proxygen::PassThroughHTTPCodecFilter::generateGoaway(), proxygen::HTTPChecks::generateHeader(), proxygen::PassThroughHTTPCodecFilter::generateHeader(), proxygen::PassThroughHTTPCodecFilter::generatePingReply(), proxygen::PassThroughHTTPCodecFilter::generatePingRequest(), proxygen::PassThroughHTTPCodecFilter::generatePriority(), proxygen::PassThroughHTTPCodecFilter::generatePushPromise(), proxygen::PassThroughHTTPCodecFilter::generateRstStream(), proxygen::PassThroughHTTPCodecFilter::generateSettings(), proxygen::PassThroughHTTPCodecFilter::generateSettingsAck(), proxygen::PassThroughHTTPCodecFilter::generateTrailers(), proxygen::FlowControlFilter::generateWindowUpdate(), proxygen::PassThroughHTTPCodecFilter::generateWindowUpdate(), proxygen::PassThroughHTTPCodecFilter::getDefaultWindowSize(), proxygen::PassThroughHTTPCodecFilter::getEgressSettings(), proxygen::PassThroughHTTPCodecFilter::getHPACKTableInfo(), proxygen::PassThroughHTTPCodecFilter::getIngressSettings(), proxygen::PassThroughHTTPCodecFilter::getLastIncomingStreamID(), proxygen::PassThroughHTTPCodecFilter::getProtocol(), proxygen::PassThroughHTTPCodecFilter::getTransportDirection(), proxygen::PassThroughHTTPCodecFilter::getUserAgent(), proxygen::FlowControlFilter::ingressBytesProcessed(), proxygen::PassThroughHTTPCodecFilter::isBusy(), proxygen::FlowControlFilter::isReusable(), proxygen::PassThroughHTTPCodecFilter::isReusable(), proxygen::PassThroughHTTPCodecFilter::isWaitingToDrain(), proxygen::PassThroughHTTPCodecFilter::mapDependencyToPriority(), proxygen::PassThroughHTTPCodecFilter::mapPriorityToDependency(), proxygen::HTTPCodecPrinter::onFrameHeader(), proxygen::PassThroughHTTPCodecFilter::onIngress(), proxygen::PassThroughHTTPCodecFilter::onIngressEOF(), proxygen::PassThroughHTTPCodecFilter::onIngressUpgradeMessage(), proxygen::FilterChain< HTTPCodec, HTTPCodec::Callback, PassThroughHTTPCodecFilter,&HTTPCodec::setCallback, true >::setDestination(), proxygen::PassThroughHTTPCodecFilter::setHeaderCodecStats(), proxygen::PassThroughHTTPCodecFilter::setParserPaused(), proxygen::FlowControlFilter::setReceiveWindowSize(), proxygen::PassThroughHTTPCodecFilter::supportsParallelRequests(), proxygen::PassThroughHTTPCodecFilter::supportsPushTransactions(), proxygen::PassThroughHTTPCodecFilter::supportsSessionFlowControl(), and proxygen::PassThroughHTTPCodecFilter::supportsStreamFlowControl().
|
protected |
Definition at line 154 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), proxygen::PassThroughHTTPCodecFilter::numIncomingStreams(), proxygen::PassThroughHTTPCodecFilter::numOutgoingStreams(), proxygen::HTTPCodecPrinter::onAbort(), proxygen::PassThroughHTTPCodecFilter::onAbort(), proxygen::HTTPCodecPrinter::onBody(), proxygen::PassThroughHTTPCodecFilter::onBody(), proxygen::FlowControlFilter::onBody(), proxygen::PassThroughHTTPCodecFilter::onCertificate(), proxygen::PassThroughHTTPCodecFilter::onCertificateRequest(), proxygen::PassThroughHTTPCodecFilter::onChunkComplete(), proxygen::PassThroughHTTPCodecFilter::onChunkHeader(), proxygen::HTTPCodecPrinter::onError(), proxygen::PassThroughHTTPCodecFilter::onError(), proxygen::PassThroughHTTPCodecFilter::onExMessageBegin(), proxygen::HTTPCodecPrinter::onFrameHeader(), proxygen::PassThroughHTTPCodecFilter::onFrameHeader(), proxygen::PassThroughHTTPCodecFilter::onGenerateFrameHeader(), proxygen::PassThroughHTTPCodecFilter::onGoaway(), proxygen::HTTPCodecPrinter::onGoaway(), proxygen::HTTPChecks::onHeadersComplete(), proxygen::PassThroughHTTPCodecFilter::onHeadersComplete(), proxygen::HTTPCodecPrinter::onHeadersComplete(), proxygen::PassThroughHTTPCodecFilter::onMessageBegin(), proxygen::HTTPCodecPrinter::onMessageComplete(), proxygen::PassThroughHTTPCodecFilter::onMessageComplete(), proxygen::PassThroughHTTPCodecFilter::onNativeProtocolUpgrade(), proxygen::PassThroughHTTPCodecFilter::onPingReply(), proxygen::HTTPCodecPrinter::onPingReply(), proxygen::PassThroughHTTPCodecFilter::onPingRequest(), proxygen::HTTPCodecPrinter::onPingRequest(), proxygen::PassThroughHTTPCodecFilter::onPriority(), proxygen::PassThroughHTTPCodecFilter::onPushMessageBegin(), proxygen::HTTPCodecPrinter::onSettings(), proxygen::PassThroughHTTPCodecFilter::onSettings(), proxygen::HTTPCodecPrinter::onSettingsAck(), proxygen::PassThroughHTTPCodecFilter::onSettingsAck(), proxygen::PassThroughHTTPCodecFilter::onTrailersComplete(), proxygen::HTTPCodecPrinter::onWindowUpdate(), proxygen::PassThroughHTTPCodecFilter::onWindowUpdate(), and proxygen::FlowControlFilter::onWindowUpdate().
|
private |
Definition at line 174 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::drop(), and proxygen::FilterChain< HTTPCodec, HTTPCodec::Callback, PassThroughHTTPCodecFilter,&HTTPCodec::setCallback, true >::setDestination().
|
private |
const bool proxygen::GenericFilter< T1, T2, set_callback, TakeOwnership, Dp >::kWantsCallbacks_ |
Definition at line 104 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), and proxygen::FilterChain< HTTPCodec, HTTPCodec::Callback, PassThroughHTTPCodecFilter,&HTTPCodec::setCallback, true >::setDestination().
const bool proxygen::GenericFilter< T1, T2, set_callback, TakeOwnership, Dp >::kWantsCalls_ |
Definition at line 103 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), and proxygen::FilterChain< HTTPCodec, HTTPCodec::Callback, PassThroughHTTPCodecFilter,&HTTPCodec::setCallback, true >::setDestination().
|
private |
Definition at line 166 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append(), and proxygen::FilterChain< HTTPCodec, HTTPCodec::Callback, PassThroughHTTPCodecFilter,&HTTPCodec::setCallback, true >::setDestination().
|
private |
Definition at line 168 of file FilterChain.h.
Referenced by proxygen::GenericFilter< TesterInterface, TesterInterface::Callback,&TesterInterface::setCallback, Owned >::append().