OpenSDN source code
KSyncObject Class Referenceabstract

#include <ksync_object.h>

Inheritance diagram for KSyncObject:
Collaboration diagram for KSyncObject:

Public Types

typedef boost::intrusive::member_hook< KSyncEntry, boost::intrusive::set_member_hook<>, &KSyncEntry::node_KSyncObjectNode
 
typedef boost::intrusive::set< KSyncEntry, KSyncObjectNodeTree
 
typedef boost::intrusive::member_hook< KSyncFwdReference, boost::intrusive::set_member_hook<>, &KSyncFwdReference::node_KSyncFwdRefNode
 
typedef boost::intrusive::set< KSyncFwdReference, KSyncFwdRefNodeFwdRefTree
 
typedef boost::intrusive::member_hook< KSyncBackReference, boost::intrusive::set_member_hook<>, &KSyncBackReference::node_KSyncBackRefNode
 
typedef boost::intrusive::set< KSyncBackReference, KSyncBackRefNodeBackRefTree
 

Public Member Functions

 KSyncObject (const std::string &name)
 
 KSyncObject (const std::string &name, int max_index)
 
virtual ~KSyncObject ()
 
void InitStaleEntryCleanup (boost::asio::io_context &ios, uint32_t cleanup_time, uint32_t cleanup_intvl, uint16_t entries_per_intvl)
 
void NotifyEvent (KSyncEntry *entry, KSyncEntry::KSyncEvent event)
 
void SafeNotifyEvent (KSyncEntry *entry, KSyncEntry::KSyncEvent event)
 
virtual void NetlinkAck (KSyncEntry *entry, KSyncEntry::KSyncEvent event)
 
void BackRefAdd (KSyncEntry *key, KSyncEntry *reference)
 
void BackRefDel (KSyncEntry *key)
 
void BackRefReEval (KSyncEntry *key)
 
KSyncEntryCreate (const KSyncEntry *key)
 
KSyncEntryCreate (const KSyncEntry *key, bool skip_lookup)
 
KSyncEntryCreateStale (const KSyncEntry *key)
 
void Change (KSyncEntry *entry)
 
void Delete (KSyncEntry *entry)
 
KSyncEntryFind (const KSyncEntry *key)
 
KSyncEntryNext (const KSyncEntry *entry) const
 
KSyncEntryGetReference (const KSyncEntry *key)
 
virtual KSyncEntryAlloc (const KSyncEntry *key, uint32_t index)=0
 
virtual void Free (KSyncEntry *entry)
 
virtual void EmptyTable (void)
 
bool IsEmpty (void)
 
virtual bool DoEventTrace (void)
 
virtual void PreFree (KSyncEntry *entry)
 
std::size_t Size ()
 
void set_delete_scheduled ()
 
bool delete_scheduled ()
 
virtual SandeshTraceBufferPtr GetKSyncTraceBuf ()
 

Static Public Member Functions

static void Shutdown ()
 

Protected Member Functions

KSyncEntryCreateImpl (const KSyncEntry *key)
 
void ClearStale (KSyncEntry *entry)
 
void ChangeKey (KSyncEntry *entry, uint32_t arg)
 
virtual void UpdateKey (KSyncEntry *entry, uint32_t arg)
 
virtual uint32_t GetKey (KSyncEntry *entry)
 

Protected Attributes

tbb::recursive_mutex lock_
 

Private Member Functions

void FreeInd (KSyncEntry *entry, uint32_t index)
 
void NetlinkAckInternal (KSyncEntry *entry, KSyncEntry::KSyncEvent event)
 
bool IsIndexValid () const
 
bool StaleEntryCleanupCb ()
 
virtual void CleanupOnDel (KSyncEntry *kentry)
 
 DISALLOW_COPY_AND_ASSIGN (KSyncObject)
 

Private Attributes

Tree tree_
 
bool need_index_
 
KSyncIndexTable index_table_
 
bool delete_scheduled_
 
std::set< KSyncEntry::KSyncEntryPtrstale_entry_tree_
 
Timerstale_entry_cleanup_timer_
 
uint32_t stale_entry_cleanup_intvl_
 
uint16_t stale_entries_per_intvl_
 
SandeshTraceBufferPtr KSyncTraceBuf
 

Static Private Attributes

static FwdRefTree fwd_ref_tree_
 
static BackRefTree back_ref_tree_
 

Friends

class KSyncEntry
 
void TestTriggerStaleEntryCleanupCb (KSyncObject *obj)
 

Detailed Description

Definition at line 70 of file ksync_object.h.

Member Typedef Documentation

◆ BackRefTree

Definition at line 85 of file ksync_object.h.

◆ FwdRefTree

Definition at line 80 of file ksync_object.h.

◆ KSyncBackRefNode

typedef boost::intrusive::member_hook<KSyncBackReference, boost::intrusive::set_member_hook<>, &KSyncBackReference::node_> KSyncObject::KSyncBackRefNode

Definition at line 84 of file ksync_object.h.

◆ KSyncFwdRefNode

