AFI
Advanced Forwarding Interface
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
AftTable Class Reference

Index table container class. More...

#include <AftNode.h>

Inheritance diagram for AftTable:
AftNode

Public Types

typedef std::shared_ptr< AftTablePtr
 Pointer type for tables.
 

Public Member Functions

 AftTable (const AftTable &node)
 Copy constructor for a table. More...
 
 AftTable (const AftField newTableField, const AftIndex newTableMaximum, const AftNodeToken newTableDefaultNode)
 Construct an indexed table lookup. More...
 
 _tableMaximum (newTableMaximum)
 
 _tableDefaultNode (newTableDefaultNode)
 
 AftTable (const AftFieldVector newTableFields, const AftIndex newTableMaximum, const AftNodeToken newTableDefaultNode)
 Construct an indexed table lookup. More...
 
const AftFieldVectortableFields () const
 
const AftIndex tableMaximum () const
 
const AftNodeToken tableDefaultNode () 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...
 
- Public Member Functions inherited from AftNode
 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 AftTable::Ptr create (const AftField newTableField, const AftIndex newTableMaximum, const AftNodeToken newTableDefaultNode)
 Factory generate an indexed table lookup. More...
 
static AftTable::Ptr create (const AftFieldVector newTableFields, const AftIndex newTableMaximum, const AftNodeToken newTableDefaultNode)
 Factory generate an indexed table lookup. More...
 
- Static Public Member Functions inherited from AftNode
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 _tableFields
 Fields used to build key for table lookup.
 
AftIndex _tableMaximum
 Maximum number of entries in table.
 
AftNodeToken _tableDefaultNode
 Default node to execute if no match in table made.
 
- Protected Attributes inherited from AftNode
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

- Protected Member Functions inherited from AftNode
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...
 

Detailed Description

Index table container class.

Constructor & Destructor Documentation

AftTable::AftTable ( const AftTable node)
inline

Copy constructor for a table.

Parameters
[in]nodeAftTable to copy
AftTable::AftTable ( const AftField  newTableField,
const AftIndex  newTableMaximum,
const AftNodeToken  newTableDefaultNode 
)
inline

Construct an indexed table lookup.

Parameters
[in]newTableFieldPacket field used as a lookup index
[in]newTableMaximumMaximum size of lookup index
[in]newTableDefaultNodeDefault node to execute if no lookup match found
AftTable::AftTable ( const AftFieldVector  newTableFields,
const AftIndex  newTableMaximum,
const AftNodeToken  newTableDefaultNode 
)
inline

Construct an indexed table lookup.

Parameters
[in]newTableFieldsVector of packet fields used as a lookup index
[in]newTableMaximumMaximum size of lookup index
[in]newTableDefaultNodeDefault node to execute if no lookup match found

Member Function Documentation

static AftTable::Ptr AftTable::create ( const AftField  newTableField,
const AftIndex  newTableMaximum,
const AftNodeToken  newTableDefaultNode 
)
inlinestatic

Factory generate an indexed table lookup.

Parameters
[in]newTableFieldPacket field used as a lookup index
[in]newTableMaximumMaximum size of lookup index
[in]newTableDefaultNodeDefault node to execute if no lookup match found
static AftTable::Ptr AftTable::create ( const AftFieldVector  newTableFields,
const AftIndex  newTableMaximum,
const AftNodeToken  newTableDefaultNode 
)
inlinestatic

Factory generate an indexed table lookup.

Parameters
[in]newTableFieldsVector of packet fields used as a lookup index
[in]newTableMaximumMaximum size of lookup index
[in]newTableDefaultNodeDefault node to execute if no lookup match found
virtual std::ostream& AftTable::description ( std::ostream &  os) const
inlinevirtual

Append a description of the node to an output stream.

Parameters
[in]osReference to output stream to append description to
Returns
Reference to output stream with text description of node appended

Reimplemented from AftNode.

virtual void AftTable::nextNodes ( AftTokenVector nextTokens)
inlinevirtual
Returns
Appends valid next tokens to token vector

Reimplemented from AftNode.

virtual const std::string AftTable::nodeType ( ) const
inlinevirtual
Returns
Printable class type of node

Reimplemented from AftNode.

const AftNodeToken AftTable::tableDefaultNode ( ) const
inline
Returns
Default node to execute if no lookup match found
const AftFieldVector& AftTable::tableFields ( ) const
inline
Returns
Reference to vector of packet fields used as a lookup key
const AftIndex AftTable::tableMaximum ( ) const
inline
Returns
Maximum size of lookup index

The documentation for this class was generated from the following file: