OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ifmap_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef ctrlplane_ifmap_table_h
6 #define ctrlplane_ifmap_table_h
7 
8 #include "db/db_graph_table.h"
9 
10 class IFMapNode;
11 class IFMapNodeTableListShowEntry;
12 class IFMapObject;
13 
14 class IFMapTable : public DBGraphTable {
15 public:
16  static const int kPartitionCount = 1;
18  std::string id_type;
19  std::string id_name;
20  uint64_t id_seq_num;
21  };
22 
23  IFMapTable(DB *db, const std::string &name, DBGraph *graph);
24 
25  virtual int PartitionCount() const {
26  return kPartitionCount;
27  }
28 
29  virtual const char *Typename() const = 0;
30 
31  // Allocate an IFMapObject
32  virtual IFMapObject *AllocObject() = 0;
33 
34  IFMapNode *FindNode(const std::string &name);
35  IFMapNode *FindNextNode(const std::string &name);
36 
37  virtual void Clear() = 0;
38 
39  static IFMapTable *FindTable(DB *db, const std::string &element_type);
40  static void ClearTables(DB *db);
41  static void FillNodeTableList(DB *db,
42  std::vector<IFMapNodeTableListShowEntry> *table_list);
43 };
44 #endif
virtual void Clear()=0
const DBGraph * graph() const
virtual IFMapObject * AllocObject()=0
static const int kPartitionCount
Definition: ifmap_table.h:16
virtual int PartitionCount() const
Definition: ifmap_table.h:25
virtual const char * Typename() const =0
IFMapTable(DB *db, const std::string &name, DBGraph *graph)
Definition: ifmap_table.cc:19
Definition: db.h:24
IFMapNode * FindNode(const std::string &name)
Definition: ifmap_table.cc:23
static void FillNodeTableList(DB *db, std::vector< IFMapNodeTableListShowEntry > *table_list)
Definition: ifmap_table.cc:57
IFMapNode * FindNextNode(const std::string &name)
Definition: ifmap_table.cc:31
const std::string & name() const
Definition: db_table.h:110
static void ClearTables(DB *db)
Definition: ifmap_table.cc:46
static IFMapTable * FindTable(DB *db, const std::string &element_type)
Definition: ifmap_table.cc:39