typedef boost::intrusive::member_hook<KSyncFwdReference, boost::intrusive::set_member_hook<>, &KSyncFwdReference::node_> KSyncObject::KSyncFwdRefNode

Definition at line 79 of file ksync_object.h.

◆ KSyncObjectNode

typedef boost::intrusive::member_hook<KSyncEntry, boost::intrusive::set_member_hook<>, &KSyncEntry::node_> KSyncObject::KSyncObjectNode

Definition at line 74 of file ksync_object.h.

◆ Tree

typedef boost::intrusive::set<KSyncEntry, KSyncObjectNode> KSyncObject::Tree

Definition at line 75 of file ksync_object.h.

Constructor & Destructor Documentation

◆ KSyncObject() [1/2]

KSyncObject::KSyncObject ( const std::string &  name)

Definition at line 55 of file ksync_object.cc.

Here is the call graph for this function:

◆ KSyncObject() [2/2]

KSyncObject::KSyncObject ( const std::string &  name,
int  max_index 
)

Definition at line 63 of file ksync_object.cc.

Here is the call graph for this function:

◆ ~KSyncObject()

KSyncObject::~KSyncObject ( )
virtual

Definition at line 72 of file ksync_object.cc.

Here is the call graph for this function:

Member Function Documentation

◆ Alloc()

◆ BackRefAdd()

void KSyncObject::BackRefAdd ( KSyncEntry key,
KSyncEntry reference 
)

Definition at line 1465 of file ksync_object.cc.

Here is the call graph for this function:

◆ BackRefDel()

void KSyncObject::BackRefDel ( KSyncEntry key)

Definition at line 1479 of file ksync_object.cc.

Here is the call graph for this function:

◆ BackRefReEval()

void KSyncObject::BackRefReEval ( KSyncEntry key)

Definition at line 1501 of file ksync_object.cc.

Here is the call graph for this function:

◆ Change()

void KSyncObject::Change ( KSyncEntry entry)

Definition at line 225 of file ksync_object.cc.

Here is the call graph for this function:

◆ ChangeKey()

void KSyncObject::ChangeKey ( KSyncEntry entry,
uint32_t  arg 
)
protected

Definition at line 236 of file ksync_object.cc.

Here is the call graph for this function:

◆ CleanupOnDel()

virtual void KSyncObject::CleanupOnDel ( KSyncEntry kentry)
inlineprivatevirtual

Reimplemented in KSyncDBObject.

Definition at line 179 of file ksync_object.h.

◆ ClearStale()

void KSyncObject::ClearStale ( KSyncEntry entry)
protected

Definition at line 148 of file ksync_object.cc.

◆ Create() [1/2]

KSyncEntry * KSyncObject::Create ( const KSyncEntry key)

Definition at line 179 of file ksync_object.cc.

◆ Create() [2/2]

KSyncEntry * KSyncObject::Create ( const KSyncEntry key,
bool  skip_lookup 
)

Definition at line 156 of file ksync_object.cc.

Here is the call graph for this function:

◆ CreateImpl()

KSyncEntry * KSyncObject::CreateImpl ( const KSyncEntry key)
protected

Definition at line 122 of file ksync_object.cc.

Here is the call graph for this function:

◆ CreateStale()

KSyncEntry * KSyncObject::CreateStale ( const KSyncEntry key)

Definition at line 183 of file ksync_object.cc.

Here is the call graph for this function:

◆ Delete()

void KSyncObject::Delete ( KSyncEntry entry)

Definition at line 229 of file ksync_object.cc.

Here is the call graph for this function:

◆ delete_scheduled()

bool KSyncObject::delete_scheduled ( )
inline

Definition at line 146 of file ksync_object.h.

◆ DISALLOW_COPY_AND_ASSIGN()

KSyncObject::DISALLOW_COPY_AND_ASSIGN ( KSyncObject  )
private

◆ DoEventTrace()

virtual bool KSyncObject::DoEventTrace ( void  )
inlinevirtual

Reimplemented in FlowTableKSyncObject.

Definition at line 140 of file ksync_object.h.

◆ EmptyTable()

virtual void KSyncObject::EmptyTable ( void  )
inlinevirtual

◆ Find()

KSyncEntry * KSyncObject::Find ( const KSyncEntry key)

Definition at line 99 of file ksync_object.cc.

◆ Free()

void KSyncObject::Free ( KSyncEntry entry)
virtual

Reimplemented in FlowTableKSyncObject.

Definition at line 268 of file ksync_object.cc.

◆ FreeInd()

void KSyncObject::FreeInd ( KSyncEntry entry,
uint32_t  index 
)
private

Definition at line 259 of file ksync_object.cc.

Here is the call graph for this function:

◆ GetKey()

uint32_t KSyncObject::GetKey ( KSyncEntry entry)
protectedvirtual

Reimplemented in FlowTableKSyncObject.

Definition at line 254 of file ksync_object.cc.

◆ GetKSyncTraceBuf()

virtual SandeshTraceBufferPtr KSyncObject::GetKSyncTraceBuf ( )
inlinevirtual

Definition at line 147 of file ksync_object.h.

◆ GetReference()

