OpenSDN source code
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
5
#include "
ifmap/ifmap_node_proxy.h
"
6
7
#include "
ifmap/ifmap_node.h
"
8
#include "
ifmap/ifmap_table.h
"
9
10
using namespace
std;
11
12
IFMapNodeProxy::IFMapNodeProxy
()
13
: node_(NULL), id_(
DBTable
::kInvalidId) {
14
}
15
16
IFMapNodeProxy::IFMapNodeProxy
(
IFMapNodeProxy
*rhs)
17
: node_(NULL), id_(
DBTable
::kInvalidId) {
18
Swap
(rhs);
19
}
20
21
IFMapNodeProxy::IFMapNodeProxy
(
IFMapNode
*node,
DBTable::ListenerId
lid)
22
: node_(node), id_(lid) {
23
node_
->
SetState
(
node_
->
table
(),
id_
,
this
);
24
}
25
26
IFMapNodeProxy::~IFMapNodeProxy
() {
27
if
(
node_
!= NULL) {
28
node_
->
ClearState
(
node_
->
table
(),
id_
);
29
}
30
}
31
32
void
IFMapNodeProxy::Swap
(
IFMapNodeProxy
*rhs) {
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
43
void
IFMapNodeProxy::Clear
() {
44
if
(
node_
!= NULL) {
45
node_
->
ClearState
(
node_
->
table
(),
id_
);
46
node_
= NULL;
47
id_
=
DBTable::kInvalidId
;
48
}
49
}
IFMapNodeProxy::~IFMapNodeProxy
~IFMapNodeProxy()
Definition:
ifmap_node_proxy.cc:26
DBTable
Definition:
db_table.h:167
IFMapNodeProxy::node_
IFMapNode * node_
Definition:
ifmap_node_proxy.h:26
DBEntryBase::SetState
void SetState(DBTableBase *tbl_base, ListenerId listener, DBState *state)
Definition:
db_entry.cc:22
ifmap_node.h
DBTableBase::ListenerId
int ListenerId
Definition:
db_table.h:62
ifmap_node_proxy.h
IFMapNodeProxy
Definition:
ifmap_node_proxy.h:14
IFMapNode::table
IFMapTable * table()
Definition:
ifmap_node.h:29
IFMapNodeProxy::Swap
void Swap(IFMapNodeProxy *rhs)
Definition:
ifmap_node_proxy.cc:32
IFMapNodeProxy::IFMapNodeProxy
IFMapNodeProxy()
Definition:
ifmap_node_proxy.cc:12
ifmap_table.h
IFMapNodeProxy::id_
DBTable::ListenerId id_
Definition:
ifmap_node_proxy.h:27
IFMapNode
Definition:
ifmap_node.h:14
DBEntryBase::ClearState
void ClearState(DBTableBase *tbl_base, ListenerId listener)
Definition:
db_entry.cc:73
IFMapNodeProxy::Clear
void Clear()
Definition:
ifmap_node_proxy.cc:43
DBTableBase::kInvalidId
static const int kInvalidId
Definition:
db_table.h:64
contrail
controller
src
ifmap
ifmap_node_proxy.cc
Generated by
1.8.5