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__);\
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
virtual bool DBEntrySandesh(Sandesh *resp, std::string &name) const =0
virtual void FreeResources(ResourceManager *resource_manager)
void ClearRefState() const
virtual void AllocateResources(ResourceManager *resource_manager)
DBState * GetAgentDBEntryState(int listener_id)
DISALLOW_COPY_AND_ASSIGN(AgentDBEntry)
boost::intrusive_ptr< AgentDBEntry > AgentDBEntyRef
virtual uint32_t GetRefCount() const =0
DISALLOW_COPY_AND_ASSIGN(AgentDBTablePartition)
AgentDBTablePartition(DBTable *parent, int index)
virtual void Add(DBEntry *entry)
virtual ~AgentDBTablePartition()
virtual void Remove(DBEntryBase *entry)
virtual void Input(DBTablePartition *root, DBClient *client, DBRequest *req)
DISALLOW_COPY_AND_ASSIGN(AgentDBTable)
SandeshTraceBufferPtr OperDBTraceBuf
SandeshTraceBufferPtr GetOperDBTraceBuf() const
AgentDBEntry * FindActiveEntry(const DBEntry *key)
virtual DBEntry * CfgAdd(DBRequest *req)
AgentDBEntry * FindActiveEntryNoLock(const DBEntry *key)
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
virtual bool IFLinkToReq(IFMapLink *link, IFMapNode *node, const std::string &peer_name, IFMapNode *peer, DBRequest &req)
virtual int PartitionCount() const
virtual bool CanNotify(IFMapNode *dbe)
virtual bool Resync(DBEntry *entry, const DBRequest *req)
void Notify(DBTablePartBase *partition, DBEntryBase *entry)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
DBTable::DBTableWalkRef flush_walk_ref_
static const int kPartitionCount
AgentDBTable(DB *db, const std::string &name)
AgentDBEntry * Find(const DBEntry *key, bool ret_del)
DBTableBase::ListenerId GetRefListenerId() const
virtual void Process(DBRequest &req)
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &uuid)
DBTableBase::ListenerId ref_listener_id_
virtual void OnZeroRefcount(AgentDBEntry *e)
virtual DBTablePartition * AllocPartition(int index)
virtual void NotifyEntry(DBEntryBase *entry)
void reset_flush_walk_ref()
void set_agent(Agent *agent)
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &id)
AgentRefCount & operator=(const AgentRefCount &)
uint32_t GetRefCount() const
friend void intrusive_ptr_release(const Derived *p)
void swap(AgentRefCount &)
friend void intrusive_ptr_del_back_ref(const IntrusiveReferrer ref, const Derived *p)
tbb::mutex back_ref_mutex_
std::set< IntrusiveReferrer > back_ref_set_
friend void intrusive_ptr_add_ref(const Derived *p)
tbb::atomic< uint32_t > refcount_
AgentRefCount(const AgentRefCount &)
friend void intrusive_ptr_add_back_ref(const IntrusiveReferrer ref, const Derived *p)
const std::string & name() const
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
std::pair< void *, void * > IntrusiveReferrer
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
const AgentDBEntry * entry_
AgentDBState(const AgentDBEntry *entry)
AgentKey(DBSubOperation sub_op)