Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : * Copyright Contributors to the OpenSDN project 4 : */ 5 : 6 : #ifndef ctrlplane_ifmap_table_h 7 : #define ctrlplane_ifmap_table_h 8 : 9 : #include "db/db_graph_table.h" 10 : 11 : class IFMapNode; 12 : class IFMapNodeTableListShowEntry; 13 : class IFMapObject; 14 : 15 : class IFMapTable : public DBGraphTable { 16 : public: 17 : static const int kPartitionCount = 1; 18 : struct RequestKey : DBRequestKey { 19 : std::string id_type; 20 : std::string id_name; 21 : uint64_t id_seq_num; 22 : }; 23 : 24 : IFMapTable(DB *db, const std::string &name, DBGraph *graph); 25 : 26 2451066 : virtual int PartitionCount() const { 27 2451066 : return kPartitionCount; 28 : } 29 : 30 : virtual const char *Typename() const = 0; 31 : 32 : // Allocate an IFMapObject 33 : virtual IFMapObject *AllocObject() = 0; 34 : 35 : IFMapNode *FindNode(const std::string &name); 36 : IFMapNode *FindNextNode(const std::string &name); 37 : 38 : virtual void Clear() = 0; 39 : 40 : static IFMapTable *FindTable(DB *db, const std::string &element_type); 41 : static void ClearTables(DB *db); 42 : static void FillNodeTableList(DB *db, 43 : std::vector<IFMapNodeTableListShowEntry> *table_list); 44 : }; 45 : #endif