KSyncEntry * KSyncObject::GetReference ( const KSyncEntry key)

Definition at line 214 of file ksync_object.cc.

Here is the call graph for this function:

◆ InitStaleEntryCleanup()

void KSyncObject::InitStaleEntryCleanup ( boost::asio::io_context &  ios,
uint32_t  cleanup_time,
uint32_t  cleanup_intvl,
uint16_t  entries_per_intvl 
)

Definition at line 79 of file ksync_object.cc.

Here is the call graph for this function:

◆ IsEmpty()

bool KSyncObject::IsEmpty ( void  )
inline

Definition at line 138 of file ksync_object.h.

◆ IsIndexValid()

bool KSyncObject::IsIndexValid ( ) const
inlineprivate

Definition at line 173 of file ksync_object.h.

◆ NetlinkAck()

void KSyncObject::NetlinkAck ( KSyncEntry entry,
KSyncEntry::KSyncEvent  event 
)
virtual

Reimplemented in FlowTableKSyncObject.

Definition at line 1458 of file ksync_object.cc.

Here is the call graph for this function:

◆ NetlinkAckInternal()

void KSyncObject::NetlinkAckInternal ( KSyncEntry entry,
KSyncEntry::KSyncEvent  event 
)
private

Definition at line 1427 of file ksync_object.cc.

Here is the call graph for this function:

◆ Next()

KSyncEntry * KSyncObject::Next ( const KSyncEntry entry) const

Definition at line 108 of file ksync_object.cc.

◆ NotifyEvent()

void KSyncObject::NotifyEvent ( KSyncEntry entry,
KSyncEntry::KSyncEvent  event 
)

Definition at line 1332 of file ksync_object.cc.

Here is the call graph for this function:

◆ PreFree()

virtual void KSyncObject::PreFree ( KSyncEntry entry)
inlinevirtual

Definition at line 141 of file ksync_object.h.

◆ SafeNotifyEvent()

void KSyncObject::SafeNotifyEvent ( KSyncEntry entry,
KSyncEntry::KSyncEvent  event 
)

Definition at line 272 of file ksync_object.cc.

Here is the call graph for this function:

◆ set_delete_scheduled()

void KSyncObject::set_delete_scheduled ( )
inline

Definition at line 145 of file ksync_object.h.

◆ Shutdown()

void KSyncObject::Shutdown ( )
static

Definition at line 94 of file ksync_object.cc.

◆ Size()

std::size_t KSyncObject::Size ( )
inline

Definition at line 144 of file ksync_object.h.

◆ StaleEntryCleanupCb()

bool KSyncObject::StaleEntryCleanupCb ( )
private

Definition at line 1433 of file ksync_object.cc.

Here is the call graph for this function:

◆ UpdateKey()

virtual void KSyncObject::UpdateKey ( KSyncEntry entry,
uint32_t  arg 
)
inlineprotectedvirtual

Reimplemented in FlowTableKSyncObject.

Definition at line 158 of file ksync_object.h.

Friends And Related Function Documentation

◆ KSyncEntry

friend class KSyncEntry
friend

Definition at line 165 of file ksync_object.h.

◆ TestTriggerStaleEntryCleanupCb

void TestTriggerStaleEntryCleanupCb ( KSyncObject obj)
friend

Definition at line 51 of file ksync_object.cc.

Member Data Documentation

◆ back_ref_tree_

KSyncObject::BackRefTree KSyncObject::back_ref_tree_
staticprivate

Definition at line 186 of file ksync_object.h.

◆ delete_scheduled_

bool KSyncObject::delete_scheduled_
private

Definition at line 192 of file ksync_object.h.

◆ fwd_ref_tree_

KSyncObject::FwdRefTree KSyncObject::fwd_ref_tree_
staticprivate

Definition at line 184 of file ksync_object.h.

◆ index_table_

KSyncIndexTable KSyncObject::index_table_
private

Definition at line 190 of file ksync_object.h.

◆ KSyncTraceBuf

SandeshTraceBufferPtr KSyncObject::KSyncTraceBuf
private

Definition at line 202 of file ksync_object.h.

◆ lock_

tbb::recursive_mutex KSyncObject::lock_
mutableprotected

Definition at line 156 of file ksync_object.h.

◆ need_index_

bool KSyncObject::need_index_
private

Definition at line 188 of file ksync_object.h.

◆ stale_entries_per_intvl_

uint16_t KSyncObject::stale_entries_per_intvl_
private

Definition at line 201 of file ksync_object.h.

◆ stale_entry_cleanup_intvl_

uint32_t KSyncObject::stale_entry_cleanup_intvl_
private

Definition at line 200 of file ksync_object.h.

◆ stale_entry_cleanup_timer_

Timer* KSyncObject::stale_entry_cleanup_timer_
private

Definition at line 198 of file ksync_object.h.

◆ stale_entry_tree_

std::set<KSyncEntry::KSyncEntryPtr> KSyncObject::stale_entry_tree_
private

Definition at line 195 of file ksync_object.h.

◆ tree_

Tree KSyncObject::tree_
private

Definition at line 182 of file ksync_object.h.


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