OpenSDN source code
|
This class represents an array of BGP Large Community values. A LargeCommunity consists of one or more 12-byte tuples. This class provides manipulation (append, remove, set), comparison, hashing, and conversion to/from human-readable formats. More...
#include <community.h>
Public Types | |
typedef boost::array< uint8_t, 12 > | LargeCommunityValue |
A single Large Community value. More... | |
typedef std::vector< LargeCommunityValue > | LargeCommunityList |
A list (vector) of LargeCommunityValue items. More... | |
Public Member Functions | |
LargeCommunity (LargeCommunityDB *largecomm_db) | |
Constructs an instance of the class and links to the given LargeCommunityDB instance. More... | |
LargeCommunity (const LargeCommunity &rhs) | |
Copy constructor. More... | |
LargeCommunity (LargeCommunityDB *largecomm_db, const LargeCommunitySpec spec) | |
Constructs an instance of the class using the given LargeCommunitySpec and links to the given LargeCommunityDB instance. More... | |
virtual | ~LargeCommunity () |
Destroys an instance. More... | |
virtual void | Remove () |
Remove this community. More... | |
int | CompareTo (const LargeCommunity &rhs) const |
Compare this LargeCommunity to another. More... | |
const LargeCommunityList & | communities () const |
Get the list of Large Community values. More... | |
Static Public Member Functions | |
static LargeCommunityList | LargeCommunityFromString (const std::string &comm) |
Parse a string into a list of LargeCommunity values. More... | |
static LargeCommunityValue | FromHexString (const std::string &comm, boost::system::error_code *errorp) |
Convert a hexadecimal string to a LargeCommunityValue. More... | |
static std::string | ToString (const LargeCommunityValue &val) |
Convert a LargeCommunityValue to a human-readable string. More... | |
static std::string | ToHexString (const LargeCommunityValue &val) |
Convert a LargeCommunityValue to a hexadecimal string. More... | |
Private Member Functions | |
void | Append (const LargeCommunityValue &value) |
Append a single LargeCommunity value. More... | |
void | Append (const LargeCommunityList &list) |
Append a list of LargeCommunity values. More... | |
void | Remove (const LargeCommunityList &list) |
Remove specific LargeCommunity values. More... | |
void | Set (const LargeCommunityList &list) |
Replace all existing values with the provided list. More... | |
Private Attributes | |
tbb::atomic< int > | refcount_ |
A reference counter, needed for memory management. More... | |
LargeCommunityDB * | largecomm_db_ |
A pointer to the managing LargeCommunityDB. More... | |
LargeCommunityList | communities_ |
A list of LargeCommunity storing BGP Large Community values. More... | |
Friends | |
class | LargeCommunityDB |
Enables the access to private members for LargeCommunityDB. More... | |
class | BgpAttrTest |
Enables the access to private members for BgpAttrTest. More... | |
std::size_t | hash_value (LargeCommunity const &comm) |
Compute the hash value for a LargeCommunity object. More... | |
int | intrusive_ptr_add_ref (const LargeCommunity *clargecomm) |
Increment reference count atomically. More... | |
int | intrusive_ptr_del_ref (const LargeCommunity *clargecomm) |
Decrement reference count of an clargecomm. More... | |
void | intrusive_ptr_release (const LargeCommunity *clargecomm) |
Release a LargeCommunity instance when the reference count reaches zero. More... | |
This class represents an array of BGP Large Community values. A LargeCommunity consists of one or more 12-byte tuples. This class provides manipulation (append, remove, set), comparison, hashing, and conversion to/from human-readable formats.
Definition at line 547 of file community.h.
typedef std::vector<LargeCommunityValue> LargeCommunity::LargeCommunityList |
A list (vector) of LargeCommunityValue items.
Definition at line 553 of file community.h.
typedef boost::array<uint8_t, 12> LargeCommunity::LargeCommunityValue |
A single Large Community value.
Definition at line 550 of file community.h.
|
inlineexplicit |
Constructs an instance of the class and links to the given LargeCommunityDB instance.
Definition at line 557 of file community.h.
|
inlineexplicit |
Copy constructor.
Definition at line 563 of file community.h.
|
explicit |
Constructs an instance of the class using the given LargeCommunitySpec and links to the given LargeCommunityDB instance.
Definition at line 1093 of file community.cc.
|
inlinevirtual |
Destroys an instance.
Definition at line 576 of file community.h.
|
private |
Append a list of LargeCommunity values.
Definition at line 1016 of file community.cc.
|
private |
Append a single LargeCommunity value.
Definition at line 1024 of file community.cc.
|
inline |
Get the list of Large Community values.
Definition at line 585 of file community.h.
int LargeCommunity::CompareTo | ( | const LargeCommunity & | rhs | ) | const |
Compare this LargeCommunity to another.
Definition at line 981 of file community.cc.
|
static |
Convert a hexadecimal string to a LargeCommunityValue.
Definition at line 1032 of file community.cc.
|
static |
Parse a string into a list of LargeCommunity values.
Definition at line 1065 of file community.cc.
|
virtual |
Remove this community.
Definition at line 1004 of file community.cc.
|
private |
Remove specific LargeCommunity values.
Definition at line 997 of file community.cc.
|
private |
Replace all existing values with the provided list.
Definition at line 1008 of file community.cc.
|
static |
Convert a LargeCommunityValue to a hexadecimal string.
Definition at line 1080 of file community.cc.
|
static |
Convert a LargeCommunityValue to a human-readable string.
Definition at line 1089 of file community.cc.
|
friend |
Enables the access to private members for BgpAttrTest.
Definition at line 625 of file community.h.
|
friend |
Compute the hash value for a LargeCommunity object.
Definition at line 598 of file community.h.
|
friend |
Increment reference count atomically.
Definition at line 645 of file community.h.
|
friend |
Decrement reference count of an clargecomm.
Definition at line 650 of file community.h.
|
friend |
Release a LargeCommunity instance when the reference count reaches zero.
Definition at line 656 of file community.h.
|
friend |
Enables the access to private members for LargeCommunityDB.
Definition at line 623 of file community.h.
|
private |
A list of LargeCommunity storing BGP Large Community values.
Definition at line 641 of file community.h.
|
private |
A pointer to the managing LargeCommunityDB.
Definition at line 639 of file community.h.
|
mutableprivate |
A reference counter, needed for memory management.
Definition at line 637 of file community.h.