OpenSDN source code
ifmap_node_proxy.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
7 
8 #include "ifmap/ifmap_node.h"
9 #include "ifmap/ifmap_table.h"
10 
11 using namespace std;
12 
14  : node_(NULL), id_(DBTable::kInvalidId) {
15 }
16 
18  : node_(NULL), id_(DBTable::kInvalidId) {
19  Swap(rhs);
20 }
21 
23  : node_(node), id_(lid) {
24  node_->SetState(node_->table(), id_, this);
25 }
26 
28  if (node_ != NULL) {
30  }
31 }
32 
34  swap(node_, rhs->node_);
35  swap(id_, rhs->id_);
36  if (node_ != NULL) {
37  node_->SetState(node_->table(), id_, this);
38  }
39  if (rhs->node_ != NULL) {
40  rhs->node_->SetState(rhs->node_->table(), rhs->id_, rhs);
41  }
42 }
43 
45  if (node_ != NULL) {
47  node_ = NULL;
49  }
50 }
void ClearState(DBTableBase *tbl_base, ListenerId listener)
Definition: db_entry.cc:74
void SetState(DBTableBase *tbl_base, ListenerId listener, DBState *state)
Definition: db_entry.cc:23
static const int kInvalidId
Definition: db_table.h:65
int ListenerId
Definition: db_table.h:63
IFMapNode * node_
void Swap(IFMapNodeProxy *rhs)
DBTable::ListenerId id_
IFMapTable * table()
Definition: ifmap_node.h:30