ns3::rapidnet::RelationBase Class Reference
[RapidNet Library]

A base class for relation objects. A relation has a name and is a collection of. More...

#include <relation-base.h>

Inheritance diagram for ns3::rapidnet::RelationBase:

Inheritance graph
[legend]
Collaboration diagram for ns3::rapidnet::RelationBase:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual TypeId GetInstanceTypeId ()
virtual void AddKeyAttribute (attrdeftype attribute)=0
 Adds a key attribute to the schema. This method can be used by sub-classes for reading the list of key attributes. Sub-classes may also choose to not implement it by throwing an error.
virtual int Insert (Ptr< Tuple > tuple)=0
 Adds a tuple to the relation.
virtual void Delete (Ptr< Tuple > tuple)=0
 Deletes a tuple from the relation.
virtual void InsertAll (list< Ptr< Tuple > > tuples)
 Adds all tuples in the list to the relation.
virtual list< Ptr< Tuple > > GetAllTuples ()=0
 Returns all the tuples as a list.
virtual uint32_t Count ()=0
 Returns the number of tuples in the relation.
virtual void PrintAllTuples (ostream &os)
 Prints all the tuples to the given stream.
virtual Ptr< RelationBaseProject (string newRelnName, list< string > attrNames, list< string > newNames=list< string >())
 Implements a database project operation.
virtual Ptr< RelationBaseSelect (Ptr< Selector > selector)
 Implements a database select operation.
virtual Ptr< RelationBaseJoin (Ptr< Tuple > rTuple, list< string > lAttrs, list< string > rAttrs, bool qualify=false)
 Implements a database join operation.
virtual Ptr< RelationBaseJoin (Ptr< RelationBase > reln, list< string > lAttrNames, list< string > rAttrNames, bool qualify=false)
 Implements a database join operation.
virtual void Assign (Ptr< Assignor > assignor)
 Invokes the given Assignor on all tuples of this relation.
Time GetTimeToLive ()
 Returns the time-to-live, i.e., the soft-state timeout duration for this relation.
void SetTimeToLive (Time ttl)
 Sets the time-to-live, i.e., the soft-state timeout duration for this relation.
bool IsSoftState ()
 Returns true if this is a soft-state relation, i.e. the time-to-live is finite.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Object.

Public Attributes

TriggerList OnInsert
 The list of triggers that are invoked when a tuple is inserted.
TriggerList OnDelete
 The list of triggers that are invoked when a tuple is deleted.
TriggerList OnRefresh
 The list of triggers that are invoked when a tuple is refreshed.

Protected Attributes

Time m_timeToLive
 Time-to-live (or TTL) for soft-state timeout.


Detailed Description

A base class for relation objects. A relation has a name and is a collection of.

See also:
Tuple objects.
All tuples in the relation have the same name as the relation itself. Two common relation objects are
See also:
Relation that is defines a key to map the tuples and

TempRelation is simply a list of tuples that is generated on applying a database operation like join, select, etc.


Member Function Documentation

virtual TypeId ns3::rapidnet::RelationBase::GetInstanceTypeId (  )  [inline, virtual]

Returns:
the TypeId associated to the most-derived type of this instance.
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Implements ns3::ObjectBase.

Reimplemented in ns3::rapidnet::Relation, and ns3::rapidnet::TempRelation.

References GetTypeId().

static TypeId ns3::rapidnet::RelationBase::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Object.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

Reimplemented in ns3::rapidnet::Relation, and ns3::rapidnet::TempRelation.

Referenced by GetInstanceTypeId().

virtual Ptr<RelationBase> ns3::rapidnet::RelationBase::Join ( Ptr< RelationBase reln,
list< string >  lAttrNames,
list< string >  rAttrNames,
bool  qualify = false 
) [virtual]

Implements a database join operation.

Joins this relation with the given relation.

Parameters:
reln The relation to be joined with (on the right).
lAttrNames The join attributes for this relation (on the left).
rAttrNames The corresponding join attributes for the tuple.
qualify If true, the attribute names in the resultant relation are qualified by their respective relation names.

virtual Ptr<RelationBase> ns3::rapidnet::RelationBase::Join ( Ptr< Tuple rTuple,
list< string >  lAttrs,
list< string >  rAttrs,
bool  qualify = false 
) [virtual]

Implements a database join operation.

Joins this relation with the given tuple.

Parameters:
rTuple The tuple to be joined with (on the right).
lAttrs The join attributes for this relation (on the left).
rAttrs The corresponding join attributes for the tuple.
qualify If true, the attribute names in the resultant relation are qualified by their respective relation/tuple names.

virtual Ptr<RelationBase> ns3::rapidnet::RelationBase::Project ( string  newRelnName,
list< string >  attrNames,
list< string >  newNames = list< string >() 
) [virtual]

Implements a database project operation.

It creates and returns a new TempRelation object and inserts all the tuples in this relation to it by renaming them and their attributes

Parameters:
newRelnName Name of the new project relation
attrNames Names of the attributes that need to be projects
newNames Corresponding new names for the projected attributes If empty, the project attributes have the same name.

virtual Ptr<RelationBase> ns3::rapidnet::RelationBase::Select ( Ptr< Selector selector  )  [virtual]

Implements a database select operation.

Returns a new relation with only those tuples in this relation that satisfy the given Selector.


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

Generated on Fri Apr 9 15:01:12 2010 for NS-3 by  doxygen 1.5.8