OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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, KSyncObjectNode
Tree
 
typedef
boost::intrusive::member_hook
< KSyncFwdReference,
boost::intrusive::set_member_hook
<>,&KSyncFwdReference::node_
KSyncFwdRefNode
 
typedef boost::intrusive::set
< KSyncFwdReference,
KSyncFwdRefNode
FwdRefTree
 
typedef
boost::intrusive::member_hook
< KSyncBackReference,
boost::intrusive::set_member_hook
<>,&KSyncBackReference::node_
KSyncBackRefNode
 
typedef boost::intrusive::set
< KSyncBackReference,
KSyncBackRefNode
BackRefTree
 

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::KSyncEntryPtr
stale_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

Definition at line 85 of file ksync_object.h.

Definition at line 80 of file ksync_object.h.

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

Definition at line 84 of file ksync_object.h.

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

Definition at line 79 of file ksync_object.h.

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

Definition at line 74 of file ksync_object.h.

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

Definition at line 75 of file ksync_object.h.

Constructor & Destructor Documentation

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

Definition at line 55 of file ksync_object.cc.

Here is the call graph for this function:

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 ( )
virtual

Definition at line 72 of file ksync_object.cc.

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 1465 of file ksync_object.cc.

Here is the call graph for this function:

void KSyncObject::BackRefDel ( KSyncEntry key)

Definition at line 1479 of file ksync_object.cc.

Here is the call graph for this function:

void KSyncObject::BackRefReEval ( KSyncEntry key)

Definition at line 1501 of file ksync_object.cc.

Here is the call graph for this function:

void KSyncObject::Change ( KSyncEntry entry)

Definition at line 225 of file ksync_object.cc.

Here is the call graph for this function:

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:

virtual void KSyncObject::CleanupOnDel ( KSyncEntry kentry)
inlineprivatevirtual

Reimplemented in KSyncDBObject.

Definition at line 179 of file ksync_object.h.

void KSyncObject::ClearStale ( KSyncEntry entry)
protected

Definition at line 148 of file ksync_object.cc.

KSyncEntry * KSyncObject::Create ( const KSyncEntry key)

Definition at line 179 of file ksync_object.cc.

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:

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

Definition at line 122 of file ksync_object.cc.

Here is the call graph for this function:

KSyncEntry * KSyncObject::CreateStale ( const KSyncEntry key)

Definition at line 183 of file ksync_object.cc.

Here is the call graph for this function:

void KSyncObject::Delete ( KSyncEntry entry)

Definition at line 229 of file ksync_object.cc.

Here is the call graph for this function:

bool KSyncObject::delete_scheduled ( )
inline

Definition at line 146 of file ksync_object.h.

KSyncObject::DISALLOW_COPY_AND_ASSIGN ( KSyncObject  )
private
virtual bool KSyncObject::DoEventTrace ( void  )
inlinevirtual

Reimplemented in FlowTableKSyncObject.

Definition at line 140 of file ksync_object.h.

virtual void KSyncObject::EmptyTable ( void  )
inlinevirtual
KSyncEntry * KSyncObject::Find ( const KSyncEntry key)

Definition at line 99 of file ksync_object.cc.

void KSyncObject::Free ( KSyncEntry entry)
virtual

Reimplemented in FlowTableKSyncObject.

Definition at line 268 of file ksync_object.cc.

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:

uint32_t KSyncObject::GetKey ( KSyncEntry entry)
protectedvirtual

Reimplemented in FlowTableKSyncObject.

Definition at line 254 of file ksync_object.cc.

virtual SandeshTraceBufferPtr KSyncObject::GetKSyncTraceBuf ( )
inlinevirtual

Definition at line 147 of file ksync_object.h.

KSyncEntry * KSyncObject::GetReference ( const KSyncEntry key)

Definition at line 214 of file ksync_object.cc.

Here is the call graph for this function:

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:

bool KSyncObject::IsEmpty ( void  )
inline

Definition at line 138 of file ksync_object.h.

bool KSyncObject::IsIndexValid ( ) const
inlineprivate

Definition at line 173 of file ksync_object.h.

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:

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:

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

Definition at line 108 of file ksync_object.cc.

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:

virtual void KSyncObject::PreFree ( KSyncEntry entry)
inlinevirtual

Definition at line 141 of file ksync_object.h.

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:

void KSyncObject::set_delete_scheduled ( )
inline

Definition at line 145 of file ksync_object.h.

void KSyncObject::Shutdown ( )
static

Definition at line 94 of file ksync_object.cc.

std::size_t KSyncObject::Size ( )
inline

Definition at line 144 of file ksync_object.h.

bool KSyncObject::StaleEntryCleanupCb ( )
private

Definition at line 1433 of file ksync_object.cc.

Here is the call graph for this function:

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

friend class KSyncEntry
friend

Definition at line 165 of file ksync_object.h.

void TestTriggerStaleEntryCleanupCb ( KSyncObject obj)
friend

Definition at line 51 of file ksync_object.cc.

Member Data Documentation

KSyncObject::BackRefTree KSyncObject::back_ref_tree_
staticprivate

Definition at line 186 of file ksync_object.h.

bool KSyncObject::delete_scheduled_
private

Definition at line 192 of file ksync_object.h.

KSyncObject::FwdRefTree KSyncObject::fwd_ref_tree_
staticprivate

Definition at line 184 of file ksync_object.h.

KSyncIndexTable KSyncObject::index_table_
private

Definition at line 190 of file ksync_object.h.

SandeshTraceBufferPtr KSyncObject::KSyncTraceBuf
private

Definition at line 202 of file ksync_object.h.

tbb::recursive_mutex KSyncObject::lock_
mutableprotected

Definition at line 156 of file ksync_object.h.

bool KSyncObject::need_index_
private

Definition at line 188 of file ksync_object.h.

uint16_t KSyncObject::stale_entries_per_intvl_
private

Definition at line 201 of file ksync_object.h.

uint32_t KSyncObject::stale_entry_cleanup_intvl_
private

Definition at line 200 of file ksync_object.h.

Timer* KSyncObject::stale_entry_cleanup_timer_
private

Definition at line 198 of file ksync_object.h.

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

Definition at line 195 of file ksync_object.h.

Tree KSyncObject::tree_
private

Definition at line 182 of file ksync_object.h.


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