Templatious
 All Classes Functions Pages
Classes | Public Member Functions | List of all members
templatious::DynamicVMatchFunctor Struct Reference

#include <DynamicVirtualMatchFunctor.hpp>

Inheritance diagram for templatious::DynamicVMatchFunctor:
templatious::VirtualMatchFunctor

Public Member Functions

 DynamicVMatchFunctor (bool isBroadcast=false)
 
 DynamicVMatchFunctor (const DynamicVMatchFunctor &)=delete
 
 DynamicVMatchFunctor (DynamicVMatchFunctor &&d)
 
int attach (std::unique_ptr< VirtualMatchFunctor > vmf, int priority=128)
 
std::unique_ptr
< VirtualMatchFunctor
detach (int id)
 
void clear ()
 
bool tryMatch (VirtualPack &vp) override
 
bool tryMatch (VirtualPack &vp) const override
 
bool tryMatch (const VirtualPack &vp) override
 
bool tryMatch (const VirtualPack &vp) const override
 
- Public Member Functions inherited from templatious::VirtualMatchFunctor
virtual void operator() (VirtualPack &p)
 
virtual void operator() (const VirtualPack &p)
 
virtual void operator() (VirtualPack &p) const
 
virtual void operator() (const VirtualPack &p) const
 

Detailed Description

Dynamic virtual match functor. This class can attach VirtualMatchFunctors for processing with default or custom priority. Threadsafe to attach/detach and match virtual packs.

Member Function Documentation

int templatious::DynamicVMatchFunctor::attach ( std::unique_ptr< VirtualMatchFunctor vmf,
int  priority = 128 
)
inline

Attach virtual match functor to the processing queue. Returns the id of attached functor to possibly refer to it in the future. Threadsafe.

Parameters
[in]vmfunique pointer to a VirtualMatchFunctor to attach.
[in]priorityPriority to set for processing. Match functors with higher priority are processed earlier than the ones with lower priority. Defaults to 128.
void templatious::DynamicVMatchFunctor::clear ( )
inline

Clear all the existing VMatch functors. Threadsafe.

std::unique_ptr<VirtualMatchFunctor> templatious::DynamicVMatchFunctor::detach ( int  id)
inline

Detach virtual match functor with the specified id and return it to the caller wrapped around std::unique_ptr. Throws if no such id exists. Threadsafe.

Parameters
[in]idThe id of a functor to return.
bool templatious::DynamicVMatchFunctor::tryMatch ( VirtualPack vp)
inlineoverridevirtual

Try to match virtual pack to this match functor. Only one pack can be processed at a time by multiple threads.

Parameters
[in]vpVirtualPack to match.

Implements templatious::VirtualMatchFunctor.

bool templatious::DynamicVMatchFunctor::tryMatch ( VirtualPack vp) const
inlineoverridevirtual

Try to match virtual pack to this match functor. Only one pack can be processed at a time by multiple threads.

Parameters
[in]vpVirtualPack to match.

Implements templatious::VirtualMatchFunctor.

bool templatious::DynamicVMatchFunctor::tryMatch ( const VirtualPack vp)
inlineoverridevirtual

Try to match virtual pack to this match functor. Only one pack can be processed at a time by multiple threads.

Parameters
[in]vpVirtualPack to match.

Implements templatious::VirtualMatchFunctor.

bool templatious::DynamicVMatchFunctor::tryMatch ( const VirtualPack vp) const
inlineoverridevirtual

Try to match virtual pack to this match functor. Only one pack can be processed at a time by multiple threads.

Parameters
[in]vpVirtualPack to match.

Implements templatious::VirtualMatchFunctor.


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