AFI
Advanced Forwarding Interface
|
![]() |
The basic counter class. More...
#include <AftNode.h>
Public Types | |
typedef std::shared_ptr < AftCounter > | Ptr |
Pointer type for counters. | |
Public Member Functions | |
AftCounter (const AftCounter &node) | |
Copy constructor for a counter. More... | |
AftCounter (uint64_t newInitialBytes=0, uint64_t newInitialPackets=0, bool newL3Mode=false) | |
Construct a counter. More... | |
const uint64_t | initialBytes () const |
const uint64_t | initialPackets () const |
const bool | l3Mode () const |
virtual const std::string | nodeType () const |
![]() | |
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 | nodeIsContainer () const |
@ returns true if node can take entries | |
virtual const bool | nodeIsDelete () const |
@ returns true if node is a delete | |
virtual const bool | nodeIsValid (const AftValidatorPtr &validator, std::ostream &os) |
@ returns true if node is valid | |
virtual void | nextNodes (AftTokenVector &nextTokens) |
virtual std::ostream & | description (std::ostream &os) const |
Append a description of the node to an output stream. More... | |
Static Public Member Functions | |
static AftCounter::Ptr | create (uint64_t newInitialBytes=0, uint64_t newInitialPackets=0, bool newL3Mode=false) |
Construct a counter. 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 | |
uint64_t | _initialBytes |
Optional initial byte count of counter. | |
uint64_t | _initialPackets |
Optional initial packet count of counter. | |
bool | _l3Mode |
Optional L3 mode of counter (if true, counts L3 bytes) | |
![]() | |
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... | |
The basic counter class.
Counters are amongst the most basic (and numerous) of Aft nodes. Any time a counter appears in a node execution graph, it's incremented when that graph is executed. Counters are almost always referenced by their names so it's important to make sure that every counter that's created has a name that you can locate later.
|
inline |
Copy constructor for a counter.
[in] | node | AftCounter to copy |
|
inline |
Construct a counter.
[in] | newInitialBytes | Optional initial byte count of counter |
[in] | newInitialPackets | Optional initial byte count of counter |
[in] | newL3Mode | Optional L3 mode of counter (if true, counts L3 bytes) |
|
inlinestatic |
Construct a counter.
[in] | newInitialBytes | Optional initial byte count of counter |
[in] | newInitialPackets | Optional initial byte count of counter |
[in] | newL3Mode | Optional L3 mode of counter (if true, counts L3 bytes) |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from AftNode.