xorp

FibConfigTransactionManager Class Reference

Class to store and execute FibConfig transactions. More...

#include <fibconfig_transaction.hh>

Inheritance diagram for FibConfigTransactionManager:
TransactionManager

List of all members.

Public Member Functions

 FibConfigTransactionManager (EventLoop &eventloop, FibConfig &fibconfig)
 Constructor.
FibConfigfibconfig ()
 Get a reference to the FibConfig.
const string & error () const
 Get the string with the first error during commit.
size_t max_ops () const
 Get the maximum number of operations.

Protected Member Functions

virtual void pre_commit (uint32_t tid)
 Pre-commit method that is called before the first operation in a commit.
virtual void post_commit (uint32_t tid)
 Post-commit method that is called after the last operation in a commit.
virtual void operation_result (bool success, const TransactionOperation &op)
 Method that is called after each operation.

Private Types

enum  { TIMEOUT_MS = 5000, MAX_PENDING = 10, MAX_OPS = 200 }

Private Member Functions

int set_error (const string &error)
 Set the string with the error.
void reset_error ()
 Reset the string with the error.

Private Attributes

FibConfig_fibconfig
string _first_error

Detailed Description

Class to store and execute FibConfig transactions.

An FibConfig transaction is a sequence of commands that should executed atomically.


Constructor & Destructor Documentation

FibConfigTransactionManager::FibConfigTransactionManager ( EventLoop eventloop,
FibConfig fibconfig 
) [inline]

Constructor.

Parameters:
eventloopthe event loop to use.
fibconfigthe FibConfig to use.
See also:
FibConfig.

Member Function Documentation

const string& FibConfigTransactionManager::error ( ) const [inline]

Get the string with the first error during commit.

Returns:
the string with the first error during commit or an empty string if no error.
FibConfig& FibConfigTransactionManager::fibconfig ( ) [inline]

Get a reference to the FibConfig.

Returns:
a reference to the FibConfig.
See also:
FibConfig.
size_t FibConfigTransactionManager::max_ops ( ) const [inline]

Get the maximum number of operations.

Returns:
the maximum number of operations.
void FibConfigTransactionManager::operation_result ( bool  success,
const TransactionOperation op 
) [protected, virtual]

Method that is called after each operation.

This is an overriding method.

Parameters:
successset to true if the operation succeeded, otherwise false.
opthe operation that has been just called.

Reimplemented from TransactionManager.

void FibConfigTransactionManager::post_commit ( uint32_t  tid) [protected, virtual]

Post-commit method that is called after the last operation in a commit.

This is an overriding method.

Parameters:
tidthe transaction ID.

Reimplemented from TransactionManager.

void FibConfigTransactionManager::pre_commit ( uint32_t  tid) [protected, virtual]

Pre-commit method that is called before the first operation in a commit.

This is an overriding method.

Parameters:
tidthe transaction ID.

Reimplemented from TransactionManager.

int FibConfigTransactionManager::set_error ( const string &  error) [private]

Set the string with the error.

Only the string for the first error is recorded.

Parameters:
errorthe string with the error.
Returns:
XORP_OK if this was the first error, otherwise XORP_ERROR.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations