dtn::ProphetNodeList Class Reference

Maintain a one-to-one mapping of objects in memory to objects in permanent store, much like a write-thru cache. More...

#include <ProphetNodeList.h>

List of all members.

Public Member Functions

 ProphetNodeList ()
 Constructor.
virtual ~ProphetNodeList ()
 Destructor.
void load (const prophet::Node *n)
 Deserialize from storage.
void update (const prophet::Node *n)
 Update (or add new) node in permanent store.
void del (const prophet::Node *n)
 Remove node from permanent store.
const prophet::Nodefind (const std::string &dest_id) const
 Retrieve node from permanent store; returns NULL if not found.
void clone (prophet::Table *nodes, const prophet::NodeParams *params)
 Copy list of nodes from permanent store into prophet::Table.
void clear ()
 Clean up memory associated with this list (leaving permanent store untouched).

bool empty () const
 Accessors.
size_t size () const
 Accessors.

Protected Types

typedef std::list
< prophet::Node * > 
List
typedef List::iterator iterator
typedef List::const_iterator const_iterator

Protected Member Functions

bool find (const std::string &dest_id, iterator &i)
 Given primary key, locate node in list.

Protected Attributes

List list_
 collection of prophet::Node's

Detailed Description

Maintain a one-to-one mapping of objects in memory to objects in permanent store, much like a write-thru cache.

Definition at line 32 of file ProphetNodeList.h.


Member Typedef Documentation

typedef List::const_iterator dtn::ProphetNodeList::const_iterator [protected]

Definition at line 84 of file ProphetNodeList.h.

typedef List::iterator dtn::ProphetNodeList::iterator [protected]

Definition at line 83 of file ProphetNodeList.h.

typedef std::list<prophet::Node*> dtn::ProphetNodeList::List [protected]

Definition at line 82 of file ProphetNodeList.h.


Constructor & Destructor Documentation

dtn::ProphetNodeList::ProphetNodeList (  ) 

Constructor.

Definition at line 25 of file ProphetNodeList.cc.

dtn::ProphetNodeList::~ProphetNodeList (  )  [virtual]

Destructor.

Definition at line 29 of file ProphetNodeList.cc.

References clear().


Member Function Documentation

void dtn::ProphetNodeList::clear (  ) 

Clean up memory associated with this list (leaving permanent store untouched).

Definition at line 120 of file ProphetNodeList.cc.

References list_.

Referenced by dtn::ProphetBundleCore::shutdown(), and ~ProphetNodeList().

void dtn::ProphetNodeList::clone ( prophet::Table nodes,
const prophet::NodeParams params 
)

Copy list of nodes from permanent store into prophet::Table.

Definition at line 110 of file ProphetNodeList.cc.

References prophet::Table::assign(), and list_.

Referenced by dtn::ProphetBundleCore::load_prophet_nodes().

void dtn::ProphetNodeList::del ( const prophet::Node n  ) 

Remove node from permanent store.

Definition at line 84 of file ProphetNodeList.cc.

References ASSERT, prophet::Node::dest_id(), find(), and list_.

Referenced by dtn::ProphetBundleCore::delete_node().

bool dtn::ProphetNodeList::empty (  )  const [inline]

Accessors.

Definition at line 77 of file ProphetNodeList.h.

References list_.

Referenced by dtn::ProphetBundleCore::load_prophet_nodes().

bool dtn::ProphetNodeList::find ( const std::string &  dest_id,
iterator i 
) [protected]

Given primary key, locate node in list.

Definition at line 130 of file ProphetNodeList.cc.

References list_.

const prophet::Node * dtn::ProphetNodeList::find ( const std::string &  dest_id  )  const

Retrieve node from permanent store; returns NULL if not found.

Definition at line 99 of file ProphetNodeList.cc.

References find().

Referenced by del(), find(), load(), and update().

void dtn::ProphetNodeList::load ( const prophet::Node n  ) 
size_t dtn::ProphetNodeList::size (  )  const [inline]

Accessors.

Definition at line 78 of file ProphetNodeList.h.

References list_.

void dtn::ProphetNodeList::update ( const prophet::Node n  ) 

Update (or add new) node in permanent store.

Definition at line 57 of file ProphetNodeList.cc.

References ASSERT, prophet::Node::dest_id(), find(), list_, and prophet::Node::p_value().

Referenced by dtn::ProphetBundleCore::update_node().


Member Data Documentation

collection of prophet::Node's

Definition at line 91 of file ProphetNodeList.h.

Referenced by clear(), clone(), del(), empty(), find(), load(), size(), and update().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 13:21:24 2010 for DTN Reference Implementation by  doxygen 1.6.3