AFI
Advanced Forwarding Interface
|
![]() |
Variable-length key lookup tree container class. More...
#include <AftNode.h>
Public Types | |
typedef std::shared_ptr< AftTree > | Ptr |
Pointer type for trees. | |
Public Member Functions | |
AftTree (const AftTree &node) | |
Copy constructor for a tree. More... | |
AftTree (const AftField newTreeField, const AftNodeToken newTreeDefaultNode) | |
Construct a lookup tree. More... | |
_treeDefaultNode (newTreeDefaultNode) | |
AftTree (const AftFieldVector newTreeFields, const AftNodeToken newTreeDefaultNode) | |
Construct a lookup tree. More... | |
const AftFieldVector & | treeFields () const |
const AftNodeToken | treeDefaultNode () const |
virtual const bool | nodeIsValid (const AftValidatorPtr &validator, std::ostream &os) |
@ returns true if node is valid | |
virtual const std::string | nodeType () const |
virtual const bool | nodeIsContainer () const |
@ returns true if node can take entries | |
virtual void | nextNodes (AftTokenVector &nextTokens) |
virtual std::ostream & | description (std::ostream &os) const |
Append a description of the node to an output stream. More... | |
![]() | |
AftNode (const AftNode &node) | |
Copy constructor for a basic node. More... | |
AftNode (const AftNodeToken newToken=AFT_NODE_TOKEN_NONE, const AftNodeToken newNext=AFT_NODE_TOKEN_NONE, const std::string newName="") | |
Construct an entry for a basic node. More... | |
operator const AftNodeToken () const | |
const AftNodeToken | nodeToken () const |
const std::string | nodeName () const |
const AftTypeIndex | nodeTypeIndex () const |
void | setNodeNext (AftNodeToken newNext) |
Set the (optional) next node. More... | |
const AftNodeToken | nodeNext () const |
void | setNodeParameters (const AftParameters::Ptr &newParams) |
Set the optional parameters of the node. More... | |
const AftParameters::Ptr | nodeParameters () const |
template<class T > | |
std::shared_ptr< T > | nodeParameter (const std::string &name) |
Convenience parameter access template. Use this to access node parameters. More... | |
void | setNodeParameter (const std::string &name, const AftDataPtr &data) |
Convenience parameter setter. Use this to set node parameters. More... | |
virtual const bool | nodeIsDelete () const |
@ returns true if node is a delete | |
Static Public Member Functions | |
static AftTree::Ptr | create (const AftField newTreeField, const AftNodeToken newTreeDefaultNode) |
Factory generate a lookup tree. More... | |
static AftTree::Ptr | create (const AftFieldVector newTreeFields, const AftNodeToken newTreeDefaultNode) |
Factory generate a lookup tree. More... | |
![]() | |
template<class T > | |
static std::shared_ptr< T > | downcast (const AftNodePtr &node) |
Convenience downcast template. Use this instead of manual casting if required. More... | |
Protected Attributes | |
AftFieldVector | _treeFields |
Fields used to build key for tree. | |
AftNodeToken | _treeDefaultNode |
Default node to execute if no match made. | |
![]() | |
friend | AftInsert |
AftInsert accesses the setNodeName and setNodeToken methods. | |
friend | AftSandbox |
AftSandbox accesses the setNodeName and setNodeToken methods. | |
friend | AfiNodeRpc |
AfiNodeRpc accesses the setNodeName and setNodeToken methods. | |
AftNodeToken | _nodeToken |
Unique token value for node. | |
AftNodeToken | _nodeNext |
Optional value of next node. | |
std::string | _nodeName |
Optional name of node. | |
AftParameters::Ptr | _nodeParams |
Optional node parameters. | |
AftTypeIndex | _nodeTypeIndex |
Scalar index type for node. | |
Additional Inherited Members | |
![]() | |
void | setNodeName (std::string newName) |
Set the name of the node. More... | |
void | setNodeToken (AftNodeToken newToken) |
Set the token value of the node. More... | |
void | setNodeTypeIndex (AftTypeIndex newTypeIndex) |
Set the sandbox node type index. More... | |
Variable-length key lookup tree container class.
|
inline |
Copy constructor for a tree.
[in] | node | AftTree to copy |
|
inline |
Construct a lookup tree.
[in] | newTreeField | Packet field used as a lookup key |
[in] | newTreeDefaultNode | Default node to execute if no lookup match found |
|
inline |
Construct a lookup tree.
[in] | newTreeFields | Vector of packet fields used as a lookup key |
[in] | newTreeDefaultNode | Default node to execute if no lookup match found |
|
inlinestatic |
Factory generate a lookup tree.
[in] | newTreeField | Packet field used as a lookup key |
[in] | newTreeDefaultNode | Default node to execute if no lookup match found |
|
inlinestatic |
Factory generate a lookup tree.
[in] | newTreeFields | Vector of packet fields used as a lookup key |
[in] | newTreeDefaultNode | Default node to execute if no lookup match found |
|
inlinevirtual |
Append a description of the node to an output stream.
[in] | os | Reference to output stream to append description to |
Reimplemented from AftNode.
|
inlinevirtual |
Reimplemented from AftNode.
|
inlinevirtual |
Reimplemented from AftNode.
|
inline |
|
inline |