5 #ifndef vnsw_agent_db_hpp
6 #define vnsw_agent_db_hpp
23 template <
class Derived>
28 if (entry->
refcount_.fetch_and_increment() == 0) {
35 if (entry->
refcount_.fetch_and_decrement() == 1) {
165 virtual void Clear();
173 const std::string &peer_name,
IFMapNode *peer,
187 const std::string &context) {
229 #define OPER_TRACE(obj, ...)\
231 Oper##obj::TraceMsg(GetOperDBTraceBuf(), __FILE__, __LINE__, __VA_ARGS__);\
234 #define OPER_TRACE_ENTRY(obj, table, ...)\
236 Oper##obj::TraceMsg(table->GetOperDBTraceBuf(),\
237 __FILE__, __LINE__, __VA_ARGS__);\
240 #endif // vnsw_agent_db_hpp
void Notify(DBTablePartBase *partition, DBEntryBase *entry)
DISALLOW_COPY_AND_ASSIGN(AgentDBEntry)
const AgentDBEntry * entry_
boost::intrusive_ptr< AgentDBEntry > AgentDBEntyRef
std::set< IntrusiveReferrer > back_ref_set_
DBTableBase::ListenerId GetRefListenerId() const
uint32_t GetRefCount() const
tbb::atomic< uint32_t > refcount_
virtual void Add(DBEntry *entry)
AgentRefCount & operator=(const AgentRefCount &)
virtual ~AgentDBTablePartition()
AgentDBEntry * FindActiveEntry(const DBEntry *key)
std::pair< void *, void * > IntrusiveReferrer
friend void intrusive_ptr_add_ref(const Derived *p)
SandeshTraceBufferPtr OperDBTraceBuf
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
AgentDBEntry * FindActiveEntryNoLock(const DBEntry *key)
friend void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const Derived *p)
virtual uint32_t GetRefCount() const =0
AgentDBState(const AgentDBEntry *entry)
DBState * GetAgentDBEntryState(int listener_id)
virtual void AllocateResources(ResourceManager *resource_manager)
virtual void FreeResources(ResourceManager *resource_manager)
virtual bool CanNotify(IFMapNode *dbe)
AgentKey(DBSubOperation sub_op)
DBTableBase::ListenerId ref_listener_id_
AgentDBTable(DB *db, const std::string &name)
tbb::mutex back_ref_mutex_
void ClearRefState() const
AgentRefCount(const AgentRefCount &)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
const std::string & name() const
AgentDBEntry * Find(const DBEntry *key, bool ret_del)
virtual void Process(DBRequest &req)
virtual int PartitionCount() const
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &id)
SandeshTraceBufferPtr GetOperDBTraceBuf() const
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &uuid)
void reset_flush_walk_ref()
virtual DBTablePartition * AllocPartition(int index)
void swap(AgentRefCount &)
virtual DBEntry * CfgAdd(DBRequest *req)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
DISALLOW_COPY_AND_ASSIGN(AgentDBTable)
virtual bool Resync(DBEntry *entry, const DBRequest *req)
virtual void Remove(DBEntryBase *entry)
virtual bool DBEntrySandesh(Sandesh *resp, std::string &name) const =0
friend void intrusive_ptr_release(const Derived *p)
virtual void NotifyEntry(DBEntryBase *entry)
static const int kPartitionCount
friend void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const Derived *p)
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
virtual void OnZeroRefcount(AgentDBEntry *e)
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
virtual bool IFLinkToReq(IFMapLink *link, IFMapNode *node, const std::string &peer_name, IFMapNode *peer, DBRequest &req)
DBTable::DBTableWalkRef flush_walk_ref_
AgentDBTablePartition(DBTable *parent, int index)
virtual void Input(DBTablePartition *root, DBClient *client, DBRequest *req)
void set_agent(Agent *agent)
DISALLOW_COPY_AND_ASSIGN(AgentDBTablePartition)