OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ifmap_node_proxy.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
6 
7 #include "ifmap/ifmap_node.h"
8 #include "ifmap/ifmap_table.h"
9 
10 using namespace std;
11 
13  : node_(NULL), id_(DBTable::kInvalidId) {
14 }
15 
17  : node_(NULL), id_(DBTable::kInvalidId) {
18  Swap(rhs);
19 }
20 
22  : node_(node), id_(lid) {
23  node_->SetState(node_->table(), id_, this);
24 }
25 
27  if (node_ != NULL) {
29  }
30 }
31 
33  swap(node_, rhs->node_);
34  swap(id_, rhs->id_);
35  if (node_ != NULL) {
36  node_->SetState(node_->table(), id_, this);
37  }
38  if (rhs->node_ != NULL) {
39  rhs->node_->SetState(rhs->node_->table(), rhs->id_, rhs);
40  }
41 }
42 
44  if (node_ != NULL) {
46  node_ = NULL;
48  }
49 }
IFMapNode * node_
void SetState(DBTableBase *tbl_base, ListenerId listener, DBState *state)
Definition: db_entry.cc:22
int ListenerId
Definition: db_table.h:62
IFMapTable * table()
Definition: ifmap_node.h:29
void Swap(IFMapNodeProxy *rhs)
DBTable::ListenerId id_
void ClearState(DBTableBase *tbl_base, ListenerId listener)
Definition: db_entry.cc:73
static const int kInvalidId
Definition: db_table.h:64